1.1 --- a/XSLForms/Prepare.py Tue Nov 01 16:47:22 2005 +0000
1.2 +++ b/XSLForms/Prepare.py Tue Nov 01 18:54:12 2005 +0000
1.3 @@ -28,7 +28,7 @@
1.4
1.5 # Generic functions.
1.6
1.7 -def _ensure_stylesheet(template_name, output_name, fn, *args, **kw):
1.8 +def _ensure_document(template_name, output_name, fn, *args, **kw):
1.9 if not os.path.exists(output_name) or \
1.10 os.path.getmtime(output_name) < os.path.getmtime(template_name):
1.11
1.12 @@ -69,7 +69,7 @@
1.13 given 'output_name'.
1.14 """
1.15
1.16 - _ensure_stylesheet(template_name, output_name, make_stylesheet)
1.17 + _ensure_document(template_name, output_name, make_stylesheet)
1.18
1.19 def ensure_stylesheet_fragment(template_name, output_name, element_id):
1.20
1.21 @@ -80,7 +80,7 @@
1.22 'element_id'.
1.23 """
1.24
1.25 - _ensure_stylesheet(template_name, output_name, make_stylesheet_fragment, element_id)
1.26 + _ensure_document(template_name, output_name, make_stylesheet_fragment, element_id)
1.27
1.28 # Document initialisation functions.
1.29
1.30 @@ -112,7 +112,7 @@
1.31 indicate whether enumerations are to be initialised from external documents.
1.32 """
1.33
1.34 - _ensure_stylesheet(template_name, input_name, make_input_stylesheet, init_enumerations)
1.35 + _ensure_document(template_name, input_name, make_input_stylesheet, init_enumerations)
1.36
1.37 # Schema-related functions.
1.38
1.39 @@ -131,20 +131,36 @@
1.40 _make_document(template_name, output_name, stylesheet_names, encoding, parameters={"widget-name" : widget_name})
1.41
1.42 def ensure_qt_fragment(template_name, output_name, widget_name):
1.43 - _ensure_stylesheet(template_name, output_name, make_qt_fragment, widget_name)
1.44 + _ensure_document(template_name, output_name, make_qt_fragment, widget_name)
1.45
1.46 # Qt Designer Web functions.
1.47
1.48 def make_qt_template(template_name, output_name, stylesheet_names=["QtDesigner.xsl"], encoding=None):
1.49 - return make_stylesheet(template_name, output_name, stylesheet_names, encoding)
1.50 + _make_document(template_name, output_name, stylesheet_names, encoding)
1.51
1.52 def ensure_qt_template(template_name, output_name):
1.53 - _ensure_stylesheet(template_name, output_name, make_qt_template)
1.54 + _ensure_document(template_name, output_name, make_qt_template)
1.55
1.56 def make_qt_stylesheet(template_name, output_name, stylesheet_names=["QtDesigner.xsl", "PrepareMacro.xsl", "Prepare.xsl"], encoding=None):
1.57 - return make_stylesheet(template_name, output_name, stylesheet_names, encoding)
1.58 + _make_document(template_name, output_name, stylesheet_names, encoding)
1.59
1.60 def ensure_qt_stylesheet(template_name, output_name):
1.61 - _ensure_stylesheet(template_name, output_name, make_qt_stylesheet)
1.62 + _ensure_document(template_name, output_name, make_qt_stylesheet)
1.63 +
1.64 +# Qt Designer Web functions for fragments.
1.65 +
1.66 +def make_qt_template_fragment(template_name, output_name, widget_name, stylesheet_names=["QtDesignerExtract.xsl", "QtDesigner.xsl"], encoding=None):
1.67 + _make_document(template_name, output_name, stylesheet_names, encoding, parameters={"widget-name" : widget_name})
1.68 +
1.69 +def ensure_qt_template_fragment(template_name, output_name, widget_name):
1.70 + _ensure_document(template_name, output_name, make_qt_template_fragment, widget_name)
1.71 +
1.72 +def make_qt_stylesheet_fragment(template_name, output_name, widget_name,
1.73 + stylesheet_names=["QtDesignerExtract.xsl", "QtDesigner.xsl", "PrepareMacro.xsl", "Prepare.xsl"], encoding=None):
1.74 +
1.75 + _make_document(template_name, output_name, stylesheet_names, encoding, parameters={"widget-name" : widget_name})
1.76 +
1.77 +def ensure_qt_stylesheet_fragment(template_name, output_name, widget_name):
1.78 + _ensure_document(template_name, output_name, make_qt_stylesheet_fragment, widget_name)
1.79
1.80 # vim: tabstop=4 expandtab shiftwidth=4