diff --git a/paramecio2/console.py b/paramecio2/console.py index 8a6ef13..92e4877 100755 --- a/paramecio2/console.py +++ b/paramecio2/console.py @@ -339,7 +339,7 @@ def start(): # Installing models - padmin='padmin.py' + padmin='paramecio2db' os.chmod(padmin, 0o755) @@ -359,7 +359,7 @@ def start(): if m.match(f) and not underscore.match(f): - if call('./padmin.py --model '+models_path+'/'+f, shell=True) > 0: + if call('paramecio2db --model '+models_path+'/'+f, shell=True) > 0: print('Error, cannot create the modules of '+models_path+'/'+f) else: print('Models from '+models_path+'/'+f+' created') @@ -385,7 +385,7 @@ def start(): exit(1) else: print('Postinstall script finished') - """ + conn.close() if __name__=="__main__": diff --git a/paramecio2/libraries/load_apps.py b/paramecio2/libraries/load_apps.py new file mode 100644 index 0000000..81ef7ad --- /dev/null +++ b/paramecio2/libraries/load_apps.py @@ -0,0 +1,32 @@ +import csv +import os + +"""Simple function for add new modules using a simple csv text + +Args: + apps (dict): Dict with modules apps. + +Returns: + + apps (dict): Dict with the extra modules from extra_apps.txt csv file. + +""" + +def load_extra_modules(apps): + + file_extra_apps='settings/extra_apps.txt' + + if os.path.isfile(file_extra_apps): + + with open(file_extra_apps, newline='') as csvfile: + + spamreader=csv.reader(csvfile, delimiter='|') + + for row in spamreader: + + apps[row[0]]=row[1:] + + if 'admin' in apps: + apps['admin']=apps.pop('admin') + + return apps