From 6a4414f5381e6ed7e8516d271cee0d62ed388cab Mon Sep 17 00:00:00 2001 From: Charley Peng Date: Thu, 29 May 2014 09:56:54 +1000 Subject: [PATCH 1/3] simple py3 import change --- cheat/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cheat/__init__.py b/cheat/__init__.py index 50b5a16..04d9a4c 100644 --- a/cheat/__init__.py +++ b/cheat/__init__.py @@ -1,3 +1,3 @@ -import sheet -import sheets -import utils +from . import sheet +from . import sheets +from . import utils From 0a3fd3559c74b501e630a8a841285af91e0a5b82 Mon Sep 17 00:00:00 2001 From: Chris Lane Date: Wed, 28 May 2014 20:47:49 -0400 Subject: [PATCH 2/3] Resolves #160 The `setup.py` script no longer attempts to install files to privileged system directories. (Previously, it attempted to do this in order to enable command-line autocompletion.) In lieu of doing this within the installer directly, I have simply included brief instructions explaining how to configure this manually. Version bumped accordingly. --- README.md | 7 +++++++ bin/cheat | 2 +- cheat/autocompletion/{_cheat.zsh => cheat.zsh} | 0 setup.py | 14 ++------------ 4 files changed, 10 insertions(+), 13 deletions(-) rename cheat/autocompletion/{_cheat.zsh => cheat.zsh} (100%) diff --git a/README.md b/README.md index e201f15..de8f961 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,13 @@ enable this feature, set a `CHEATCOLORS` environment variable: export CHEATCOLORS=true +### Enabling Command-line Autocompletion ### +The `cheat/autocompletion` directory contains scripts to enable command-line +autocompletion for various shells. To activate autocompletion, simply copy the +appropriate script to the appropriate path on your system. (The "appropriate +path" will vary on a per-platform basis, so this documentation shall not +speculate as to where that may be.) + Related Projects ---------------- diff --git a/bin/cheat b/bin/cheat index de8ee2a..885c807 100755 --- a/bin/cheat +++ b/bin/cheat @@ -38,7 +38,7 @@ from docopt import docopt if __name__ == '__main__': # parse the command-line options - options = docopt(__doc__, version='cheat 2.0.5') + options = docopt(__doc__, version='cheat 2.0.6') # list directories if options['--directories']: diff --git a/cheat/autocompletion/_cheat.zsh b/cheat/autocompletion/cheat.zsh similarity index 100% rename from cheat/autocompletion/_cheat.zsh rename to cheat/autocompletion/cheat.zsh diff --git a/setup.py b/setup.py index 72eec5d..782fc56 100644 --- a/setup.py +++ b/setup.py @@ -1,18 +1,9 @@ from distutils.core import setup import os -data = [ - ('/usr/share/zsh/site-functions', ['cheat/autocompletion/_cheat.zsh']), - ('/etc/bash_completion.d' , ['cheat/autocompletion/cheat.bash']), - ('/usr/share/fish/completions' , ['cheat/autocompletion/cheat.fish']) - ] - -if os.name == 'nt': - data = [] - setup( name = 'cheat', - version = '2.0.5', + version = '2.0.6', author = 'Chris Lane', author_email = 'chris@chris-allen-lane.com', license = 'GPL3', @@ -29,8 +20,7 @@ setup( package_data = { 'cheat.cheatsheets': [f for f in os.listdir('cheat/cheatsheets') if '.' not in f] }, - scripts = ['bin/cheat'], - data_files = data, + scripts = ['bin/cheat'], install_requires = [ 'docopt >= 0.6.1', 'pygments >= 1.6.0', From d7d033c9089b8e2abe585675f64238c8f831ecbd Mon Sep 17 00:00:00 2001 From: Chris Lane Date: Wed, 28 May 2014 21:02:27 -0400 Subject: [PATCH 3/3] Version bump --- bin/cheat | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/cheat b/bin/cheat index 885c807..a995dac 100755 --- a/bin/cheat +++ b/bin/cheat @@ -38,7 +38,7 @@ from docopt import docopt if __name__ == '__main__': # parse the command-line options - options = docopt(__doc__, version='cheat 2.0.6') + options = docopt(__doc__, version='cheat 2.0.7') # list directories if options['--directories']: diff --git a/setup.py b/setup.py index 782fc56..735ea41 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ import os setup( name = 'cheat', - version = '2.0.6', + version = '2.0.7', author = 'Chris Lane', author_email = 'chris@chris-allen-lane.com', license = 'GPL3',