Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
7154e1b
changed to toml
Sep 4, 2017
10b8fde
inserted changes from sera
Sep 4, 2017
61c6ad0
used toml with comments
Sep 7, 2017
27fe7aa
refactored code
Sep 10, 2017
34a28b9
updated changes
Sep 11, 2017
78ff0f9
started documentation
Sep 13, 2017
af87d2c
added example of code ran in terminal
Sep 13, 2017
6c73f8b
added tools
Sep 14, 2017
a323c90
changed requirements
Sep 14, 2017
ffbd8e9
function mispelling fixed
Sep 14, 2017
c533dbf
changed file path and refactored
Sep 18, 2017
7e71972
added documentation but to wrong branch
Sep 18, 2017
b210743
Merge branch 'push' into documentation
Sep 18, 2017
dd7d585
Fixed crlf issue (hopefully)
Sep 22, 2017
ea818c5
Merge branch 'master' into push
stefanv Sep 22, 2017
dfee42a
Clarify error message on missing token & fix invalid makeFile call.
stefanv Sep 22, 2017
c0f5d58
made some minor changes
Oct 5, 2017
f82ffad
testing
Oct 5, 2017
15300c1
second test
Oct 5, 2017
5268d5a
trying clone
Oct 5, 2017
2ad6540
trying clone 2
Oct 5, 2017
d3fe459
trying clone 3
Oct 5, 2017
31a4bcc
again
Oct 5, 2017
812d522
trying again
Oct 5, 2017
988b3c6
test file
Oct 5, 2017
2a1e2dd
new test
Oct 5, 2017
7521448
trying agian
Oct 5, 2017
87f8219
hello
Oct 5, 2017
a03ecea
changed to https
Oct 19, 2017
e305cfc
deleted build
Oct 19, 2017
d4ce7e0
fixed opening files format
Oct 19, 2017
cc8f2bc
deleted docs folder
Oct 19, 2017
354c60f
fixed tests since added to wrong branch
Oct 19, 2017
34b045c
minor
Oct 19, 2017
f26026c
local tests work
Oct 19, 2017
570cf2a
changed traivs
Oct 26, 2017
c38247f
style changes
Oct 27, 2017
0e8f2f2
deleted testing file
Oct 27, 2017
22a9d9e
changes
Nov 28, 2017
37e47bd
changed to sera's code
Nov 28, 2017
4732510
made template for no disccusion
Nov 28, 2017
abf7478
trying to deploy
Nov 28, 2017
13d07f9
added in key
Nov 28, 2017
1265f9f
docs
Nov 28, 2017
368f173
new docs
Nov 28, 2017
214c60e
added sphinx to rquirements
Nov 28, 2017
0fdc94d
trying to get right path
Nov 28, 2017
abfe5f8
Delete github_deploy_key_ttran428_oss_devkit.enc
ttran428 Nov 28, 2017
d5650b8
try again
Nov 28, 2017
4d74218
merged
Nov 28, 2017
8db6e51
Merge branch 'master' of github.com:ttran428/oss_devkit
Nov 28, 2017
2e4879a
again
Nov 28, 2017
d1b65cd
added environment
Nov 28, 2017
5a2b97d
new pages
Nov 29, 2017
b687d70
added travis file
Nov 29, 2017
d80c7b9
deleted build
Nov 29, 2017
373bbd4
deleted info in build
Nov 29, 2017
e7cb367
changed format and updated how to find hot prs
Jan 16, 2018
26b2e91
add templates
Jan 16, 2018
2374eb6
new info displayed but page not displaying
Jan 31, 2018
670ae29
debugged functions
Feb 1, 2018
5fb25b0
fixed bugs with priorityqueue
Feb 1, 2018
9dc9443
fixed oldest
Feb 6, 2018
acdb899
fixed structure
Feb 7, 2018
abf9469
added git hub render
Feb 7, 2018
ab83932
deleted other files
Feb 10, 2018
b212b8c
fixed README
Feb 10, 2018
418a162
formatting changes
Feb 18, 2018
f758564
fixed args
ttran428 Feb 22, 2018
9e9741d
fixed to flake8 format
Feb 22, 2018
b50da92
fixed format for push
ttran428 Feb 21, 2018
f8c8bd6
updated docs with image and render
ttran428 Mar 4, 2018
5ed7992
Merge branch 'master' of github.com:machine-shop/oss_devkit into docu…
ttran428 Mar 7, 2018
3b6856c
added newline at end of file
ttran428 Mar 7, 2018
943f18a
Merge branch 'documentation'
ttran428 Mar 7, 2018
79fd1f7
authentificated requests
ttran428 Mar 21, 2018
961e5d5
merged
ttran428 Mar 21, 2018
59628b6
cchanged formatting
ttran428 Mar 21, 2018
5799bb2
allowed push to take url
ttran428 Apr 4, 2018
84a63e9
finds info using github object
ttran428 Apr 5, 2018
5fcc3e9
allows to pull pr by url
ttran428 Apr 5, 2018
1becefe
fixed small bugs
ttran428 Apr 5, 2018
0fd5122
merged conflicts
ttran428 Apr 5, 2018
f1ddf19
style changes
ttran428 Apr 5, 2018
9172836
deleted travis key
ttran428 Apr 5, 2018
e71d65a
fixed minor error with url parsing for pr
ttran428 Apr 17, 2018
b254f66
Added comments to the command for clarity
ttran428 Apr 18, 2018
ab5ef22
changed to regex
ttran428 Jun 3, 2018
39c2f4f
took out print statements
ttran428 Jun 3, 2018
b814a5f
Merge branch 'master' into pr
ttran428 Jun 3, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/docs.zip
Binary file not shown.
33 changes: 10 additions & 23 deletions git-hub
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ import os
from datetime import datetime
from os.path import join as pjoin
import ansi
import re


def login():
"""Retrieves the user's remote.
For example consider running 'git remote -v' and getting back:
origin [email protected]:test_user/test_repo.git (fetch)
origin [email protected]:test_user/test_repo.git (push)

Returns
-------
username : string
Expand All @@ -28,7 +28,6 @@ def login():
origin repository of the github user, i.e. test_repo
remotes : string
Git remotes: the output of 'git remote -v'

"""
process = subprocess.Popen(["git", "remote", "-v"], stdout=subprocess.PIPE)
remotes = str(process.stdout.read())
Expand All @@ -42,7 +41,6 @@ def login():

def get_token():
"""Retrieve token from configuration file.

Returns
-------
token : string
Expand All @@ -61,26 +59,20 @@ def get_token():
else:
print(textwrap.dedent("""\
No authentication token specified in: ~/.config/git-hub.yaml

Please see

https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/

for instruction on obtaining a token. Then update the configuration
file as follows:

token = abc123
"""))
sys.exit(1)

def pr(num):
"""Pulls down and checkout the branch of the pr.

This will run the following commands in the terminal:
"git remote add user [email protected]:user/repo",
"git fetch user",
"git checkout -b pr/num user/branch"

Parameters
----------
num : integer
Expand Down Expand Up @@ -121,10 +113,8 @@ def pr(num):

def push():
"""Pushes changes back to a branch.

This will run the following command:
"git push user pr/num:branch"

"""
p = subprocess.Popen(["git", "branch"], stdout=subprocess.PIPE)
pr = str(p.stdout.read())
Expand Down Expand Up @@ -169,7 +159,6 @@ def path_to_toml():

def find_in_dictionary(pr_id, pr_data):
"""Fetches all the information on a certain PR

Parameters
----------
pr_id : integer
Expand All @@ -186,7 +175,6 @@ def find_in_dictionary(pr_id, pr_data):

def get_info(pr_data):
"""Fetches all the information on a certain PR

Parameters
----------
pr_data : integer
Expand Down Expand Up @@ -236,7 +224,6 @@ def get_info(pr_data):
def parse_time(time):
"""
Converts time into python datetime object

Parameters
----------
time : String
Expand All @@ -258,7 +245,6 @@ def parse_time(time):
def print_in_order(dict, increasing=False):
"""
Prints items in q sorted by order given by sort

Parameters
----------
Q : PriorityQueue
Expand All @@ -280,7 +266,6 @@ def find_match(open_or_closed, list_of_dictionaries,
keyword, user, comment, number, branch, label):
"""Helper function that finds all matches in the
given dictionary that fits the specified parameters.

Parameters
----------
open_or_closed : boolean
Expand All @@ -297,7 +282,6 @@ def find_match(open_or_closed, list_of_dictionaries,
Search by PR number
branch : string
Search by PR branch

Returns
----------
appeared_before : boolean
Expand Down Expand Up @@ -351,9 +335,7 @@ def find_match(open_or_closed, list_of_dictionaries,
def search(keyword, user, comment, number,
branch, opened_or_closed, label, sort):
"""Searches open and closed pull request comments for specified keyword.

Opens pull-requests.toml file in .git folder to fetch pull requests.

Parameters
----------
keyword : string
Expand Down Expand Up @@ -399,7 +381,6 @@ def search(keyword, user, comment, number,
def find_pr_info(pr, repo, token, open_or_closed):
"""Helper function that finds all the information we want to record from the
pull requests from the API and converts it to toml format syntax

Parameters
----------
pr : object
Expand Down Expand Up @@ -469,7 +450,6 @@ def find_issue_info(issue, token):
"""Helper function that finds all the information
we want to record from the issues
from the API and converts it to toml format syntax.

Parameters
----------
issue : object
Expand Down Expand Up @@ -543,7 +523,8 @@ def render():
try:
plot_pr.execute()
except ImportError:
print("Matplotlib not installed, cannot render image. Continuing without image.")
print("Matplotlib not installed, cannot render image.")
print("Continuing without image.")
app.main()


Expand Down Expand Up @@ -574,7 +555,13 @@ def cli():
@click.option('--label', '-l', default="", help="search PR by label")
def hub(command, args, user, comment, number, branch, sort, open, label):
if command == "pr":
pr_num = int(args[0])
# if user inputs the pull request number
if args[0].isdigit():
pr_num = int(args[0])
# if user inputs the url of the pull request
else:
mo = re.search(r'https://github.com/(?P<org_name>.*)/(?P<repo>.*)/pull/(?P<pr_num>\d*)(/*)', args[0])
pr_num = int((mo.group('pr_num')))
pr(pr_num)

elif command == "push":
Expand Down
5 changes: 1 addition & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,4 @@ pyyaml
click
toml
requests
<<<<<<< HEAD
jinja2
=======
>>>>>>> 3231212d9922ba239f446f1aaa9503a4a6bc0831
jinja2