Skip to content

Instantly share code, notes, and snippets.

@esacteksab
esacteksab / gist:7052253
Created October 19, 2013 06:24
Answer this to cross the bridge
wiki = open('Changelog.md').readlines()
version = "0.2.8"
previous_version = int(version.split('.')[-1]) -1
last_line = str(previous_version)
parsing = False
changes = []
for line in wiki:
@esacteksab
esacteksab / gist:7052135
Created October 19, 2013 06:04
Answer this to cross the bridge
wiki = open('Changelog.md').readlines()

Troubleshooting something that gives you error message on a specific line?

Open file with cursor on that line

vim file +<page#>

e.g

vim foo.py +13 #opens file with cursor at the beginning of line 13

(py33)root@d2450e423ffd:/opt/github3.py-develop# pip install -r requirements.txt
Downloading/unpacking git+git://github.com/garybernhardt/expecter.git (from -r requirements.txt (line 3))
Cloning git://github.com/garybernhardt/expecter.git to /tmp/pip-buv8u0-build
Running setup.py egg_info for package from git+git://github.com/garybernhardt/expecter.git
Downloading/unpacking requests==1.2.3 (from -r requirements.txt (line 1))
Downloading requests-1.2.3.tar.gz (348kB): 348kB downloaded
Running setup.py egg_info for package requests
Downloading/unpacking uritemplate.py==0.2.0 (from -r requirements.txt (line 2))
def iter_all_repos(self, number=-1, since=None, etag=None, per_page=None):
"""Iterate over every repository in the order they were created.
:param int number: (optional), number of repositories to return.
Default: -1, returns all of them
:param int since: (optional), last repository id seen (allows
restarting this iteration)
:param str etag: (optional), ETag from a previous request to the same
endpoint
:param int per_page: (optional), number of repositories to list per
================================================================================================================== FAILURES ===================================================================================================================
______________________________________________________________________________________________________ TestGitHub.test_iter_repo_issues _______________________________________________________________________________________________________
self = <tests.test_github.TestGitHub testMethod=test_iter_repo_issues>
def test_iter_repo_issues(self):
self.response('issue', _iter=True)
self.get('https://api.github.com/repos/sigmavirus24/github3.py/'
'issues')
GLOB sdist-make: /home/bmorriso/localrepository/github3.py/setup.py
py26 recreate: /home/bmorriso/localrepository/github3.py/.tox/py26
py26 installdeps: requests>=1.2.0, git+git://github.com/garybernhardt/expecter.git, coverage>=3.5.2, mock>=1.0.0
py26 inst: /home/bmorriso/localrepository/github3.py/.tox/dist/github3.py-0.7.0.zip
py26 runtests: commands[0]
Traceback (most recent call last):
File "run_tests.py", line 40, in <module>
suite = collect_tests()
File "run_tests.py", line 30, in collect_tests
return unittest.defaultTestLoader.loadTestsFromNames(names)
ifconfig|awk {'print $2'}|sed -n 2p |cut -d: -f2
redis {
host => "127.0.0.1"
data_type => "list"
type => "redis"
key => "logstash"
message_format => "json_event"
threads => 3
}