Skip to content
Snippets Groups Projects
Unverified Commit acec4527 authored by Dan Nicholson's avatar Dan Nicholson Committed by GitHub
Browse files

Merge pull request #8 from sgnn7/python3_endless_fix

Python3 endless fix
parents e375bbb2 bbf226c3
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,6 @@ gh_fetch
========
### Downloader and updater for your github repos.
- Did you ever needed to keep a backup of a large number of GitHub repos?
- Did you ever need to start using your dev machine quickly but had to clone repos one by one?
- Did you ever need to update (fetch) a ton of repositories from GitHub but you had to do it one by one?
......@@ -10,6 +9,8 @@ gh_fetch
**gh_fetch** is designed to fix all of these problems by automating the process to the maximum extent possible. This tool will go through your (or another account's) GitHub repos both public and private including repositories from organizations you are a member of and fetch the most recent changes for it, cloning the relevant repos if they are not already downloaded. Feature set will be expanding per my current needs but you are free to fork and issue a pull request.
**Note: This code works with both Python3 (default) and Python2 (when invoked with `python2` prefix)**
```
$ ./update_repos -h
usage: update_repos [-h] [--version] [-d DIRECTORY] [-t TOKEN_FILE] [-s] [-m]
......@@ -64,5 +65,7 @@ optional arguments:
- Lots of testing
## Contributors
- Srdjan Grubor ([@sgnn7](http://github.com/sgnn7))
- Dan Nicholson ([@dbnicholson](http://github.com/dbnicholson))
- Srdjan Grubor ([@sgnn7](https://github.com/sgnn7))
- Dan Nicholson ([@dbnicholson](https://github.com/dbnicholson))
- Will Thompson ([@wjt](https://github.com/wjt))
- Nimrod Adar ([@adarnimrod](https://github.com/adarnimrod))
......@@ -97,7 +97,7 @@ def read_api_uri(uri, config, page=1):
print("Trying URI {} with headers {}".format(uri, headers))
req = Request(uri, headers=headers)
return urlopen(req).read().decode()
return urlopen(req).read().decode('utf-8')
def get_json(uri, config, obj_type=AttributeDict, page=1):
return json.loads(read_api_uri(uri, config, page), object_hook=obj_type)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment