Exemplo n.º 1
0
Arquivo: setup.py Projeto: ravsa/Vgit
def setup():
    data1=[]
    color.printf('whitebg','black','Email    :')
    data1.append(raw_input())
    color.printf('whitebg','black','Username :'******'git config --global user.email '+'"'+data1[0]+'"')
    os.system('git config --global user.name '+'"'+data1[1]+'"')
Exemplo n.º 2
0
Arquivo: setup.py Projeto: ravsa/Vgit
def setup():
    data1 = []
    color.printf('whitebg', 'black', 'Email    :')
    data1.append(raw_input())
    color.printf('whitebg', 'black', 'Username :'******'git config --global user.email ' + '"' + data1[0] + '"')
    os.system('git config --global user.name ' + '"' + data1[1] + '"')
Exemplo n.º 3
0
Arquivo: setup.py Projeto: ravsa/Vgit
    color.printf('whitebg','black','Email    :')
    data1.append(raw_input())
    color.printf('whitebg','black','Username :'******'git config --global user.email '+'"'+data1[0]+'"')
    os.system('git config --global user.name '+'"'+data1[1]+'"')
try:
    file=open(gitconfig,'r')
    file.readline()
    x=file.readline()
    x=list(x.split())
    y=file.readline()
    y=list(y.split())
    if x[2] is '' or y[2] is '':
        setup()
    file.close()
except Exception,e:
    setup()
try:
    file=open(creds,'r')
    file.close()
except Exception,e:
    file=open(creds,'wb')
    data2=[]
    color.printf('whitebg','black','Username :'******'whitebg','red','Password :'******''))
    pickle.dump(data2,file)
    file.close()
Exemplo n.º 4
0
Arquivo: init.py Projeto: ravsa/Vgit
import os, pickle, subprocess, color
color.printf('blue', "whitebg", "Initializing...! \n")
data = []
dir = subprocess.Popen('echo ~', shell=True, stdout=subprocess.PIPE)
home_dir = dir.stdout.read()[:-1]
creds = home_dir + '/' + '.creds'
dir = subprocess.Popen('pwd', shell=True, stdout=subprocess.PIPE)
cur_dir = dir.stdout.read()[:-1]
cur_dir = list(cur_dir.split('/'))[-1]
file = open(creds, 'r')
data = pickle.load(file)
file.close()
if not os.path.isdir('.git'):
    os.system('git init >/dev/null')
create_repo = 'curl ' + '-u ' + "'" + data[0] + "'" + ':' + "'" + data[
    1] + "'" + ' https://api.github.com/user/repos ' + '-d ' + '"' + '{' + '\\"name\\"' + ':' + '\\"' + cur_dir + '\\"' + '}' + '"'
os.system(create_repo + ' 2>/dev/null >/dev/null')
os.system('git remote add origin https://github.com/' + data[0] + '/' +
          cur_dir + '.git' + ' >/dev/null 2>/dev/null')
color.printf("whitebg", "green", "Initialized")
Exemplo n.º 5
0
import os
import color
color.printf('black', 'whitebg', "Commit: ")
txt = ''
while True:
    txt = txt + raw_input()
    if txt.find('\n'):
        break
os.system('git commit -m ' + '"' + str(txt) + '"')
Exemplo n.º 6
0
Arquivo: commit.py Projeto: ravsa/Vgit
import os
import color
color.printf ('black','whitebg',"Commit: ")
txt=''
while True:
    txt=txt+raw_input()
    if txt.find('\n'):
        break;
os.system('git commit -m '+'"'+str(txt)+'"')
Exemplo n.º 7
0
Arquivo: setup.py Projeto: ravsa/Vgit
    color.printf('whitebg', 'black', 'Username :'******'git config --global user.email ' + '"' + data1[0] + '"')
    os.system('git config --global user.name ' + '"' + data1[1] + '"')


try:
    file = open(gitconfig, 'r')
    file.readline()
    x = file.readline()
    x = list(x.split())
    y = file.readline()
    y = list(y.split())
    if x[2] is '' or y[2] is '':
        setup()
    file.close()
except Exception, e:
    setup()
try:
    file = open(creds, 'r')
    file.close()
except Exception, e:
    file = open(creds, 'wb')
    data2 = []
    color.printf('whitebg', 'black', 'Username :'******'whitebg', 'red', 'Password :'******''))
    pickle.dump(data2, file)
    file.close()
Exemplo n.º 8
0
Arquivo: init.py Projeto: ravsa/Vgit
import os,pickle,subprocess,color
color.printf ('blue',"whitebg","Initializing...! \n")
data=[]
dir=subprocess.Popen('echo ~',shell=True,stdout=subprocess.PIPE)
home_dir=dir.stdout.read()[:-1]
creds=home_dir+'/'+'.creds'
dir=subprocess.Popen('pwd',shell=True,stdout=subprocess.PIPE)
cur_dir=dir.stdout.read()[:-1]
cur_dir=list(cur_dir.split('/'))[-1]
file=open(creds,'r')
data=pickle.load(file)
file.close()
if not os.path.isdir('.git'):
    os.system('git init >/dev/null')
create_repo='curl '+'-u '+"'"+data[0]+"'"+':'+"'"+data[1]+"'"+' https://api.github.com/user/repos '+'-d '+'"'+'{'+'\\"name\\"'+':'+'\\"'+cur_dir+'\\"'+'}'+'"'
os.system(create_repo+' 2>/dev/null >/dev/null')
os.system('git remote add origin https://github.com/'+data[0]+'/'+cur_dir+'.git'+' >/dev/null 2>/dev/null')
color.printf ("whitebg","green","Initialized")