gitwcmpull

Dealing with git repos. Doing pulls to all repos.


In [39]:
import git
import os
import github
import getpass

In [10]:
from github import Github

In [11]:
opz = open('/home/wcmckee/gpas.txt', 'r')
gpasz = opz.read()

In [ ]:
gusr = raw_input('Enter username: ')
gpas = getpass.getpass('Enter Password: ')

In [18]:
g = Github(gusr, gpas)

In [25]:
#for grza in g.get_organization(

In [27]:
gilis = []

In [29]:
for grp in g.get_user().get_repos():
    gilis.append(grp.name)

In [35]:
#list of repos missing local - perform git pull
list(set(gilis) - set(lidirz))


Out[35]:
[u'fuzzy-octopus', u'coil', u'crouton', u'cv']

In [ ]:


In [2]:
#Test if folder is there and that the origin pull is on github.
#If it's not on github, skip.

#Two Lists. One is list of repos from github. Other is list of
#local folder repos.
#Compare items in each list. 
#lis1 is github
#lis2 is local
#if 'ipython' is on lis1 but not two, then it performs
#git clone on github repo
#

#If item is on local but not on github
#check organision
#skip the git pull.

In [23]:
lidirz = os.listdir('/media/removable/USB Drive/wcmckee-git')

In [37]:
#for lid in lidirz:
#    print lid

In [38]:
#for grp in g.get_user().get_repos():
#    print grp.name

In [ ]:


In [ ]:


In [6]:
lismed = os.listdir('/media/removable/USB Drive/wcmckee-git')

In [36]:
#List of repos missing from github
list(set(lidirz) - set(gilis))


Out[36]:
['ipython', 'comet_cms']

In [33]:
#Repos that are both on github and local.
list(set(gilis).intersection(set(lidirz)))


Out[33]:
['RasPiWrite',
 'wcmckee.github.io',
 'ggj14',
 'flask',
 '4chan-API',
 'BroBeurFishingDream',
 'SuburbNightmare',
 'pywp-post',
 'flask-ghpages-example',
 'TPB',
 'vagrantboxes-heroku',
 'broLove',
 'wcmckee-notebook',
 'wirepil',
 'dockerfiles',
 'SketchDaily-GestureDrawing',
 'SoundWall',
 'te-whare-o-te-ata',
 'SortPictures',
 'signinlca',
 'cobal.eportfolio',
 'intro_programming',
 'python-guide',
 'pyunderdog',
 'skins',
 'ouya-unity-plugin',
 'adypy',
 'pybackupz',
 'selfspy',
 'niketa',
 'lcacoffee',
 'Projects',
 'wcmckee',
 'bgj05-hungry',
 'BirdCage',
 'iamagamer',
 'redtube',
 'imgur-python',
 'paintingautopy',
 'brobeur-web',
 'molyjam2013',
 'prodo-game',
 'reddit_bot',
 'DeltaBot',
 'marshmallow',
 'ipython-hydra',
 'compohub',
 'pyladies',
 'python-patterns',
 'hackage-server',
 'pithos',
 'bbc2wp',
 'vIPer',
 'Triger',
 'RedditPress',
 'tweepy',
 'pytm',
 'anim_framework',
 'openbay',
 'HTML5-Tiny',
 'artcontrol-api',
 'miniprojects',
 'art-lastfm',
 'raspi',
 'UnityLuaIntegration',
 'ipython-docker',
 'intercity',
 'puphpet',
 'DailyProgBot',
 'pymel',
 'brobeur-static',
 'nikola',
 'clint',
 'bacongamejam05',
 'wcmckee.com',
 'wcmStringPY',
 'RPIO',
 'html5lib-python',
 'render-useful',
 'autopaintpy123',
 'python-pandora',
 'LD48-Skins',
 'hamiltoncomputerclub.org.nz',
 'battlenet',
 'haskell-learn',
 'Minecraft',
 'openfaux-server',
 'AsylumJamCrushGame',
 'xboxdrv',
 'massive-wright',
 'ihaskell-notebook',
 'opencompetencies',
 'pyatakl']

In [7]:
#os.chdir('/media/removable/USB Drive/wcmckee-git/' + lism)

In [9]:
#os.system('git pull')

In [ ]:
for lism in lismed:
    print lism
    os.chdir('/media/removable/USB Drive/wcmckee-git/' + lism)
    os.system('git pull')


autopaintpy123
bacongamejam05
battlenet
bbc2wp
bgj05-hungry
BirdCage
brobeur-static
brobeur-web
BroBeurFishingDream
broLove
clint
cobal.eportfolio
compohub
DailyProgBot
DeltaBot
dockerfiles
flask
flask-ghpages-example
ggj14
hackage-server
hamiltoncomputerclub.org.nz
haskell-learn
HTML5-Tiny
html5lib-python
iamagamer
ihaskell-notebook
imgur-python
intercity
intro_programming
ipython

In [ ]: