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__)
|
||||
__header__ = __header__.__header__
|
||||
except FileNotFoundError:
|
||||
try:
|
||||
venv = os.environ.get('VIRTUAL_ENV').split('/')[-1]
|
||||
if venv is not None:
|
||||
__header__ = venv
|
||||
else:
|
||||
raise FileNotFoundError(
|
||||
except AttributeError:
|
||||
print(
|
||||
f'Cannot find a __header__.py file in {os.getcwd()} containing the'
|
||||
' __header__ value of your project name and you are not working'
|
||||
' from a virtual environment. Either make sure this file '
|
||||
'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