diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..27ffc2f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.pyc +build diff --git a/cheat b/cheat index a41c375..1017b14 100755 --- a/cheat +++ b/cheat @@ -1,11 +1,16 @@ #!/usr/bin/env python import os import sys -import cheatsheets def cheat_directories(): - default = [ default_dir for default_dir in [os.path.expanduser('~/.cheat'), - cheatsheets.cheat_dir] if os.path.isdir(default_dir) ] + default_directories = [os.path.expanduser('~/.cheat')] + try: + import cheatsheets + default_directories.append(cheatsheets.cheat_dir) + except ImportError: + pass + + default = [ default_dir for default_dir in default_directories if os.path.isdir(default_dir) ] if 'CHEATPATH' in os.environ and os.environ['CHEATPATH']: return [ path for path in os.environ['CHEATPATH'].split(os.pathsep)\ if os.path.isdir(path) ] + default diff --git a/cheatsheets/__init__.py b/cheatsheets/__init__.py deleted file mode 100644 index 8a9b797..0000000 --- a/cheatsheets/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -import os - -cheat_dir, __init = os.path.split(__file__) diff --git a/cheatsheets/__init__.pyc b/cheatsheets/__init__.pyc deleted file mode 100644 index 0f202b5..0000000 Binary files a/cheatsheets/__init__.pyc and /dev/null differ