From 16537467f11f47311a80c5bb23db8207f35cc00a Mon Sep 17 00:00:00 2001 From: Louis Taylor Date: Mon, 19 Aug 2013 08:49:09 +0100 Subject: [PATCH 1/3] Remove python bytecode file --- cheatsheets/__init__.pyc | Bin 243 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 cheatsheets/__init__.pyc diff --git a/cheatsheets/__init__.pyc b/cheatsheets/__init__.pyc deleted file mode 100644 index 0f202b5366f9d23ffe0b9161ffc2e14dcb1cb94a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 243 zcmYLDJqyB63{1a7MF&Smw@yCXMI4+RbSpxTHu7F=ZE51*>`(RwXr2`e$>k1mNut+u zJYUQXIs78jzSZJXq0kJV0>}UepbVf4fg*SYa0(%dAxr$gG4(F@*4U>5rQ&tN5^HPE zVkJ?+ZRJFU$`CKEB19Rf$Ss`(3)hKvBD$Lse;fY5E0xAJHJRLYj?IqvDov|Oy*;ue a5;nabaoIk;r`B~-+$-7yx`F*ylkfvbCpGl| From 6627b06b1d5eaa170669b8ce3960f1ca02a4a786 Mon Sep 17 00:00:00 2001 From: Louis Taylor Date: Mon, 19 Aug 2013 08:50:40 +0100 Subject: [PATCH 2/3] Add gitignore Ignores python bytecode files and the build directory created by distutils. --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..27ffc2f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.pyc +build From 570d05349ea04f28ceebfe706c30f3f043b4de79 Mon Sep 17 00:00:00 2001 From: Louis Taylor Date: Mon, 19 Aug 2013 09:02:53 +0100 Subject: [PATCH 3/3] No breakage when cheatsheets package isn't found This means cheat can be installed in only the home directory again. --- cheat | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cheat b/cheat index 553ae65..3791fd1 100755 --- a/cheat +++ b/cheat @@ -1,10 +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 else: