Created
April 3, 2017 11:05
-
-
Save mwmajew/4e0a18a7f6c155f4761654bc92597bc6 to your computer and use it in GitHub Desktop.
oceniarka
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os,sys | |
import optparse | |
import subprocess | |
from git import Repo | |
import pandas as pd | |
import shutil | |
df_list = pd.read_csv('../Docs/Pite2017_Summer - Informacje.tsv',sep='\t') | |
groups = df_list['Grupa'].unique() | |
def print_groups(): | |
print "" | |
print "Groups to choose:" | |
print "="*20 | |
for i, group in enumerate(groups): | |
print i+1, group | |
def del_and_create(dir): | |
shutil.rmtree(dir) | |
os.makedirs(dir) | |
def print_group_list(group): | |
group = int(group) | |
group_name = groups[group-1] | |
print df_list[df_list['Grupa']==group_name][['Nazwisko','Github user']] | |
repo_name = '2017sum_wiet_kol1' | |
if __name__=="__main__": | |
parser = optparse.OptionParser() | |
directory = 'repo' | |
(options, args) = parser.parse_args() | |
if len(args) < 1: | |
del_and_create(directory) | |
print_groups() | |
group = raw_input() | |
print_group_list(group) | |
user_number = int(raw_input()) | |
username = df_list['Github user'][user_number] | |
print username | |
Repo.clone_from("https://github.com/{}/{}".format(username,repo_name),"repo") | |
elif args[0]=="delete": | |
del_and_create(directory) | |
elif "http://github.com/" in args[0]: | |
subprocess.Popen("git clone "+args[0]) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment