diff --git a/paramecio/console.py b/paramecio/console.py index 6e0f8d7..04feb2d 100644 --- a/paramecio/console.py +++ b/paramecio/console.py @@ -262,21 +262,8 @@ def start(): print('Added module %s' % module_path) final_modules.append(("modules/%s" % (module_path)).replace('/', '.')) - final_modules_models.append("modules/%s/models" % (module_path)) + final_modules_models.append("modules/%s" % (module_path)) - # Execute postscript - - postscript="%s/modules/%s/install/postinstall.py" % (path, module_path) - - if os.path.isfile(postscript): - - os.chmod(postscript, 0o755) - - if call(postscript, shell=True) > 0: - print('Error, cannot execute the postinstall script') - exit(1) - else: - print('Postinstall script finished') # Edit config.py @@ -302,6 +289,8 @@ def start(): print('Updated configuration for add new modules...') + #Change workdir + real_dir=os.getcwd() os.chdir(args.path) @@ -324,9 +313,9 @@ def start(): os.chmod(padmin, 0o755) - for models_path in final_modules_models: + for mod_path in final_modules_models: - #models_path="modules/%s/models" % (module_path) + models_path=mod_path+'/models' if os.path.isdir(models_path): @@ -343,7 +332,29 @@ def start(): if call('./padmin.py --model '+models_path+'/'+f, shell=True) > 0: print('Error, cannot create the modules of '+models_path+'/'+f) else: - print('Modules from '+models_path+'/'+f+' created') + print('Models from '+models_path+'/'+f+' created') + + # Execute two times the loop because i can need good installed models for postscript script + + # Execute postscript + + print('Executing postscripts') + + for mod_path in final_modules_models: + + postscript=mod_path+"/install/postinstall.py" + + os.chmod(padmin, 0o755) + + if os.path.isfile(postscript): + + os.chmod(postscript, 0o755) + + if call('./'+postscript, shell=True) > 0: + print('Error, cannot execute the postinstall script') + exit(1) + else: + print('Postinstall script finished') if __name__=="__main__": diff --git a/paramecio/cromosoma/extrafields/arrayfield.py b/paramecio/cromosoma/extrafields/arrayfield.py index 2ecf021..c5a7827 100644 --- a/paramecio/cromosoma/extrafields/arrayfield.py +++ b/paramecio/cromosoma/extrafields/arrayfield.py @@ -39,7 +39,7 @@ class ArrayField(PhangoField): def get_type_sql(self): - return 'TEXT NOT NULL DEFAULT ""' + return 'TEXT NOT NULL' def show_formatted(self, value): diff --git a/paramecio/cromosoma/extrafields/dictfield.py b/paramecio/cromosoma/extrafields/dictfield.py index d83dad2..63b269d 100644 --- a/paramecio/cromosoma/extrafields/dictfield.py +++ b/paramecio/cromosoma/extrafields/dictfield.py @@ -38,7 +38,7 @@ class DictField(PhangoField): def get_type_sql(self): - return 'TEXT NOT NULL DEFAULT ""' + return 'TEXT NOT NULL' def show_formatted(self, value):