Skip to content
Snippets Groups Projects
Commit 77f7ea8c authored by valerio's avatar valerio
Browse files

Added parsing of ostrc file for dng. File is createdf with template if

not existing


git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2577 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent 370f244f
No related branches found
No related tags found
No related merge requests found
...@@ -164,6 +164,22 @@ if options.builder=="RULE_BASED": ...@@ -164,6 +164,22 @@ if options.builder=="RULE_BASED":
conop.Conopology.Instance().RegisterBuilder(rbb,'rbb') conop.Conopology.Instance().RegisterBuilder(rbb,'rbb')
conop.Conopology.Instance().SetDefaultBuilder('rbb') conop.Conopology.Instance().SetDefaultBuilder('rbb')
home = os.getenv('HOME') or os.getenv('USERPROFILE')
_ostrc=os.path.join(home, '.ostrc')
if os.path.exists(_ostrc):
try:
exec(open(_ostrc))
except Exception, e:
print e
else:
rcfile=open(_ostrc,"w")
print >> rcfile, '# This python file is parsed by ost and dng at startup'
print >> rcfile, '# Its content is made available in the global namespace'
print >> rcfile, '# It can be used to define custom variables and functions'
print >> rcfile, '# For example:'
print >> rcfile, '# IMPORTANT_DIR="path/to/important/dir"'
rcfile.close()
PushVerbosityLevel(options.vlevel) PushVerbosityLevel(options.vlevel)
_InitFrontEnd() _InitFrontEnd()
......
...@@ -60,6 +60,14 @@ if os.path.exists(_ostrc): ...@@ -60,6 +60,14 @@ if os.path.exists(_ostrc):
exec(open(_ostrc)) exec(open(_ostrc))
except Exception, e: except Exception, e:
print e print e
else:
rcfile=open(_ostrc,"w")
print >> rcfile, '# This python file is parsed by ost and dng at startup'
print >> rcfile, '# Its content is be made available in the global namespace'
print >> rcfile, '# It can be used to define custom variables and functions'
print >> rcfile, '# For example:'
print >> rcfile, '# IMPORTANT_DIR="path/to/important/dir"'
rcfile.close()
PushVerbosityLevel(options.vlevel) PushVerbosityLevel(options.vlevel)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment