Giter Club home page Giter Club logo

github-classroom-utils's People

Contributors

danwallach avatar sbwong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

github-classroom-utils's Issues

github-clone-all: flag for how repos are cloned

Sometimes we want to just leave the token in the repo, so they're easier to work with and do subsequent pushes. Other times, we want clean repos without any tokens. This should be a command-line flag.

clone all script throws error

How to replicate*

git clone https://github.com/danwallach/github-classroom-utils/

Update github_token and organization name

python3.7 github_clone_all.py --prefix Ass3 --out Ass3

Github setup:
https://github.com/org/Ass3-Student1
https://github.com/org/Ass3-Student2 .....

error

Cached result for org is missing or outdated
Traceback (most recent call last):
File "github_clone_all.py", line 42, in
filtered_repo_list = query_matching_repos(github_organization, github_prefix, github_token)
File "/private/tmp/github-classroom-utils/github_scanner.py", line 212, in query_matching_repos
result = query_repos_cached(github_organization, github_token, verbose)
File "/private/tmp/github-classroom-utils/github_scanner.py", line 161, in query_repos_cached
github_token, verbose)
File "/private/tmp/github-classroom-utils/github_scanner.py", line 313, in parallel_get_github_endpoint_paged_list
link_header = page1_result.headers["Link"]
File "/usr/local/lib/python3.7/site-packages/requests/structures.py", line 52, in getitem
return self._store[key.lower()][1]
KeyError: 'link'

Fix
The pagination logic in github_scanner appears broken. If the org has only one page then the "link" key in the header is empty. I would push a fix but not sure which other scripts might deal with pagination.
Line 319-328
num_pages = 1 # Default page value
if ("Link" in page1_result.headers):
link_header = page1_result.headers["Link"]
p = re.compile('page=(\d+)>; rel="last"')
m = p.findall(link_header)
if len(m) != 1:
if verbose:
print("Malformed header, didn't have pagination!")
return page1_result.json()
num_pages = int(m[0])

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.