mirror of https://gitlab.com/bashrc2/epicyon
Tidying
parent
ff7f7aaa09
commit
d826ded287
10
theme.py
10
theme.py
|
@ -46,10 +46,16 @@ def import_theme(base_dir: str, filename: str) -> bool:
|
||||||
' missing from imported theme')
|
' missing from imported theme')
|
||||||
return False
|
return False
|
||||||
new_theme_name = None
|
new_theme_name = None
|
||||||
|
new_theme_name1 = None
|
||||||
try:
|
try:
|
||||||
with open(temp_theme_dir + '/name.txt', 'r',
|
with open(temp_theme_dir + '/name.txt', 'r',
|
||||||
encoding='utf-8') as fp_theme:
|
encoding='utf-8') as fp_theme:
|
||||||
new_theme_name1 = fp_theme.read()
|
new_theme_name1 = fp_theme.read()
|
||||||
|
except OSError:
|
||||||
|
print('EX: import_theme unable to read ' +
|
||||||
|
temp_theme_dir + '/name.txt')
|
||||||
|
|
||||||
|
if new_theme_name1:
|
||||||
new_theme_name = remove_eol(new_theme_name1)
|
new_theme_name = remove_eol(new_theme_name1)
|
||||||
if len(new_theme_name) > 20:
|
if len(new_theme_name) > 20:
|
||||||
print('WARN: Imported theme name is too long')
|
print('WARN: Imported theme name is too long')
|
||||||
|
@ -66,9 +72,7 @@ def import_theme(base_dir: str, filename: str) -> bool:
|
||||||
if char in new_theme_name:
|
if char in new_theme_name:
|
||||||
print('WARN: theme name contains forbidden character')
|
print('WARN: theme name contains forbidden character')
|
||||||
return False
|
return False
|
||||||
except OSError:
|
|
||||||
print('EX: import_theme unable to read ' +
|
|
||||||
temp_theme_dir + '/name.txt')
|
|
||||||
if not new_theme_name:
|
if not new_theme_name:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue