Skip to content

Commit 660c55b

Browse files
committed
moved rep names in globals.py
1 parent c372802 commit 660c55b

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

lib/cheat_wrapper.py

+2-13
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
MYDIR = os.path.abspath(os.path.join(__file__, '..', '..'))
2121
sys.path.append("%s/lib/" % MYDIR)
22-
from globals import error, ANSI2HTML, COLOR_STYLES
22+
from globals import error, ANSI2HTML, COLOR_STYLES, GITHUB_REPOSITORY
2323
from buttons import TWITTER_BUTTON, GITHUB_BUTTON, GITHUB_BUTTON_FOOTER
2424
from languages_data import LEXER, get_lexer_name
2525
from get_answer import get_topic_type, get_topics_list, get_answer, find_answer_by_keyword
@@ -122,18 +122,7 @@ def _colorize_ansi_answer(topic, answer, color_style, # pylint: di
122122

123123
def _github_button(topic_type):
124124

125-
repository = {
126-
"cheat.sheets" : 'chubin/cheat.sheets',
127-
"cheat.sheets dir" : 'chubin/cheat.sheets',
128-
"tldr" : 'tldr-pages/tldr',
129-
"cheat" : 'chrisallenlane/cheat',
130-
"learnxiny" : 'adambard/learnxinyminutes-docs',
131-
"internal" : '',
132-
"search" : '',
133-
"unknown" : '',
134-
}
135-
136-
full_name = repository.get(topic_type, '')
125+
full_name = GITHUB_REPOSITORY.get(topic_type, '')
137126
if not full_name:
138127
return ''
139128

lib/globals.py

+15
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,27 @@
3838
PATH_CHEAT_SHEETS = "/home/igor/cheat.sheets/sheets/"
3939
PATH_CHEAT_SHEETS_SPOOL = "/home/igor/cheat.sheets/spool/"
4040
PATH_LEARNXINY = "/home/igor/git/github.com/adambard/learnxinyminutes-docs"
41+
PATH_LATENZ = "/home/igor/git/github.com/chubin/late.nz/bin"
4142
else:
4243
PATH_TLDR_PAGES = os.path.join(MYDIR, "cheatsheets/tldr/*/*.md")
4344
PATH_CHEAT_PAGES = os.path.join(MYDIR, "cheatsheets/cheat/*")
4445
PATH_CHEAT_SHEETS = os.path.join(MYDIR, "cheatsheets/sheets/")
4546
PATH_CHEAT_SHEETS_SPOOL = os.path.join(MYDIR, "cheatsheets/spool/")
4647
PATH_LEARNXINY = os.path.join(MYDIR, "cheatsheets/learnxinyminutes-docs")
48+
PATH_LATENZ = os.path.join(MYDIR, "late.nz/bin")
49+
50+
GITHUB_REPOSITORY = {
51+
"late.nz" : 'chubin/late.nz',
52+
"cheat.sheets" : 'chubin/cheat.sheets',
53+
"cheat.sheets dir" : 'chubin/cheat.sheets',
54+
"tldr" : 'tldr-pages/tldr',
55+
"cheat" : 'chrisallenlane/cheat',
56+
"learnxiny" : 'adambard/learnxinyminutes-docs',
57+
"internal" : '',
58+
"search" : '',
59+
"unknown" : '',
60+
}
61+
4762

4863
#
4964
# Reading configuration from etc/config.yaml

0 commit comments

Comments
 (0)