Merge branch 'master' of https://github.com/smartboyathome/cheat into smartboyathome-master

* 'master' of https://github.com/smartboyathome/cheat:
  Making the default cheats directory Windows-compatible.
This commit is contained in:
Chris Lane 2013-08-21 22:24:56 -04:00
commit 2b9d48c8c4

8
cheat
View File

@ -2,9 +2,11 @@
import os
import sys
DEFAULT_CHEAT_DIR = os.path.join(os.path.expanduser('~'), '.cheats')
# assembles a list of directories containing cheatsheets
def cheat_directories():
default_directories = [os.path.expanduser('~/.cheat')]
default_directories = [DEFAULT_CHEAT_DIR]
try:
import cheatsheets
default_directories.append(cheatsheets.cheat_dir)
@ -35,8 +37,8 @@ def main():
# verify that we have at least one cheat directory
if not cheat_dirs:
print >> sys.stderr, \
'The ~/.cheat dir does not exist or the CHEATPATH var is not set.'
error_msg = 'The {default} dir does not exist or the CHEATPATH var is not set.'
print >> sys.stderr, error_msg.format(default=DEFAULT_CHEAT_DIR)
exit()
# list the files in the ~/.cheat directory