mlhim-specs-dev team mailing list archive
-
mlhim-specs-dev team
-
Mailing list archive
-
Message #00622
[Branch ~cdd-dev/cdd/trunk] Rev 199: Put the generation of config file inside the metadata dialog class and improved the procedure of ...
------------------------------------------------------------
revno: 199
committer: Eduardo C. P. Ribeiro <eduardo.cesar@xxxxxxx>
branch nick: cdd
timestamp: Fri 2012-07-27 20:27:36 -0300
message:
Put the generation of config file inside the metadata dialog class and improved the procedure of ccd generation.
modified:
src/cdd.py
src/cdg_cdd.wxg
src/cdg_main.py
src/mlhim2.py
--
lp:cdd
https://code.launchpad.net/~cdd-dev/cdd/trunk
Your team MLHIM Specifications Developers is subscribed to branch lp:cdd.
To unsubscribe from this branch go to https://code.launchpad.net/~cdd-dev/cdd/trunk/+edit-subscription
=== modified file 'src/cdd.py'
--- src/cdd.py 2012-07-27 22:12:44 +0000
+++ src/cdd.py 2012-07-27 23:27:36 +0000
@@ -19,7 +19,7 @@
_ = gettext.gettext
-#Where the info will be stored
+# Where the information that will be used to generate the ccd will be stored
info = cdg_main.Info()
class MainFrame(wx.Frame):
@@ -169,7 +169,9 @@
######## Misc initializations ######################################
self.config_dialog = cdg_main.ConfigDialog(self)
-
+ self.metadata = mlhim2.Metadata(self)
+ self.metadata.read_config()
+ info.get_meta_info(self.metadata)
def OnSelChanged(self, event):
@@ -185,12 +187,12 @@
#self.display.SetLabel(_("You are at the root, nothing to do here."))
elif selText == "Metadata":
- _data = mlhim2.Metadata(self)
- result = _data.ShowModal()
+ result = self.metadata.ShowModal()
if result == wx.ID_OK:
- cdg_main.extract_info(_data, info)
- _data.config.get_panel_configs()
- _data.config.save_config()
+ self.metadata.save_config()
+
+ # Extract the necessary information from the metadata dialog
+ info.get_meta_info(self.metadata)
elif selText == "definition":
=== modified file 'src/cdg_cdd.wxg'
--- src/cdg_cdd.wxg 2012-07-27 22:12:44 +0000
+++ src/cdg_cdd.wxg 2012-07-27 23:27:36 +0000
@@ -1,8 +1,8 @@
<?xml version="1.0"?>
-<!-- generated by wxGlade 0.6.4 on Fri Jul 27 18:37:17 2012 -->
+<!-- generated by wxGlade 0.6.4 on Fri Jul 27 19:23:47 2012 -->
<application path="cdg_main.py" name="" class="" option="0" language="python" top_window="frame_principal" encoding="UTF-8" use_gettext="0" overwrite="0" use_new_namespace="1" for_version="2.8" is_template="0" indent_amount="4" indent_symbol="space" source_extension=".cpp" header_extension=".h">
- <object class="MainDialog" name="dialog_principal" base="EditDialog">
+ <object class="MetadataDialog" name="dialog_principal" base="EditDialog">
<style>wxDEFAULT_DIALOG_STYLE</style>
<title>Metadata</title>
<size>800, 470</size>
=== modified file 'src/cdg_main.py'
--- src/cdg_main.py 2012-07-27 22:12:44 +0000
+++ src/cdg_main.py 2012-07-27 23:27:36 +0000
@@ -21,112 +21,9 @@
# end wxGlade
-
-class ConfigDialog(wx.Dialog):
- def __init__(self, *args, **kwds):
- # begin wxGlade: ConfigDialog.__init__
- kwds["style"] = wx.DEFAULT_DIALOG_STYLE
- wx.Dialog.__init__(self, *args, **kwds)
- self.text_ctrl_workspace = wx.TextCtrl(self, -1, "")
- self.sizer_9_staticbox = wx.StaticBox(self, -1, "Workspace path:")
- self.text_ctrl_autosave = wx.TextCtrl(self, -1, "")
- self.sizer_12_staticbox = wx.StaticBox(self, -1, "Autosave timer: ")
- self.button_2 = wx.Button(self, wx.ID_CANCEL, "")
- self.button_1 = wx.Button(self, wx.ID_OK, "")
-
- self.__set_properties()
- self.__do_layout()
- # end wxGlade
- self.init_things()
-
- def __set_properties(self):
- # begin wxGlade: ConfigDialog.__set_properties
- self.SetTitle("Configuration")
- self.SetSize((596, 158))
- self.text_ctrl_autosave.SetMinSize((110, 27))
- # end wxGlade
-
- def __do_layout(self):
- # begin wxGlade: ConfigDialog.__do_layout
- sizer_main = wx.BoxSizer(wx.VERTICAL)
- sizer_10 = wx.BoxSizer(wx.HORIZONTAL)
- sizer_11 = wx.BoxSizer(wx.HORIZONTAL)
- self.sizer_12_staticbox.Lower()
- sizer_12 = wx.StaticBoxSizer(self.sizer_12_staticbox, wx.HORIZONTAL)
- sizer_2 = wx.BoxSizer(wx.HORIZONTAL)
- self.sizer_9_staticbox.Lower()
- sizer_9 = wx.StaticBoxSizer(self.sizer_9_staticbox, wx.HORIZONTAL)
- sizer_9.Add(self.text_ctrl_workspace, 1, 0, 0)
- sizer_2.Add(sizer_9, 1, wx.EXPAND, 7)
- sizer_main.Add(sizer_2, 1, wx.EXPAND, 0)
- sizer_12.Add(self.text_ctrl_autosave, 0, 0, 0)
- sizer_11.Add(sizer_12, 0, wx.EXPAND, 0)
- sizer_11.Add((20, 20), 1, wx.EXPAND, 0)
- sizer_main.Add(sizer_11, 1, wx.EXPAND, 0)
- sizer_10.Add((20, 20), 1, 0, 0)
- sizer_10.Add(self.button_2, 0, wx.ALIGN_CENTER_VERTICAL, 0)
- sizer_10.Add((20, 20), 0, 0, 0)
- sizer_10.Add(self.button_1, 0, wx.ALIGN_CENTER_VERTICAL, 0)
- sizer_main.Add(sizer_10, 1, wx.EXPAND, 0)
- self.SetSizer(sizer_main)
- self.Layout()
- # end wxGlade
-
- def init_things(self):
- self.init_config()
- self.read_config()
-
- def init_config(self):
- if sys.platform.startswith('linux'):
- home = os.environ['HOME']
- elif sys.platform.startswith('win'):
- home = os.environ['HOMEDRIVE'] + '/' +os.environ['HOMEPATH']
-
- else:
- home = './'
- self.configdir = home + '/.mlhim'
- self.configname = self.configdir + '/' + 'cdg.cfg'
-
- self.config = ConfigParser.SafeConfigParser({
- 'autosave' : '300',
- 'workspace' : home + '/' + 'MLHIM2'
- })
-
- def read_config(self):
- try:
- if not self.config.read(self.configname):
- self.make_config_dir()
- except:
- self.save_config()
- self.set_panel_configs()
-
-
- def make_config_dir(self):
- if not os.path.exists(self.configdir):
- os.mkdir(self.configdir)
- # with open(self.configname, 'wb') as configfile:
- # self.config.write(configfile)
-
- def save_config(self):
- self.get_panel_configs()
- with open(self.configname, 'wb') as configfile:
- configfile.write('# Concept Definition Designer Configuration\n# Do not edit the text to the left of the equal symbol (=)\n\n')
- self.config.write(configfile)
-
-
- def get_panel_configs(self):
- self.config.set('DEFAULT', 'autosave', self.text_ctrl_autosave.GetValue().encode('utf8'))
- self.config.set('DEFAULT', 'workspace', self.text_ctrl_workspace.GetValue().encode('utf8'))
-
- def set_panel_configs(self):
- self.text_ctrl_autosave.SetValue(self.config.get('DEFAULT', 'autosave'))
- self.text_ctrl_workspace.SetValue(self.config.get('DEFAULT', 'workspace'))
-
-# end of class ConfigDialog
-
-class MainDialog(wx.Dialog):
- def __init__(self, *args, **kwds):
- # begin wxGlade: MainDialog.__init__
+class MetadataDialog(wx.Dialog):
+ def __init__(self, *args, **kwds):
+ # begin wxGlade: MetadataDialog.__init__
kwds["style"] = wx.DEFAULT_DIALOG_STYLE
wx.Dialog.__init__(self, *args, **kwds)
self.label_title = wx.StaticText(self, -1, "* Title: ", style=wx.ALIGN_CENTRE)
@@ -161,11 +58,10 @@
self.__set_properties()
self.__do_layout()
# end wxGlade
-
self.init_things()
def __set_properties(self):
- # begin wxGlade: MainDialog.__set_properties
+ # begin wxGlade: MetadataDialog.__set_properties
self.SetTitle("Metadata")
self.SetSize((800, 470))
self.label_date.SetToolTipString("Defalts to current day.")
@@ -181,7 +77,7 @@
# end wxGlade
def __do_layout(self):
- # begin wxGlade: MainDialog.__do_layout
+ # begin wxGlade: MetadataDialog.__do_layout
sizer_vertical = wx.BoxSizer(wx.HORIZONTAL)
sizer_3 = wx.BoxSizer(wx.VERTICAL)
sizer_2_copy = wx.BoxSizer(wx.HORIZONTAL)
@@ -244,15 +140,195 @@
self.Layout()
# end wxGlade
-
- def init_things(self):
- self.config = Config(self)
- self.config.read_config()
- self.config.set_panel_configs()
- #self.button_save_config.Disable()
- #self.Bind(wx.EVT_CLOSE, self.on_close_window)
-
-# end of class MainDialog
+ def init_things(self):
+ self.init_config()
+ self.read_config()
+
+ def init_config(self):
+ if sys.platform.startswith('linux'):
+ home = os.environ['HOME']
+ elif sys.platform.startswith('win'):
+ home = os.environ['HOMEDRIVE'] + '/' +os.environ['HOMEPATH']
+
+ else:
+ home = './'
+ self.configdir = home + '/.mlhim'
+ self.configname = self.configdir + '/' + 'metadata.cfg'
+
+ self.config = ConfigParser.SafeConfigParser({
+ 'title' : '',
+ 'description' : '',
+ 'creator' : '',
+ 'creator_email' : '',
+ 'contributor' : '',
+ 'publisher' : '',
+ 'subject' : '',
+ 'source' : '',
+ 'rights' : 'CC-BY http://creativecommons.org/licenses/by/3.0/',
+ 'relation' : 'None',
+ 'coverage' : 'Universal',
+ 'language' : '76',
+ 'choice_definition' : '0',
+ })
+
+ def read_config(self):
+ try:
+ if not self.config.read(self.configname):
+ self.make_config_dir()
+ except:
+ self.save_config()
+ self.set_panel_configs()
+
+
+ def make_config_dir(self):
+ if not os.path.exists(self.configdir):
+ os.mkdir(self.configdir)
+ # with open(self.configname, 'wb') as configfile:
+ # self.config.write(configfile)
+
+ def save_config(self):
+ self.get_panel_configs()
+ with open(self.configname, 'wb') as configfile:
+ configfile.write('# Concept Definition Designer Configuration\n# Do not edit the text to the left of the equal symbol (=)\n\n')
+ self.config.write(configfile)
+
+
+ def get_panel_configs(self):
+ self.config.set('DEFAULT', 'title', self.text_ctrl_title.GetValue().encode('utf8'))
+ self.config.set('DEFAULT', 'description', self.text_ctrl_description.GetValue().encode('utf8'))
+ self.config.set('DEFAULT', 'creator', self.text_ctrl_creator.GetValue().encode('utf8'))
+ self.config.set('DEFAULT', 'creator_email', self.text_ctrl_creator_email.GetValue().encode('utf8'))
+ self.config.set('DEFAULT', 'contributor', self.text_ctrl_contributors.GetValue().encode('utf8'))
+
+ self.config.set('DEFAULT', 'publisher', self.text_ctrl_publisher.GetValue().encode('utf8'))
+ self.config.set('DEFAULT', 'subject', self.text_ctrl_subject.GetValue().encode('utf8'))
+ self.config.set('DEFAULT', 'source', self.text_ctrl_source.GetValue().encode('utf8'))
+ self.config.set('DEFAULT', 'rights', self.text_ctrl_rights.GetValue().encode('utf8'))
+ self.config.set('DEFAULT', 'relation', self.text_ctrl_relation.GetValue().encode('utf8'))
+ self.config.set('DEFAULT', 'coverage', self.text_ctrl_coverage.GetValue().encode('utf8'))
+
+ self.config.set('DEFAULT', 'language', str(self.choice_lang.GetSelection()))
+
+ def set_panel_configs(self):
+ self.text_ctrl_title.SetValue(self.config.get('DEFAULT', 'title'))
+ self.text_ctrl_description.SetValue(self.config.get('DEFAULT', 'description'))
+ self.text_ctrl_creator.SetValue(self.config.get('DEFAULT', 'creator'))
+ self.text_ctrl_creator_email.SetValue(self.config.get('DEFAULT', 'creator_email'))
+ self.text_ctrl_contributors.SetValue(self.config.get('DEFAULT', 'contributor'))
+
+ self.text_ctrl_publisher.SetValue(self.config.get('DEFAULT', 'publisher'))
+ self.text_ctrl_subject.SetValue(self.config.get('DEFAULT', 'subject'))
+ self.text_ctrl_source.SetValue(self.config.get('DEFAULT', 'source'))
+ self.text_ctrl_rights.SetValue(self.config.get('DEFAULT', 'rights'))
+ self.text_ctrl_relation.SetValue(self.config.get('DEFAULT', 'relation'))
+ self.text_ctrl_coverage.SetValue(self.config.get('DEFAULT', 'coverage'))
+
+ self.choice_lang.SetSelection(int(self.config.get('DEFAULT', 'language')))
+
+
+# end of class MetadataDialog
+
+class ConfigDialog(wx.Dialog):
+ def __init__(self, *args, **kwds):
+ # begin wxGlade: ConfigDialog.__init__
+ kwds["style"] = wx.DEFAULT_DIALOG_STYLE
+ wx.Dialog.__init__(self, *args, **kwds)
+ self.text_ctrl_workspace = wx.TextCtrl(self, -1, "")
+ self.sizer_9_staticbox = wx.StaticBox(self, -1, "Workspace path:")
+ self.text_ctrl_autosave = wx.TextCtrl(self, -1, "")
+ self.sizer_12_staticbox = wx.StaticBox(self, -1, "Autosave timer: ")
+ self.button_2 = wx.Button(self, wx.ID_CANCEL, "")
+ self.button_1 = wx.Button(self, wx.ID_OK, "")
+
+ self.__set_properties()
+ self.__do_layout()
+ # end wxGlade
+ self.init_things()
+
+ def __set_properties(self):
+ # begin wxGlade: ConfigDialog.__set_properties
+ self.SetTitle("Configuration")
+ self.SetSize((596, 158))
+ self.text_ctrl_autosave.SetMinSize((110, 27))
+ # end wxGlade
+
+ def __do_layout(self):
+ # begin wxGlade: ConfigDialog.__do_layout
+ sizer_main = wx.BoxSizer(wx.VERTICAL)
+ sizer_10 = wx.BoxSizer(wx.HORIZONTAL)
+ sizer_11 = wx.BoxSizer(wx.HORIZONTAL)
+ self.sizer_12_staticbox.Lower()
+ sizer_12 = wx.StaticBoxSizer(self.sizer_12_staticbox, wx.HORIZONTAL)
+ sizer_2 = wx.BoxSizer(wx.HORIZONTAL)
+ self.sizer_9_staticbox.Lower()
+ sizer_9 = wx.StaticBoxSizer(self.sizer_9_staticbox, wx.HORIZONTAL)
+ sizer_9.Add(self.text_ctrl_workspace, 1, 0, 0)
+ sizer_2.Add(sizer_9, 1, wx.EXPAND, 7)
+ sizer_main.Add(sizer_2, 1, wx.EXPAND, 0)
+ sizer_12.Add(self.text_ctrl_autosave, 0, 0, 0)
+ sizer_11.Add(sizer_12, 0, wx.EXPAND, 0)
+ sizer_11.Add((20, 20), 1, wx.EXPAND, 0)
+ sizer_main.Add(sizer_11, 1, wx.EXPAND, 0)
+ sizer_10.Add((20, 20), 1, 0, 0)
+ sizer_10.Add(self.button_2, 0, wx.ALIGN_CENTER_VERTICAL, 0)
+ sizer_10.Add((20, 20), 0, 0, 0)
+ sizer_10.Add(self.button_1, 0, wx.ALIGN_CENTER_VERTICAL, 0)
+ sizer_main.Add(sizer_10, 1, wx.EXPAND, 0)
+ self.SetSizer(sizer_main)
+ self.Layout()
+ # end wxGlade
+
+ def init_things(self):
+ self.init_config()
+ self.read_config()
+
+ def init_config(self):
+ if sys.platform.startswith('linux'):
+ home = os.environ['HOME']
+ elif sys.platform.startswith('win'):
+ home = os.environ['HOMEDRIVE'] + '/' +os.environ['HOMEPATH']
+
+ else:
+ home = './'
+ self.configdir = home + '/.mlhim'
+ self.configname = self.configdir + '/' + 'cdg.cfg'
+
+ self.config = ConfigParser.SafeConfigParser({
+ 'autosave' : '300',
+ 'workspace' : home + '/' + 'MLHIM2'
+ })
+
+ def read_config(self):
+ try:
+ if not self.config.read(self.configname):
+ self.make_config_dir()
+ except:
+ self.save_config()
+ self.set_panel_configs()
+
+
+ def make_config_dir(self):
+ if not os.path.exists(self.configdir):
+ os.mkdir(self.configdir)
+ # with open(self.configname, 'wb') as configfile:
+ # self.config.write(configfile)
+
+ def save_config(self):
+ self.get_panel_configs()
+ with open(self.configname, 'wb') as configfile:
+ configfile.write('# Concept Definition Designer Configuration\n# Do not edit the text to the left of the equal symbol (=)\n\n')
+ self.config.write(configfile)
+
+
+ def get_panel_configs(self):
+ self.config.set('DEFAULT', 'autosave', self.text_ctrl_autosave.GetValue().encode('utf8'))
+ self.config.set('DEFAULT', 'workspace', self.text_ctrl_workspace.GetValue().encode('utf8'))
+
+ def set_panel_configs(self):
+ self.text_ctrl_autosave.SetValue(self.config.get('DEFAULT', 'autosave'))
+ self.text_ctrl_workspace.SetValue(self.config.get('DEFAULT', 'workspace'))
+
+# end of class ConfigDialog
class Info(object):
@@ -395,87 +471,28 @@
f.close()
-class Config(object):
- def __init__(self, panel):
- if sys.platform.startswith('linux'):
- home = os.environ['HOME']
- elif sys.platform.startswith('win'):
- home = os.environ['HOMEDRIVE'] + '/' +os.environ['HOMEPATH']
-
- else:
- home = './'
- self.configdir = home + '/.mlhim'
- self.configname = self.configdir + '/' + 'metadata.cfg'
- self.panel = panel
-
- self.config = ConfigParser.SafeConfigParser({
- 'title' : '',
- 'description' : '',
- 'creator' : '',
- 'creator_email' : '',
- 'contributor' : '',
- 'publisher' : '',
- 'subject' : '',
- 'source' : '',
- 'rights' : 'CC-BY http://creativecommons.org/licenses/by/3.0/',
- 'relation' : 'None',
- 'coverage' : 'Universal',
- 'language' : '76',
- 'choice_definition' : '0',
- })
-
- def read_config(self):
- try:
- if not self.config.read(self.configname):
- self.make_config()
- except:
- self.save_config()
-
-
- def make_config(self):
- if not os.path.exists(self.configdir):
- os.mkdir(self.configdir)
- # with open(self.configname, 'wb') as configfile:
- # self.config.write(configfile)
-
- def save_config(self):
- with open(self.configname, 'wb') as configfile:
- configfile.write('# CDD Metadata Configuration\n# Do not edit the text to the left of the equal symbol (=)\n\n')
- self.config.write(configfile)
-
-
- def get_panel_configs(self):
- self.config.set('DEFAULT', 'title', self.panel.text_ctrl_title.GetValue().encode('utf8'))
- self.config.set('DEFAULT', 'description', self.panel.text_ctrl_description.GetValue().encode('utf8'))
- self.config.set('DEFAULT', 'creator', self.panel.text_ctrl_creator.GetValue().encode('utf8'))
- self.config.set('DEFAULT', 'creator_email', self.panel.text_ctrl_creator_email.GetValue().encode('utf8'))
- self.config.set('DEFAULT', 'contributor', self.panel.text_ctrl_contributors.GetValue().encode('utf8'))
-
- self.config.set('DEFAULT', 'publisher', self.panel.text_ctrl_publisher.GetValue().encode('utf8'))
- self.config.set('DEFAULT', 'subject', self.panel.text_ctrl_subject.GetValue().encode('utf8'))
- self.config.set('DEFAULT', 'source', self.panel.text_ctrl_source.GetValue().encode('utf8'))
- self.config.set('DEFAULT', 'rights', self.panel.text_ctrl_rights.GetValue().encode('utf8'))
- self.config.set('DEFAULT', 'relation', self.panel.text_ctrl_relation.GetValue().encode('utf8'))
- self.config.set('DEFAULT', 'coverage', self.panel.text_ctrl_coverage.GetValue().encode('utf8'))
-
- self.config.set('DEFAULT', 'language', str(self.panel.choice_lang.GetSelection()))
-
- def set_panel_configs(self):
- self.panel.text_ctrl_title.SetValue(self.config.get('DEFAULT', 'title'))
- self.panel.text_ctrl_description.SetValue(self.config.get('DEFAULT', 'description'))
- self.panel.text_ctrl_creator.SetValue(self.config.get('DEFAULT', 'creator'))
- self.panel.text_ctrl_creator_email.SetValue(self.config.get('DEFAULT', 'creator_email'))
- self.panel.text_ctrl_contributors.SetValue(self.config.get('DEFAULT', 'contributor'))
-
- self.panel.text_ctrl_publisher.SetValue(self.config.get('DEFAULT', 'publisher'))
- self.panel.text_ctrl_subject.SetValue(self.config.get('DEFAULT', 'subject'))
- self.panel.text_ctrl_source.SetValue(self.config.get('DEFAULT', 'source'))
- self.panel.text_ctrl_rights.SetValue(self.config.get('DEFAULT', 'rights'))
- self.panel.text_ctrl_relation.SetValue(self.config.get('DEFAULT', 'relation'))
- self.panel.text_ctrl_coverage.SetValue(self.config.get('DEFAULT', 'coverage'))
-
- self.panel.choice_lang.SetSelection(int(self.config.get('DEFAULT', 'language')))
-
+
+ # Gets info from the metadata panel. Depends on class metadata specifics
+ def get_meta_info(self, panel):
+ title = panel.text_ctrl_title.GetValue().encode('utf8')
+ description = panel.text_ctrl_description.GetValue().encode('utf8')
+ creator = panel.text_ctrl_creator.GetValue().encode('utf8')
+ creator_email = panel.text_ctrl_creator_email.GetValue().encode('utf8')
+ contributor = panel.text_ctrl_contributors.GetValue().encode('utf8')
+
+ publisher = panel.text_ctrl_publisher.GetValue().encode('utf8')
+ subject = panel.text_ctrl_subject.GetValue().encode('utf8')
+ source = panel.text_ctrl_source.GetValue().encode('utf8')
+ rights = panel.text_ctrl_rights.GetValue().encode('utf8')
+ relation = panel.text_ctrl_relation.GetValue().encode('utf8')
+ coverage = panel.text_ctrl_coverage.GetValue().encode('utf8')
+
+ language = panel.choice_lang.GetStringSelection()
+
+ tempo = panel.datepicker_ctrl_date.GetValue()
+ date = '{Y}-{M}-{D:02}'.format(Y=tempo.GetYear(), M=tempo.GetMonth(), D=tempo.GetDay())
+
+ self.get_info(title, description, date, creator, creator_email, contributor, language, publisher, subject, source, rights, relation, coverage)
###########################################################################
@@ -533,29 +550,3 @@
else:
return False
-def extract_info(self, info):
- title = self.text_ctrl_title.GetValue().encode('utf8')
- description = self.text_ctrl_description.GetValue().encode('utf8')
- creator = self.text_ctrl_creator.GetValue().encode('utf8')
- creator_email = self.text_ctrl_creator_email.GetValue().encode('utf8')
- contributor = self.text_ctrl_contributors.GetValue().encode('utf8')
-
- publisher = self.text_ctrl_publisher.GetValue().encode('utf8')
- subject = self.text_ctrl_subject.GetValue().encode('utf8')
- source = self.text_ctrl_source.GetValue().encode('utf8')
- rights = self.text_ctrl_rights.GetValue().encode('utf8')
- relation = self.text_ctrl_relation.GetValue().encode('utf8')
- coverage = self.text_ctrl_coverage.GetValue().encode('utf8')
-
- language = self.choice_lang.GetStringSelection()
-
- tempo = self.datepicker_ctrl_date.GetValue()
- date = '{Y}-{M}-{D:02}'.format(Y=tempo.GetYear(), M=tempo.GetMonth(), D=tempo.GetDay())
-
- info.get_info(title, description, date, creator, creator_email, contributor, language, publisher, subject, source, rights, relation, coverage)
- # # Test if the mandatary fields are with something
- # if not (title and date and description and creator and subject and rights):
- # popup_message(self, 'The options marker with a "*" are mandatory. Please fill them before generating a CCD file.', 'Error', wx.OK|wx.ICON_EXCLAMATION)
- # return False
- # return True
- ################################################
=== modified file 'src/mlhim2.py'
--- src/mlhim2.py 2012-07-20 00:25:17 +0000
+++ src/mlhim2.py 2012-07-27 23:27:36 +0000
@@ -15,7 +15,7 @@
_ = gettext.gettext
# form for entering metadata.
-class Metadata(cdg_main.MainDialog):
+class Metadata(cdg_main.MetadataDialog):
pass