diff --git a/cheat b/cheat index ad69b44..856a419 100755 --- a/cheat +++ b/cheat @@ -8,8 +8,8 @@ cheat_dir = os.path.expanduser('~') + '/.cheat/' # verify that the ~/.cheat directory exists if not os.path.isdir(cheat_dir): - print >> sys.stderr, 'The ~/.cheat directory does not exist.' - exit() + print >> sys.stderr, 'The ~/.cheat directory does not exist.' + exit() # list the files in the ~/.cheat directory cheatsheets = os.listdir(cheat_dir) @@ -17,16 +17,16 @@ cheatsheets.sort() # print help if requested if keyphrase in ['', 'help', '--help', '-h']: - print "Usage: cheat [keyphrase]\n" - print "Available keyphrases:" - print "\n".join(cheatsheets) - exit() + print "Usage: cheat [keyphrase]\n" + print "Available keyphrases:" + print "\n".join(cheatsheets) + exit() # print the cheatsheet if it exists if keyphrase in cheatsheets: - with open (cheat_dir + keyphrase, 'r') as cheatsheet: - print cheatsheet.read() + with open (cheat_dir + keyphrase, 'r') as cheatsheet: + print cheatsheet.read() # if it does not, say so else: - print 'No cheatsheet found.' + print 'No cheatsheet found.' diff --git a/install b/install index cf64c1f..4d55ab8 100755 --- a/install +++ b/install @@ -4,9 +4,9 @@ import shutil import sys try: - shutil.copy('./cheat', '/usr/local/bin/') - shutil.copytree('./.cheat', expanduser('~') + '/.cheat') - print "cheat has been installed successfully." + shutil.copy('./cheat', '/usr/local/bin/') + shutil.copytree('./.cheat', expanduser('~') + '/.cheat') + print "cheat has been installed successfully." except IOError as e: - print >> sys.stderr, "This installer must be run as root." - sys.exit(1) + print >> sys.stderr, "This installer must be run as root." + sys.exit(1)