On Dec 22, 2010, at 9:05 AM, Jonathan Lundell wrote:
>
> On Dec 22, 2010, at 8:59 AM, dcrodjer wrote:
>> So as a workaround what I am doing is:
>>
>> try:
>> create_missing_folders()
>> except AttributeError:
>> pass
>>
>>
>> Is this safe? Is there some other way that I can check if the environment
>> is gae as it seems the request variable is not available in main.py .
>
> Try checking global_settings.web2py_runtime_gae instead.
Massimo fixed this in 1.91.2, making the call conditional.
Massimo, I don't think that's right, because we still want the sys.path logic.
Try this instead:
def create_missing_folders():
if not global_settings.web2py_runtime_gae:
for path in ('applications', 'deposit', 'site-packages', 'logs'):
path = abspath(path, gluon=True)
if not os.path.exists(path):
os.mkdir(path)
paths = (global_settings.gluon_parent, abspath('site-packages', gluon=True),
"")
[add_path_first(path) for path in paths]