This repository was archived by the owner on Feb 20, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -44,8 +44,27 @@ def xdg_open(uri):
44
44
45
45
46
46
def show_cheat_sheet ():
47
+ # case where `git-trac` was just symbolically linked
47
48
root_dir = os .path .dirname (os .path .dirname (__file__ ))
48
49
cheat_sheet = os .path .join (root_dir , 'doc' , 'git-cheat-sheet.pdf' )
50
+ # case of `python setup.py install --user`
51
+ if not os .path .exists (cheat_sheet ):
52
+ root_dir = __import__ ('site' ).USER_BASE
53
+ cheat_sheet = os .path .join (root_dir ,
54
+ 'share' ,
55
+ 'git-trac-command' ,
56
+ 'git-cheat-sheet.pdf' )
57
+ # case of `python setup.py install`
58
+ if not os .path .exists (cheat_sheet ):
59
+ root_dir = sys .prefix
60
+ cheat_sheet = os .path .join (root_dir ,
61
+ 'share' ,
62
+ 'git-trac-command' ,
63
+ 'git-cheat-sheet.pdf' )
64
+ # go to internet if not found
65
+ if not os .path .exists (cheat_sheet ):
66
+ cheat_sheet = "http://github.com/sagemath/git-trac-command/raw/master/doc/git-cheat-sheet.pdf"
67
+ print ('Cheat sheet not found locally. Trying the internet.' )
49
68
xdg_open (cheat_sheet )
50
69
51
70
Original file line number Diff line number Diff line change 8
8
author = 'Volker Braun' ,
9
9
10
10
packages = ['git_trac' ],
11
+ data_files = [('share/git-trac-command' , ['doc/git-cheat-sheet.pdf' ])],
11
12
scripts = ['git-trac' ],
12
13
version = '1.0' ,
13
14
url = 'https://github.com/sagemath/git-trac-command' ,
You can’t perform that action at this time.
0 commit comments