From c4c935a6a5affc9b6c76ec5af73a297bc72ad365 Mon Sep 17 00:00:00 2001 From: Tomas Korbar Date: Sat, 12 May 2018 17:19:16 +0200 Subject: [PATCH] Change default location of cheatsheets --- cheat/cheatsheets/__init__.py | 4 ---- cheat/sheets.py | 2 +- setup.py | 14 +++++++++----- 3 files changed, 10 insertions(+), 10 deletions(-) delete mode 100644 cheat/cheatsheets/__init__.py diff --git a/cheat/cheatsheets/__init__.py b/cheat/cheatsheets/__init__.py deleted file mode 100644 index 7a6d5a1..0000000 --- a/cheat/cheatsheets/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -import os - -def sheets_dir(): - return os.path.split(__file__) diff --git a/cheat/sheets.py b/cheat/sheets.py index 383de87..7a44342 100644 --- a/cheat/sheets.py +++ b/cheat/sheets.py @@ -53,7 +53,7 @@ def paths(): """ Assembles a list of directories containing cheatsheets """ sheet_paths = [ default_path(), - cheatsheets.sheets_dir()[0], + '/usr/share/cheat', ] # merge the CHEATPATH paths into the sheet_paths diff --git a/setup.py b/setup.py index b7aeee4..0bcfa1f 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,11 @@ from distutils.core import setup +import glob import os +cheat_files = [] +for f in os.listdir('cheat/cheatsheets/'): + cheat_files.append(os.path.join('cheat/cheatsheets/',f)) + setup( name = 'cheat', version = '2.3.1', @@ -14,15 +19,14 @@ setup( url = 'https://github.com/chrisallenlane/cheat', packages = [ 'cheat', - 'cheat.cheatsheets', 'cheat.test', ], - package_data = { - 'cheat.cheatsheets': [f for f in os.listdir('cheat/cheatsheets') if '.' not in f] - }, scripts = ['bin/cheat'], install_requires = [ 'docopt >= 0.6.1', 'pygments >= 1.6.0', - ] + ], + data_files = [ + ('/usr/share/cheat', cheat_files), + ], )