mirror of
https://github.com/dtomlinson91/panaetius.git
synced 2025-12-22 04:55:44 +00:00
updating header.py to set the default of panaetius if no __header__ or virtualenv has been detected
This commit is contained in:
@@ -11,14 +11,16 @@ try:
|
|||||||
__spec.loader.exec_module(__header__)
|
__spec.loader.exec_module(__header__)
|
||||||
__header__ = __header__.__header__
|
__header__ = __header__.__header__
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
venv = os.environ.get('VIRTUAL_ENV').split('/')[-1]
|
try:
|
||||||
if venv is not None:
|
venv = os.environ.get('VIRTUAL_ENV').split('/')[-1]
|
||||||
__header__ = venv
|
__header__ = venv
|
||||||
else:
|
except AttributeError:
|
||||||
raise FileNotFoundError(
|
print(
|
||||||
f'Cannot find a __header__.py file in {os.getcwd()} containing the'
|
f'Cannot find a __header__.py file in {os.getcwd()} containing the'
|
||||||
' __header__ value of your project name and you are not working'
|
' __header__ value of your project name and you are not working'
|
||||||
' from a virtual environment. Either make sure this file '
|
' from a virtual environment. Either make sure this file '
|
||||||
'exists and the value is set or create and work from a virtual '
|
'exists and the value is set or create and work from a virtual '
|
||||||
'environment and try again.'
|
'environment and try again. \n The __header__ value has been '
|
||||||
|
'set to the default of panaetius.'
|
||||||
)
|
)
|
||||||
|
__header__ = 'panaetius'
|
||||||
|
|||||||
Reference in New Issue
Block a user