#
usage="""usage: %prog [options]
Typical use is:
- python appli_gen.py
+ python appli_gen.py
Typical use with options is:
python appli_gen.py --verbose --prefix=<install directory> --config=<configuration file>
"""
modules_tag = "modules"
module_tag = "module"
samples_tag = "samples"
+resources_tag = "resources"
# --- names of attributes in XML configuration file
nam_att = "name"
if self.space == [appli_tag, prereq_tag] and path_att in attrs.getNames():
self.config["prereq_path"] = attrs.getValue( path_att )
pass
+ # --- if we are analyzing "resources" element then store its "path" attribute
+ if self.space == [appli_tag, resources_tag] and path_att in attrs.getNames():
+ self.config["resources_path"] = attrs.getValue( path_att )
+ pass
# --- if we are analyzing "samples" element then store its "path" attribute
if self.space == [appli_tag, samples_tag] and path_att in attrs.getNames():
self.config["samples_path"] = attrs.getValue( path_att )
print "Configure parser: parse error in configuration file %s" % filename
pass
except xml.sax.SAXException, inst:
- print inst.args
+ print inst.args
print "Configure parser: error in configuration file %s" % filename
pass
except:
command = "cp -p " + filename + ' ' + os.path.join(home_dir,"config_appli.xml")
os.system(command)
pass
-
+
virtual_salome.mkdir(os.path.join(home_dir,'env.d'))
if os.path.isfile(_config["prereq_path"]):
command='cp -p ' + _config["prereq_path"] + ' ' + os.path.join(home_dir,'env.d','envProducts.sh')
command='export DATA_DIR=' + _config["samples_path"] +'\n'
f.write(command)
pass
+ if _config.has_key("resources_path") and os.path.isfile(_config["resources_path"]):
+ command='export USER_CATALOG_RESOURCES_FILE=' + os.path.abspath(_config["resources_path"]) +'\n'
+ f.write(command)
+
f.close()
<parameter name="killall" value="no"/>
<parameter name="noexcepthandler" value="no"/>
<parameter name="modules" value="""
- f.write(command)
+ f.write(command)
f.write('"')
for module in _config["guimodules"][:-1]:
f.write(module)
</section>
</document>
"""
- f.write(command)
+ f.write(command)
f.close()
#Add default CatalogResources.xml file
hostname="localhost" />
</resources>
"""
- f.write(command)
+ f.write(command)
f.close()
#Add USERS directory with 777 permission to store users configuration files
copy of ${KERNEL_ROOT_DIR}/bin/salome/config_appli.xml.
The file describes the list of %SALOME modules used in the application, with
their respective installation path. The configuration file also defines the
-path of an existing script which sets the %SALOME prerequisites,
-and optionnaly, the path of samples directory (SAMPLES_SRC).
+path of an existing script which sets the %SALOME prerequisites (tag "prerequisites"),
+and optionally, the path of samples directory (SAMPLES_SRC) (tag "samples")
+and the path of a catalog of resources (tag "resources").
+
The following command:
\code