├── .gitignore ├── .gitsomeconfig ├── .gitsomeconfigurl ├── .travis.yml ├── CHANGELOG.md ├── CHANGELOG.rst ├── CHECKLIST.md ├── COMMANDS.md ├── CONTRIBUTING.md ├── Dockerfile ├── LICENSE.txt ├── PRIVACY.md ├── README.md ├── TOS.md ├── appveyor.yml ├── codecov.yml ├── gitsome ├── __init__.py ├── compat.py ├── completer.py ├── completions.py ├── completions_git.py ├── config.py ├── formatter.py ├── github.py ├── githubcli.py ├── lib │ ├── __init__.py │ ├── debug_timer.py │ ├── github3 │ │ ├── __about__.py │ │ ├── __init__.py │ │ ├── api.py │ │ ├── auths.py │ │ ├── decorators.py │ │ ├── events.py │ │ ├── exceptions.py │ │ ├── gists │ │ │ ├── __init__.py │ │ │ ├── comment.py │ │ │ ├── file.py │ │ │ ├── gist.py │ │ │ └── history.py │ │ ├── git.py │ │ ├── github.py │ │ ├── issues │ │ │ ├── __init__.py │ │ │ ├── comment.py │ │ │ ├── event.py │ │ │ ├── issue.py │ │ │ ├── label.py │ │ │ └── milestone.py │ │ ├── licenses.py │ │ ├── models.py │ │ ├── notifications.py │ │ ├── null.py │ │ ├── orgs.py │ │ ├── pulls.py │ │ ├── repos │ │ │ ├── __init__.py │ │ │ ├── branch.py │ │ │ ├── comment.py │ │ │ ├── commit.py │ │ │ ├── comparison.py │ │ │ ├── contents.py │ │ │ ├── deployment.py │ │ │ ├── hook.py │ │ │ ├── issue_import.py │ │ │ ├── pages.py │ │ │ ├── release.py │ │ │ ├── repo.py │ │ │ ├── stats.py │ │ │ ├── status.py │ │ │ └── tag.py │ │ ├── search │ │ │ ├── __init__.py │ │ │ ├── code.py │ │ │ ├── issue.py │ │ │ ├── repository.py │ │ │ └── user.py │ │ ├── session.py │ │ ├── structs.py │ │ ├── users.py │ │ └── utils.py │ ├── html2text │ │ ├── __init__.py │ │ └── html2text.py │ ├── img2txt │ │ ├── __init__.py │ │ └── img2txt.py │ └── pretty_date_time.py ├── main.py ├── main_cli.py ├── rss_feed.py ├── table.py ├── utils.py ├── view_entry.py └── web_viewer.py ├── images └── logo.png ├── requirements-dev.txt ├── scripts ├── aws_complete.sh ├── create_changelog.sh ├── create_readme_rst.sh ├── gh_complete.sh ├── gitsome ├── gitsome.bat ├── run_code_checks.sh ├── set_changelog_as_readme.sh ├── set_changelog_as_readme_undo.sh ├── update_docs.sh ├── upload_pypi.sh ├── xonsh └── xonsh.bat ├── setup.py ├── tests ├── __init__.py ├── compat.py ├── data │ ├── __init__.py │ ├── email.py │ ├── emoji.py │ ├── events.py │ ├── gitignores.py │ ├── issue.py │ ├── license.py │ ├── markdown.py │ ├── thread.py │ ├── trends.p │ ├── trends.py │ ├── user.py │ ├── user_feed.p │ ├── user_feed.py │ └── user_public_feed.p ├── mock_feed_parser.py ├── mock_github_api.py ├── mock_pretty_date_time.py ├── run_tests.py ├── test_completer.py ├── test_config.py ├── test_github.py ├── test_github_cli.py └── test_web_viewer.py ├── tox.ini └── xonsh ├── __init__.py ├── __main__.py ├── aliases.py ├── ansi_colors.py ├── ast.py ├── base_shell.py ├── built_ins.py ├── codecache.py ├── color_tools.py ├── commands_cache.py ├── completer.py ├── completers ├── __init__.py ├── _aliases.py ├── base.py ├── bash.py ├── bash_completion.py ├── commands.py ├── completer.py ├── dirs.py ├── init.py ├── man.py ├── path.py ├── pip.py ├── python.py ├── tools.py └── xompletions.py ├── contexts.py ├── data └── data.txt ├── diff_history.py ├── dirstack.py ├── dumb_shell.py ├── environ.py ├── events.py ├── execer.py ├── foreign_shells.py ├── fs.py ├── history ├── __init__.py ├── base.py ├── dummy.py ├── json.py ├── main.py └── sqlite.py ├── imphooks.py ├── inspectors.py ├── jobs.py ├── jsonutils.py ├── jupyter_kernel.py ├── jupyter_shell.py ├── lazyasd.py ├── lazyimps.py ├── lazyjson.py ├── lexer.py ├── macutils.py ├── main.py ├── openpy.py ├── parser.py ├── parsers ├── __init__.py ├── base.py ├── context_check.py ├── v34.py ├── v35.py └── v36.py ├── platform.py ├── ply ├── .gitignore ├── .travis.yml ├── CHANGES ├── CONTRIBUTING.md ├── Makefile ├── README.md ├── __init__.py ├── doc │ ├── internal.html │ ├── makedoc.py │ └── ply.html ├── example │ ├── BASIC │ │ ├── README │ │ ├── basic.py │ │ ├── basiclex.py │ │ ├── basiclog.py │ │ ├── basinterp.py │ │ ├── basparse.py │ │ ├── dim.bas │ │ ├── func.bas │ │ ├── gcd.bas │ │ ├── gosub.bas │ │ ├── hello.bas │ │ ├── linear.bas │ │ ├── maxsin.bas │ │ ├── powers.bas │ │ ├── rand.bas │ │ ├── sales.bas │ │ ├── sears.bas │ │ ├── sqrt1.bas │ │ └── sqrt2.bas │ ├── GardenSnake │ │ ├── GardenSnake.py │ │ └── README │ ├── README │ ├── ansic │ │ ├── README │ │ ├── clex.py │ │ └── cparse.py │ ├── calc │ │ └── calc.py │ ├── calcdebug │ │ └── calc.py │ ├── calceof │ │ └── calc.py │ ├── classcalc │ │ └── calc.py │ ├── cleanup.sh │ ├── closurecalc │ │ └── calc.py │ ├── hedit │ │ └── hedit.py │ ├── newclasscalc │ │ └── calc.py │ ├── optcalc │ │ ├── README │ │ └── calc.py │ ├── unicalc │ │ └── calc.py │ └── yply │ │ ├── README │ │ ├── ylex.py │ │ ├── yparse.py │ │ └── yply.py ├── ply │ ├── __init__.py │ ├── cpp.py │ ├── ctokens.py │ ├── lex.py │ ├── yacc.py │ └── ygen.py ├── setup.md └── test │ ├── README │ ├── calclex.py │ ├── cleanup.sh │ ├── lex_closure.py │ ├── lex_doc1.py │ ├── lex_dup1.py │ ├── lex_dup2.py │ ├── lex_dup3.py │ ├── lex_empty.py │ ├── lex_error1.py │ ├── lex_error2.py │ ├── lex_error3.py │ ├── lex_error4.py │ ├── lex_hedit.py │ ├── lex_ignore.py │ ├── lex_ignore2.py │ ├── lex_literal1.py │ ├── lex_literal2.py │ ├── lex_literal3.py │ ├── lex_many_tokens.py │ ├── lex_module.py │ ├── lex_module_import.py │ ├── lex_object.py │ ├── lex_opt_alias.py │ ├── lex_optimize.py │ ├── lex_optimize2.py │ ├── lex_optimize3.py │ ├── lex_optimize4.py │ ├── lex_re1.py │ ├── lex_re2.py │ ├── lex_re3.py │ ├── lex_rule1.py │ ├── lex_rule2.py │ ├── lex_rule3.py │ ├── lex_state1.py │ ├── lex_state2.py │ ├── lex_state3.py │ ├── lex_state4.py │ ├── lex_state5.py │ ├── lex_state_noerror.py │ ├── lex_state_norule.py │ ├── lex_state_try.py │ ├── lex_token1.py │ ├── lex_token2.py │ ├── lex_token3.py │ ├── lex_token4.py │ ├── lex_token5.py │ ├── lex_token_dup.py │ ├── pkg_test1 │ ├── __init__.py │ └── parsing │ │ ├── __init__.py │ │ ├── calclex.py │ │ └── calcparse.py │ ├── pkg_test2 │ ├── __init__.py │ └── parsing │ │ ├── __init__.py │ │ ├── calclex.py │ │ └── calcparse.py │ ├── pkg_test3 │ ├── __init__.py │ ├── generated │ │ └── __init__.py │ └── parsing │ │ ├── __init__.py │ │ ├── calclex.py │ │ └── calcparse.py │ ├── pkg_test4 │ ├── __init__.py │ └── parsing │ │ ├── __init__.py │ │ ├── calclex.py │ │ └── calcparse.py │ ├── pkg_test5 │ ├── __init__.py │ └── parsing │ │ ├── __init__.py │ │ ├── calclex.py │ │ └── calcparse.py │ ├── pkg_test6 │ ├── __init__.py │ └── parsing │ │ ├── __init__.py │ │ ├── calclex.py │ │ ├── calcparse.py │ │ ├── expression.py │ │ └── statement.py │ ├── test_cpp_nonascii.c │ ├── testcpp.py │ ├── testlex.py │ ├── testyacc.py │ ├── yacc_badargs.py │ ├── yacc_badid.py │ ├── yacc_badprec.py │ ├── yacc_badprec2.py │ ├── yacc_badprec3.py │ ├── yacc_badrule.py │ ├── yacc_badtok.py │ ├── yacc_dup.py │ ├── yacc_error1.py │ ├── yacc_error2.py │ ├── yacc_error3.py │ ├── yacc_error4.py │ ├── yacc_error5.py │ ├── yacc_error6.py │ ├── yacc_error7.py │ ├── yacc_inf.py │ ├── yacc_literal.py │ ├── yacc_misplaced.py │ ├── yacc_missing1.py │ ├── yacc_nested.py │ ├── yacc_nodoc.py │ ├── yacc_noerror.py │ ├── yacc_nop.py │ ├── yacc_notfunc.py │ ├── yacc_notok.py │ ├── yacc_prec1.py │ ├── yacc_rr.py │ ├── yacc_rr_unused.py │ ├── yacc_simple.py │ ├── yacc_sr.py │ ├── yacc_term1.py │ ├── yacc_unicode_literals.py │ ├── yacc_unused.py │ ├── yacc_unused_rule.py │ ├── yacc_uprec.py │ └── yacc_uprec2.py ├── pretty.py ├── proc.py ├── prompt ├── __init__.py ├── base.py ├── cwd.py ├── env.py ├── gitstatus.py ├── job.py └── vc.py ├── ptk ├── __init__.py ├── completer.py ├── history.py ├── key_bindings.py ├── shell.py └── shortcuts.py ├── ptk2 ├── __init__.py ├── completer.py ├── history.py ├── key_bindings.py └── shell.py ├── pyghooks.py ├── pygments_cache.py ├── pytest_plugin.py ├── readline_shell.py ├── replay.py ├── shell.py ├── style_tools.py ├── timings.py ├── tokenize.py ├── tools.py ├── tracer.py ├── winutils.py ├── wizard.py ├── xonfig.py ├── xonshrc ├── xontribs.json ├── xontribs.py └── xoreutils ├── __init__.py ├── _which.py ├── cat.py ├── echo.py ├── pwd.py ├── tee.py ├── tty.py ├── uptime.py ├── util.py ├── which.py └── yes.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | 27 | # PyInstaller 28 | # Usually these files are written by a python script from a template 29 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 30 | *.manifest 31 | *.spec 32 | 33 | # Installer logs 34 | pip-log.txt 35 | pip-delete-this-directory.txt 36 | 37 | # Unit test / coverage reports 38 | htmlcov/ 39 | .tox/ 40 | .coverage 41 | .coverage.* 42 | .cache 43 | nosetests.xml 44 | coverage.xml 45 | *,cover 46 | .hypothesis/ 47 | 48 | # Translations 49 | *.mo 50 | *.pot 51 | 52 | # Django stuff: 53 | *.log 54 | 55 | # Sphinx documentation 56 | docs/_build/ 57 | 58 | # PyBuilder 59 | target/ 60 | 61 | #Ipython Notebook 62 | .ipynb_checkpoints 63 | 64 | # temporary files from vim and emacs 65 | *~ 66 | *# 67 | .#* 68 | *.swp 69 | *.swo 70 | 71 | # Virtualenv 72 | pip-selfcheck.json 73 | bin/ 74 | include/ 75 | 76 | # Mac 77 | .DS_Store 78 | 79 | * Misc 80 | scratch/ 81 | *.egg-info/ 82 | 83 | *.pyc 84 | *.out 85 | *.xcf 86 | 87 | recipe/ 88 | .binstar.yml 89 | binstar.yml 90 | .landscape.yaml 91 | .cache/ 92 | build/ 93 | dist/ 94 | gitsome.egg-info/ 95 | docs/_build/ 96 | .tox/ 97 | 98 | lexer_table.py 99 | parser_table.py 100 | parser_test_table.py 101 | gitsome/lexer_table.py 102 | gitsome/parser_table.py 103 | tests/lexer_table.py 104 | tests/parser_table.py 105 | tests/lexer_test_table.py 106 | tests/parser_test_table.py 107 | -------------------------------------------------------------------------------- /.gitsomeconfig: -------------------------------------------------------------------------------- 1 | [github] 2 | user_login = None 3 | enable_avatar = True 4 | verify_ssl = True 5 | clr_primary = None 6 | clr_secondary = green 7 | clr_tertiary = cyan 8 | clr_quaternary = yellow 9 | clr_bold = cyan 10 | clr_code = red 11 | clr_error = red 12 | clr_header = yellow 13 | clr_link = green 14 | clr_list = cyan 15 | clr_message = None 16 | clr_num_comments = green 17 | clr_num_points = green 18 | clr_tag = cyan 19 | clr_time = yellow 20 | clr_title = None 21 | clr_tooltip = None 22 | clr_user = cyan 23 | clr_view_link = magenta 24 | clr_view_index = magenta 25 | 26 | -------------------------------------------------------------------------------- /.gitsomeconfigurl: -------------------------------------------------------------------------------- 1 | [url] 2 | url_list = ['https://github.com/octocat/spoon-knife'] 3 | 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | matrix: 3 | include: 4 | - python: 3.5 5 | env: TOXENV=py35 6 | - python: 3.6 7 | env: TOXENV=py36 8 | - python: 3.7 9 | dist: xenial # required for Python >= 3.7 10 | env: TOXENV=py37 11 | install: 12 | - travis_retry pip install codecov tox 13 | script: 14 | - tox 15 | after_success: 16 | - codecov 17 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | ########################################################## 2 | # # 3 | # Build the image: # 4 | # docker build -t gitsome . # 5 | # # 6 | # Run the container: # 7 | # docker run -ti --rm -v $(pwd):/src/ \ # 8 | # -v ${HOME}/.gitsomeconfig:/root/.gitsomeconfig \ # 9 | # -v ${HOME}/.gitconfig:/root/.gitconfig \ # 10 | # gitsome # 11 | # # 12 | ########################################################## 13 | FROM python:3.5 14 | 15 | RUN pip install Pillow 16 | 17 | COPY /requirements-dev.txt /gitsome/ 18 | WORKDIR /gitsome/ 19 | RUN pip install -r requirements-dev.txt 20 | 21 | COPY / /gitsome/ 22 | RUN pip install -e . 23 | 24 | RUN mkdir /src/ 25 | WORKDIR /src/ 26 | ENTRYPOINT ["gitsome"] 27 | -------------------------------------------------------------------------------- /PRIVACY.md: -------------------------------------------------------------------------------- 1 | # Privacy Policy 2 | 3 | ## What information do we collect? 4 | 5 | To properly integrate with GitHub, `gitsome` must authenticate with GitHub and/or GitHub Enterprise. 6 | 7 | When using `gitsome`, you may be asked to enter your: user name, password, two factor authentication token, user access token, news feed url, or GitHub Enterprise url. See the [configure](https://github.com/donnemartin/gitsome/blob/master/COMMANDS.md#gh-configure) section for more details. 8 | 9 | You may, however, use features of `gitsome` that do not require GitHub authentication anonymously. 10 | 11 | ## What do we use your information for? 12 | 13 | Any of the information we collect from you is used solely to interact with GitHub and/or GitHub Enterprise. Other than to provide integration with GitHub, we do not disclose or transfer your information to outside parties. 14 | 15 | ## How do we protect your information? 16 | 17 | All supplied sensitive information is encrypted during transmission to GitHub via Secure Socket Layer (SSL) technology. 18 | 19 | ## Terms and Conditions 20 | 21 | Please also visit our Terms and Conditions section establishing the use, disclaimers, and limitations of liability governing the use of `gitsome`. 22 | 23 | ## Your Consent 24 | 25 | By using `gitsome`, you consent to our privacy policy. 26 | 27 | ## Changes to our Privacy Policy 28 | 29 | If we decide to change our privacy policy, we will post those changes on this page. 30 | 31 | ## Contacting Us 32 | 33 | Any questions about this document should be addressed to [Donne Martin](donne.martin@gmail.com). 34 | -------------------------------------------------------------------------------- /TOS.md: -------------------------------------------------------------------------------- 1 | # Terms of Service 2 | 3 | By using `gitsome`, you are agreeing to be bound by the following terms and conditions ("Terms of Service"). If you are entering into this agreement on behalf of a company or other legal entity, you represent that you have the authority to bind such entity, its affiliates and all users who access `gitsome` through your account to these terms and conditions, in which case the terms "you" or "your" shall refer to such entity, its affiliates and users associated with it. If you do not have such authority, or if you do not agree with these terms and conditions, you must not accept this agreement and may not use `gitsome`. 4 | 5 | `gitsome` is maintained by [Donne Martin](donne.martin@gmail.com). 6 | 7 | Donne Martin reserves the right to update and change the Terms of Service from time to time without notice. Any new features that augment or enhance `gitsome`, including the release of new tools and resources, shall be subject to the Terms of Service. Continued use of `gitsome` after any such changes shall constitute your consent to such changes. 8 | 9 | ## Account Terms 10 | 11 | * You are responsible for maintaining the security of your GitHub account. 12 | * You are responsible for all activity that occurs by using `gitsome`. 13 | * You may not use the `gitsome` for any illegal or unauthorized purpose. 14 | * You must not, in the use of `gitsome`, violate any laws in your jurisdiction. 15 | * Your use of `gitsome` is at your sole risk. 16 | 17 | ## Copyright 18 | 19 | `gitsome` is copyright ©2016 Donne Martin. 20 | 21 | ## Questions 22 | 23 | Any questions about this document should be addressed to [Donne Martin](donne.martin@gmail.com). 24 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | # What Python version is installed where: 2 | # http://www.appveyor.com/docs/installed-software#python 3 | 4 | environment: 5 | matrix: 6 | - PYTHON: "C:\\Python27" 7 | TOX_ENV: "py27" 8 | 9 | - PYTHON: "C:\\Python33" 10 | TOX_ENV: "py33" 11 | 12 | - PYTHON: "C:\\Python34" 13 | TOX_ENV: "py34" 14 | 15 | - PYTHON: "C:\\Python35" 16 | TOX_ENV: "py35" 17 | 18 | 19 | init: 20 | - "%PYTHON%/python -V" 21 | - "%PYTHON%/python -c \"import struct;print( 8 * struct.calcsize(\'P\'))\"" 22 | 23 | install: 24 | - "%PYTHON%/Scripts/easy_install -U pip" 25 | - "%PYTHON%/Scripts/pip install tox" 26 | - "%PYTHON%/Scripts/pip install wheel" 27 | 28 | build: false # Not a C# project, build stuff at the test step instead. 29 | 30 | test_script: 31 | - "%PYTHON%/Scripts/tox -e %TOX_ENV%" 32 | 33 | after_test: 34 | - "%PYTHON%/python setup.py bdist_wheel" 35 | - ps: "ls dist" 36 | 37 | artifacts: 38 | - path: dist\* 39 | 40 | #on_success: 41 | # - TODO: upload the content of dist/*.whl to a public wheelhouse -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | comment: 2 | layout: header, changes, diff 3 | 4 | coverage: 5 | ignore: 6 | - gitsome/lib/* 7 | - gitsome/compat.py 8 | -------------------------------------------------------------------------------- /gitsome/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Copyright 2015 Donne Martin. All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"). You 6 | # may not use this file except in compliance with the License. A copy of 7 | # the License is located at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # or in the "license" file accompanying this file. This file is 12 | # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 13 | # ANY KIND, either express or implied. See the License for the specific 14 | # language governing permissions and limitations under the License. 15 | 16 | __version__ = '0.8.4' 17 | -------------------------------------------------------------------------------- /gitsome/compat.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Copyright 2015 Donne Martin. All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"). You 6 | # may not use this file except in compliance with the License. A copy of 7 | # the License is located at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # or in the "license" file accompanying this file. This file is 12 | # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 13 | # ANY KIND, either express or implied. See the License for the specific 14 | # language governing permissions and limitations under the License. 15 | 16 | import sys 17 | import urllib 18 | try: 19 | # Python 3 20 | import configparser 21 | from urllib.parse import urlparse 22 | from urllib.request import urlretrieve 23 | from urllib.error import URLError 24 | except ImportError: 25 | # Python 2 26 | import ConfigParser as configparser 27 | from urlparse import urlparse 28 | from urllib import urlretrieve 29 | from urllib2 import URLError 30 | if sys.version_info < (3, 3): 31 | import HTMLParser 32 | else: 33 | import html as HTMLParser 34 | -------------------------------------------------------------------------------- /gitsome/lib/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Copyright 2015 Donne Martin. All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"). You 6 | # may not use this file except in compliance with the License. A copy of 7 | # the License is located at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # or in the "license" file accompanying this file. This file is 12 | # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 13 | # ANY KIND, either express or implied. See the License for the specific 14 | # language governing permissions and limitations under the License. 15 | -------------------------------------------------------------------------------- /gitsome/lib/debug_timer.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Copyright 2015 Donne Martin. All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"). You 6 | # may not use this file except in compliance with the License. A copy of 7 | # the License is located at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # or in the "license" file accompanying this file. This file is 12 | # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 13 | # ANY KIND, either express or implied. See the License for the specific 14 | # language governing permissions and limitations under the License. 15 | 16 | from __future__ import print_function 17 | from __future__ import division 18 | 19 | import click 20 | import time 21 | 22 | 23 | def timeit(method): 24 | """From: https://www.andreas-jung.com/contents/a-python-decorator-for-measuring-the-execution-time-of-methods # NOQA 25 | """ 26 | def timed(*args, **kw): 27 | ts = time.time() 28 | result = method(*args, **kw) 29 | te = time.time() 30 | message = '%r (%r, %r) %2.2f sec' % (method.__name__, args, kw, te-ts) 31 | click.secho(message + '\n', fg='red') 32 | return result 33 | return timed 34 | -------------------------------------------------------------------------------- /gitsome/lib/github3/__about__.py: -------------------------------------------------------------------------------- 1 | """The module that holds much of the metadata about github3.py.""" 2 | __package_name__ = 'github3.py' 3 | __title__ = 'github3' 4 | __author__ = 'Ian Cordasco' 5 | __author_email__ = 'graffatcolmingov@gmail.com' 6 | __license__ = 'Modified BSD' 7 | __copyright__ = 'Copyright 2012-2016 Ian Cordasco' 8 | __version__ = '1.0.0a4' 9 | __version_info__ = tuple(int(i) for i in __version__.split('.') if i.isdigit()) 10 | __url__ = 'http://github3.readthedocs.org' 11 | 12 | __all__ = ( 13 | '__package_name__', '__title__', '__author__', '__author_email__', 14 | '__license__', '__copyright__', '__version__', '__version_info__', 15 | '__url__', 16 | ) 17 | -------------------------------------------------------------------------------- /gitsome/lib/github3/gists/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | github3.gists 3 | ============= 4 | 5 | Module which contains all the gist related material. 6 | 7 | Sub-modules: 8 | github3.gists.gist 9 | github3.gists.file 10 | github3.gists.comment 11 | github3.gists.history 12 | 13 | See also: http://developer.github.com/v3/gists/ 14 | """ 15 | 16 | from .gist import Gist 17 | 18 | __all__ = [Gist] 19 | -------------------------------------------------------------------------------- /gitsome/lib/github3/gists/comment.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | github3.gists.comment 4 | --------------------- 5 | 6 | Module containing the logic for a GistComment 7 | 8 | """ 9 | from __future__ import unicode_literals 10 | 11 | from ..models import BaseComment 12 | from ..users import User 13 | 14 | 15 | class GistComment(BaseComment): 16 | 17 | """This object represents a comment on a gist. 18 | 19 | Two comment instances can be checked like so:: 20 | 21 | c1 == c2 22 | c1 != c2 23 | 24 | And is equivalent to:: 25 | 26 | c1.id == c2.id 27 | c1.id != c2.id 28 | 29 | See also: http://developer.github.com/v3/gists/comments/ 30 | 31 | """ 32 | 33 | def _update_attributes(self, comment): 34 | self._api = comment.get('url') 35 | #: :class:`User ` who made the comment 36 | #: Unless it is not associated with an account 37 | self.user = None 38 | if comment.get('user'): 39 | self.user = User(comment.get('user'), self) # (No coverage) 40 | 41 | def _repr(self): 42 | return ''.format(self.user.login) 43 | -------------------------------------------------------------------------------- /gitsome/lib/github3/gists/file.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | github3.gists.file 4 | ------------------ 5 | 6 | Module containing the logic for the GistFile object. 7 | """ 8 | from __future__ import unicode_literals 9 | 10 | from ..models import GitHubCore 11 | 12 | 13 | class GistFile(GitHubCore): 14 | 15 | """This represents the file object returned by interacting with gists. 16 | 17 | It stores the raw url of the file, the file name, language, size and 18 | content. 19 | 20 | """ 21 | 22 | def _update_attributes(self, attributes): 23 | #: The raw URL for the file at GitHub. 24 | self.raw_url = attributes.get('raw_url') 25 | #: The name of the file. 26 | self.filename = attributes.get('filename') 27 | #: The name of the file. 28 | self.name = attributes.get('filename') 29 | #: The language associated with the file. 30 | self.language = attributes.get('language') 31 | #: The size of the file. 32 | self.size = attributes.get('size') 33 | #: The content of the file. 34 | self.original_content = attributes.get('content') 35 | 36 | def _repr(self): 37 | return ''.format(self.name) 38 | 39 | def content(self): 40 | """Retrieve contents of file from key 'raw_url' if there is no 41 | 'content' key in Gist object. 42 | """ 43 | resp = self._get(self.raw_url) 44 | if self._boolean(resp, 200, 404): 45 | return resp.content 46 | return None 47 | -------------------------------------------------------------------------------- /gitsome/lib/github3/issues/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | github3.issues 3 | ============== 4 | 5 | This module contains the classes related to issues. 6 | 7 | See also: http://developer.github.com/v3/issues/ 8 | """ 9 | 10 | from ..utils import timestamp_parameter 11 | from .issue import Issue 12 | 13 | __all__ = [Issue] 14 | 15 | 16 | def issue_params(filter, state, labels, sort, direction, since): 17 | params = {} 18 | if filter in ('assigned', 'created', 'mentioned', 'subscribed', 'all'): 19 | params['filter'] = filter 20 | 21 | if state in ('open', 'closed', 'all'): 22 | params['state'] = state 23 | 24 | if labels: 25 | params['labels'] = labels 26 | 27 | if sort in ('created', 'updated', 'comments'): 28 | params['sort'] = sort 29 | 30 | if direction in ('asc', 'desc'): 31 | params['direction'] = direction 32 | 33 | since = timestamp_parameter(since) 34 | if since: 35 | params['since'] = since 36 | 37 | return params 38 | -------------------------------------------------------------------------------- /gitsome/lib/github3/issues/comment.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | from ..utils import timestamp_parameter 5 | from ..models import BaseComment 6 | from ..users import User 7 | 8 | 9 | class IssueComment(BaseComment): 10 | """The :class:`IssueComment ` object. This structures and 11 | handles the comments on issues specifically. 12 | 13 | Two comment instances can be checked like so:: 14 | 15 | c1 == c2 16 | c1 != c2 17 | 18 | And is equivalent to:: 19 | 20 | c1.id == c2.id 21 | c1.id != c2.id 22 | 23 | See also: http://developer.github.com/v3/issues/comments/ 24 | """ 25 | def _update_attributes(self, comment): 26 | super(IssueComment, self)._update_attributes(comment) 27 | 28 | user = comment.get('user') 29 | #: :class:`User ` who made the comment 30 | self.user = User(user, self) if user else None 31 | 32 | #: Issue url (not a template) 33 | self.issue_url = comment.get('issue_url') 34 | 35 | #: Html url (not a template) 36 | self.html_url = comment.get('html_url') 37 | 38 | def _repr(self): 39 | return ''.format(self.user.login) 40 | 41 | 42 | def issue_comment_params(sort, direction, since): 43 | params = {} 44 | 45 | if sort in ('created', 'updated'): 46 | params['sort'] = sort 47 | 48 | if direction in ('asc', 'desc'): 49 | params['direction'] = direction 50 | 51 | since = timestamp_parameter(since) 52 | if since: 53 | params['since'] = since 54 | 55 | return params 56 | -------------------------------------------------------------------------------- /gitsome/lib/github3/issues/label.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | from json import dumps 5 | from ..decorators import requires_auth 6 | from ..models import GitHubCore 7 | 8 | 9 | class Label(GitHubCore): 10 | """The :class:`Label