added exceed option

This commit is contained in:
Eric Romano
2013-05-27 22:40:22 -04:00
parent 0656a231d0
commit cc8961f892

View File

@ -2,6 +2,12 @@
import os, sys, datetime, math, itertools, urllib2, json import os, sys, datetime, math, itertools, urllib2, json
title=''' title='''
_ __ _____ __ _
____ _(_) /_/ __(_) /_(_)
/ __ `/ / __/ /_/ / __/ /
/ /_/ / / /_/ __/ / /_/ /
\__, /_/\__/_/ /_/\__/_/
/____/
''' '''
kitty=[ kitty=[
@ -229,27 +235,32 @@ def save(output, filename):
def main(): def main():
global images global images
print ''' print title
_ __ _____ __ _ print 'Enter your github username:'
____ _(_) /_/ __(_) /_(_)
/ __ `/ / __/ /_/ / __/ /
/ /_/ / / /_/ __/ / /_/ /
\__, /_/\__/_/ /_/\__/_/
/____/
'''
print 'enter your github username:'
username = raw_input(">") username = raw_input(">")
cal = get_calendar(username) cal = get_calendar(username)
m = multiplier(max_commits(cal)) m = multiplier(max_commits(cal))
print 'enter name of the repo to be used by gitfiti:' print 'Enter name of the repo to be used by gitfiti:'
repo = raw_input(">") repo = raw_input(">")
print 'enter weeks to offset the image:' print 'Enter number of weeks to offset the image:'
offset = raw_input(">") offset = raw_input(">")
if offset == None: offset = 0 if offset == None: offset = 0
else: offset = int(offset) else: offset = int(offset)
print ('By default gitfiti.py matches the darkest pixel to the highest\n'
'number of commits found in your github commit/activity calendar,\n'
'\n'
'Currently this is : %s commits\n'
'\n'
'Enter the word "gitfiti" to exceed your max\n'
'(this option generates WAY more commits)\n'
'Any other input will cause the default matching behavior') % (max_commits(cal),)
match = raw_input(">")
if match == "gitfiti": match = m
else: match = 1
print 'enter file(s) to load images from (blank if not applicable)' print 'enter file(s) to load images from (blank if not applicable)'
imgNames = raw_input(">").split(' ') imgNames = raw_input(">").split(' ')
images = dict(images, **load_images(imgNames)) images = dict(images, **load_images(imgNames))
@ -262,7 +273,7 @@ def main():
try: image = images[image] try: image = images[image]
except: image = images['kitty'] except: image = images['kitty']
output = fake_it(image, get_start_date(), username, repo, offset, m) output = fake_it(image, get_start_date(), username, repo, offset, m*match)
save(output, 'gitfiti.sh') save(output, 'gitfiti.sh')
print 'gitfiti.sh saved. Create a new(!) repo at: https://github.com/new and run it.' print 'gitfiti.sh saved. Create a new(!) repo at: https://github.com/new and run it.'