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):
4444
4545
4646def show_cheat_sheet ():
47+ # case where `git-trac` was just symbolically linked
4748 root_dir = os .path .dirname (os .path .dirname (__file__ ))
4849 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.' )
4968 xdg_open (cheat_sheet )
5069
5170
Original file line number Diff line number Diff line change 88 author = 'Volker Braun' ,
99 author_email = 'vbraun.name@gmail.com' ,
1010 packages = ['git_trac' ],
11+ data_files = [('share/git-trac-command' , ['doc/git-cheat-sheet.pdf' ])],
1112 scripts = ['git-trac' ],
1213 version = '1.0' ,
1314 url = 'https://github.com/sagemath/git-trac-command' ,
You can’t perform that action at this time.
0 commit comments