mlhim-specs-dev team mailing list archive
-
mlhim-specs-dev team
-
Mailing list archive
-
Message #00552
[Branch ~cdd-dev/cdd/trunk] Rev 147: Added the CDG code from Eduardo César.
------------------------------------------------------------
revno: 147
committer: Timothy W. Cook <timothywayne.cook@xxxxxxxxx>
branch nick: cdd
timestamp: Mon 2012-07-02 14:23:35 -0300
message:
Added the CDG code from Eduardo César.
removed:
abstract.png
added:
Generator/
Generator/README.txt
Generator/cdg/
Generator/cdg/MainFrame.py
Generator/cdg/__main__.py@
Generator/cdg/app.py
Generator/cdg/cdg_custom.py
Generator/cdg/cdg_extra.py
Generator/cdg/logo.png
Generator/cdg_wxglade.wxg
Generator/make_zip
Generator/windows/
Generator/windows/setup_single_exe.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
=== added directory 'Generator'
=== added file 'Generator/README.txt'
--- Generator/README.txt 1970-01-01 00:00:00 +0000
+++ Generator/README.txt 2012-07-02 17:23:35 +0000
@@ -0,0 +1,7 @@
+To build the application just type:
+
+source make_zip
+
+This will build the zip file that can be executed by python2.6 onwards.
+
+
=== added directory 'Generator/cdg'
=== added file 'Generator/cdg/MainFrame.py'
--- Generator/cdg/MainFrame.py 1970-01-01 00:00:00 +0000
+++ Generator/cdg/MainFrame.py 2012-07-02 17:23:35 +0000
@@ -0,0 +1,193 @@
+# -*- coding: utf-8 -*-
+# generated by wxGlade 0.6.4 on Sun Jun 24 18:01:19 2012
+
+import wx
+import cdg_extra
+import cdg_custom
+
+# begin wxGlade: dependencies
+# end wxGlade
+
+# begin wxGlade: extracode
+
+# end wxGlade
+
+
+class MainFrame(wx.Frame):
+ def __init__(self, *args, **kwds):
+ # begin wxGlade: MainFrame.__init__
+ kwds["style"] = wx.DEFAULT_FRAME_STYLE
+ wx.Frame.__init__(self, *args, **kwds)
+ self.panel_principal = wx.Panel(self, -1)
+ self.label_title = wx.StaticText(self.panel_principal, -1, "Title: ", style=wx.ALIGN_CENTRE)
+ self.text_ctrl_title = wx.TextCtrl(self.panel_principal, -1, "")
+ self.label_date = wx.StaticText(self.panel_principal, -1, "Date :")
+ self.datepicker_ctrl_date = wx.DatePickerCtrl(self.panel_principal, -1)
+ self.label_description = wx.StaticText(self.panel_principal, -1, "Description: ")
+ self.text_ctrl_description = wx.TextCtrl(self.panel_principal, -1, "", style=wx.TE_MULTILINE)
+ self.label_language = wx.StaticText(self.panel_principal, -1, "Language: ")
+ self.choice_lang = wx.Choice(self.panel_principal, -1, choices=[])
+ self.label_creator = wx.StaticText(self.panel_principal, -1, "Creator: ")
+ self.text_ctrl_creator = wx.TextCtrl(self.panel_principal, -1, "")
+ self.label_publisher = wx.StaticText(self.panel_principal, -1, "Publisher: ")
+ self.text_ctrl_publisher = wx.TextCtrl(self.panel_principal, -1, "")
+ self.label_subject = wx.StaticText(self.panel_principal, -1, "Subject: ")
+ self.text_ctrl_subject = wx.TextCtrl(self.panel_principal, -1, "")
+ self.label_source = wx.StaticText(self.panel_principal, -1, "Source: ")
+ self.text_ctrl_source = wx.TextCtrl(self.panel_principal, -1, "")
+ self.label_rights = wx.StaticText(self.panel_principal, -1, "Rights: ")
+ self.text_ctrl_rights = wx.TextCtrl(self.panel_principal, -1, "")
+ self.label_relation = wx.StaticText(self.panel_principal, -1, "Relation: ")
+ self.text_ctrl_relation = wx.TextCtrl(self.panel_principal, -1, "")
+ self.label_coverage = wx.StaticText(self.panel_principal, -1, "Coverage: ")
+ self.text_ctrl_coverage = wx.TextCtrl(self.panel_principal, -1, "")
+ self.label_contributors = wx.StaticText(self.panel_principal, -1, "Contributors: ")
+ self.text_ctrl_contributors = wx.TextCtrl(self.panel_principal, -1, "")
+ self.label_ccd_definition = wx.StaticText(self.panel_principal, -1, "CCD definition class: ")
+ self.combo_box_ccd = wx.ComboBox(self.panel_principal, -1, choices=["CareEntryType", "AdminEntryType", "DemographicEntryType", "ClusterType", "ElementType", "SlotType"], style=wx.CB_DROPDOWN | wx.CB_SIMPLE | wx.CB_DROPDOWN | wx.CB_READONLY)
+ self.button_about = wx.Button(self.panel_principal, -1, "&About")
+ self.button_help = wx.Button(self.panel_principal, wx.ID_HELP, "")
+ self.button_generate = wx.Button(self.panel_principal, -1, "&Generate")
+
+ self.__set_properties()
+ self.__do_layout()
+
+ self.Bind(wx.EVT_BUTTON, self.about, self.button_about)
+ self.Bind(wx.EVT_BUTTON, self.help, self.button_help)
+ self.Bind(wx.EVT_BUTTON, self.generate, self.button_generate)
+ # end wxGlade
+
+ cdg_extra.set_icon(self)
+
+ def __set_properties(self):
+ # begin wxGlade: MainFrame.__set_properties
+ self.SetTitle("Constraint Definition Generator")
+ self.SetSize((800, 470))
+ self.label_date.SetToolTipString("Defalts to current day.")
+ self.datepicker_ctrl_date.SetMinSize((105, 28))
+ self.choice_lang.SetItems(cdg_extra.get_lang_list())
+ self.choice_lang.SetSelection(cdg_extra.get_lang_list().index('en-US') | 0)
+ self.label_creator.SetToolTipString("Format emails as: Timothy W. Cook <timothywayne.cook@xxxxxxxxx>")
+ self.text_ctrl_creator.SetToolTipString("Format emails as: Timothy W. Cook <timothywayne.cook@xxxxxxxxx>")
+ self.text_ctrl_publisher.SetToolTipString("Format emails as: Timothy W. Cook <timothywayne.cook@xxxxxxxxx>")
+ self.text_ctrl_subject.SetToolTipString("Format emails as: Timothy W. Cook <timothywayne.cook@xxxxxxxxx>")
+ self.label_contributors.SetToolTipString("Separate multiple contributors with a semi-colon and format them as:Eduardo Cesar <xcesar@xxxxxxxxx>; Luciana Cavalini <lutricav@xxxxxxxxx>")
+ self.text_ctrl_contributors.SetToolTipString("Separate multiple contributors with a semi-colon and format them as:Eduardo Cesar <xcesar@xxxxxxxxx>; Luciana Cavalini <lutricav@xxxxxxxxx>")
+ self.combo_box_ccd.SetSelection(0)
+ # end wxGlade
+
+ def __do_layout(self):
+ # begin wxGlade: MainFrame.__do_layout
+ sizer_principal = wx.BoxSizer(wx.VERTICAL)
+ sizer_vertical = wx.BoxSizer(wx.HORIZONTAL)
+ sizer_3 = wx.BoxSizer(wx.VERTICAL)
+ sizer_2_copy = wx.BoxSizer(wx.HORIZONTAL)
+ sizer_2 = wx.BoxSizer(wx.HORIZONTAL)
+ sizer_1 = wx.BoxSizer(wx.HORIZONTAL)
+ sizer_8 = wx.BoxSizer(wx.HORIZONTAL)
+ sizer_7 = wx.BoxSizer(wx.HORIZONTAL)
+ sizer_6 = wx.BoxSizer(wx.HORIZONTAL)
+ sizer_5 = wx.BoxSizer(wx.HORIZONTAL)
+ sizer_4 = wx.BoxSizer(wx.HORIZONTAL)
+ sizer_vertical.Add((20, 20), 0, 0, 0)
+ sizer_3.Add((20, 20), 0, 0, 0)
+ sizer_4.Add(self.label_title, 0, wx.ALIGN_CENTER_VERTICAL, 1)
+ sizer_4.Add(self.text_ctrl_title, 1, wx.ALIGN_CENTER_VERTICAL, 1)
+ sizer_4.Add((20, 20), 0, 0, 0)
+ sizer_4.Add(self.label_date, 0, wx.ALIGN_CENTER_VERTICAL, 0)
+ sizer_4.Add(self.datepicker_ctrl_date, 0, wx.ALIGN_CENTER_VERTICAL, 0)
+ sizer_3.Add(sizer_4, 1, wx.ALL | wx.EXPAND, 1)
+ sizer_5.Add(self.label_description, 0, wx.ALIGN_CENTER_VERTICAL, 0)
+ sizer_5.Add(self.text_ctrl_description, 1, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 0)
+ sizer_5.Add((20, 20), 0, 0, 0)
+ sizer_5.Add(self.label_language, 0, wx.ALIGN_CENTER_VERTICAL, 0)
+ sizer_5.Add(self.choice_lang, 0, wx.ALIGN_CENTER_VERTICAL, 0)
+ sizer_3.Add(sizer_5, 1, wx.EXPAND, 0)
+ sizer_6.Add(self.label_creator, 0, wx.ALIGN_CENTER_VERTICAL, 0)
+ sizer_6.Add(self.text_ctrl_creator, 1, wx.ALIGN_CENTER_VERTICAL, 1)
+ sizer_6.Add((20, 20), 0, 0, 0)
+ sizer_6.Add(self.label_publisher, 0, wx.ALIGN_CENTER_VERTICAL, 0)
+ sizer_6.Add(self.text_ctrl_publisher, 1, wx.ALIGN_CENTER_VERTICAL, 1)
+ sizer_6.Add((20, 20), 0, 0, 0)
+ sizer_6.Add(self.label_subject, 0, wx.ALIGN_CENTER_VERTICAL, 0)
+ sizer_6.Add(self.text_ctrl_subject, 1, wx.ALIGN_CENTER_VERTICAL, 1)
+ sizer_3.Add(sizer_6, 1, wx.EXPAND, 0)
+ sizer_7.Add(self.label_source, 0, wx.ALIGN_CENTER_VERTICAL, 0)
+ sizer_7.Add(self.text_ctrl_source, 1, wx.ALIGN_CENTER_VERTICAL, 1)
+ sizer_7.Add((20, 20), 0, 0, 0)
+ sizer_7.Add(self.label_rights, 0, wx.ALIGN_CENTER_VERTICAL, 0)
+ sizer_7.Add(self.text_ctrl_rights, 1, wx.ALIGN_CENTER_VERTICAL, 1)
+ sizer_3.Add(sizer_7, 1, wx.EXPAND, 0)
+ sizer_8.Add(self.label_relation, 0, wx.ALIGN_CENTER_VERTICAL, 0)
+ sizer_8.Add(self.text_ctrl_relation, 1, wx.ALIGN_CENTER_VERTICAL, 1)
+ sizer_8.Add((20, 20), 0, 0, 0)
+ sizer_8.Add(self.label_coverage, 0, wx.ALIGN_CENTER_VERTICAL, 0)
+ sizer_8.Add(self.text_ctrl_coverage, 1, wx.ALIGN_CENTER_VERTICAL, 1)
+ sizer_3.Add(sizer_8, 1, wx.EXPAND, 0)
+ sizer_1.Add(self.label_contributors, 0, wx.ALIGN_CENTER_VERTICAL, 0)
+ sizer_1.Add(self.text_ctrl_contributors, 1, wx.ALIGN_CENTER_VERTICAL, 1)
+ sizer_3.Add(sizer_1, 1, wx.EXPAND, 0)
+ sizer_2.Add(self.label_ccd_definition, 0, wx.ALIGN_CENTER_VERTICAL, 0)
+ sizer_2.Add(self.combo_box_ccd, 0, wx.ALIGN_CENTER_VERTICAL, 0)
+ sizer_3.Add(sizer_2, 1, wx.EXPAND, 0)
+ sizer_2_copy.Add(self.button_about, 0, wx.ALIGN_BOTTOM, 0)
+ sizer_2_copy.Add((20, 20), 1, wx.EXPAND, 1)
+ sizer_2_copy.Add((20, 20), 0, 0, 0)
+ sizer_2_copy.Add(self.button_help, 0, wx.ALIGN_BOTTOM, 0)
+ sizer_2_copy.Add((20, 20), 0, 0, 0)
+ sizer_2_copy.Add(self.button_generate, 0, wx.ALIGN_RIGHT | wx.ALIGN_BOTTOM | wx.ALIGN_CENTER_VERTICAL, 1)
+ sizer_3.Add(sizer_2_copy, 1, wx.EXPAND, 0)
+ sizer_3.Add((20, 20), 0, 0, 0)
+ sizer_vertical.Add(sizer_3, 1, wx.EXPAND, 0)
+ sizer_vertical.Add((20, 20), 0, 0, 0)
+ self.panel_principal.SetSizer(sizer_vertical)
+ sizer_principal.Add(self.panel_principal, 1, wx.EXPAND, 0)
+ self.SetSizer(sizer_principal)
+ self.Layout()
+ self.Centre()
+ # end wxGlade
+
+ def generate(self, event): # wxGlade: MainFrame.<event_handler>
+
+ # Get the path
+ path = cdg_extra.get_path(self)
+ if not path:
+ return
+
+ title = self.text_ctrl_title.GetValue().encode('utf8')
+ description = self.text_ctrl_description.GetValue().encode('utf8')
+ creator = self.text_ctrl_creator.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()
+ choice_definition = self.combo_box_ccd.GetStringSelection()
+
+ tempo = self.datepicker_ctrl_date.GetValue()
+ date = '{Y}-{M}-{D:02}'.format(Y=tempo.GetYear(), M=tempo.GetMonth(), D=tempo.GetDay())
+
+ # Call the writing routine
+ ccd_id = cdg_custom.generate_files(path, title, description, date, creator, contributor, language, publisher, subject, source, rights, relation, coverage, choice_definition)
+
+
+ # Show dialog
+ cdg_extra.wrote_diag(self, ccd_id)
+
+
+ def about(self, event): # wxGlade: MainFrame.<event_handler>
+ cdg_extra.about_box(self)
+
+ def help(self, event): # wxGlade: MainFrame.<event_handler>
+ cdg_extra.help_box(self)
+
+ def choice(self, event): # wxGlade: MainFrame.<event_handler>
+ pass
+ #self.choice_text = self.choice_ccd.GetStringSelection()
+
+# end of class MainFrame
=== added symlink 'Generator/cdg/__main__.py'
=== target is u'app.py'
=== added file 'Generator/cdg/app.py'
--- Generator/cdg/app.py 1970-01-01 00:00:00 +0000
+++ Generator/cdg/app.py 2012-07-02 17:23:35 +0000
@@ -0,0 +1,17 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+# generated by wxGlade 0.6.4 on Sun Jun 24 18:01:19 2012
+"""
+Concept Definition Generator - MLHIM CDD project.
+Version 1.0
+"""
+import wx
+from MainFrame import MainFrame
+
+if __name__ == "__main__":
+ app = wx.PySimpleApp(0)
+ wx.InitAllImageHandlers()
+ frame_principal = MainFrame(None, -1, "")
+ app.SetTopWindow(frame_principal)
+ frame_principal.Show()
+ app.MainLoop()
=== added file 'Generator/cdg/cdg_custom.py'
--- Generator/cdg/cdg_custom.py 1970-01-01 00:00:00 +0000
+++ Generator/cdg/cdg_custom.py 2012-07-02 17:23:35 +0000
@@ -0,0 +1,127 @@
+import os
+import uuid
+from xml.sax.saxutils import escape
+
+def generate_files(path, title, description, date, creator, contributor, language, publisher, subject, source, rights, relation, coverage, choice_definition):
+
+ ccd_id = "ccd_"+str(uuid.uuid4()).replace('-','_')
+ UUID_definition = "ct_"+str(uuid.uuid4()).replace('-','_')
+ UUID_string = "ct_"+str(uuid.uuid4()).replace('-','_')
+
+ schema = ccd_id + ".xsd"
+
+ contributors_formated = '<dc:contributor>' + \
+ '</dc:contributor>\n<dc:contributor>'.join([ escape(i).strip() for i in contributor.split(';')]) + \
+ '</dc:contributor>'
+
+ f = open(path+'/'+schema,'w')
+
+ f.write("""<?xml version="1.1" encoding="UTF-8"?>
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:mlhim2="http://www.mlhim.org/xmls/mlhim2/2_3_0"
+ elementFormDefault="qualified"
+ targetNamespace="http://www.mlhim.org/xmls/mlhim2/2_3_0">
+
+ <xs:annotation>
+ <xs:documentation source="http://www.mlhim.org" xml:lang="{language}">
+ This is a {title} Concept Constraint Definition schema file (CCD).
+
+ <rdf:RDF
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:dc= "http://purl.org/dc/elements/1.1/">
+
+ <rdf:Description rdf:about="http://www.hkcr.net/ccd/{ccd_id}">
+ <dc:title>{title}</dc:title>
+ <dc:creator>{creator}</dc:creator>
+ {contributors}
+ <dc:subject>{subject}</dc:subject>
+ <dc:source>{source}</dc:source>
+ <dc:rights>{rights}</dc:rights>
+ <dc:relation>{relation}</dc:relation>
+ <dc:coverage>{coverage}</dc:coverage>
+ <dc:type>{resource_type}</dc:type>
+ <dc:identifier>{identifier}</dc:identifier>
+ <dc:description>{description}</dc:description>
+ <dc:publisher>{publisher}</dc:publisher>
+ <dc:date>{date}</dc:date>
+ <dc:format>{resource_format}</dc:format>
+ <dc:language>{language}</dc:language>
+ </rdf:Description>
+
+ </rdf:RDF>
+
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:include schemaLocation="http://www.mlhim.org/xmls/mlhim2/2_3_0/mlhim2.xsd"/>
+
+ <xs:element name='CCD' type="mlhim2:{ccd_id}"/>
+
+ <xs:complexType name="{ccd_id}">
+ <xs:complexContent>
+ <xs:restriction base="mlhim2:CCDType">
+ <xs:sequence>
+ <xs:element name="definition" minOccurs="1" maxOccurs="1" type="mlhim2:{UUID_definition}"/>
+ </xs:sequence>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="{UUID_definition}">
+ <xs:complexContent>
+ <xs:restriction base="mlhim2:{choice}">
+ <xs:sequence>
+ <xs:element name="{choice_dv}" minOccurs="1" maxOccurs="1" type="mlhim2:{UUID_DvString}"/>
+ </xs:sequence>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="{UUID_DvString}">
+ <xs:complexContent>
+ <xs:restriction base="mlhim2:DvStringType">
+ <xs:sequence>
+ <xs:element name="data_name" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+
+</xs:schema>
+""".format(ccd_id = ccd_id,
+ UUID_definition = UUID_definition,
+ UUID_DvString = UUID_string,
+
+ choice = choice_definition,
+ choice_dv = choice_definition[:-4] + '_dv',
+
+ title = escape(title),
+ description = escape(description),
+ date = date,
+ creator = escape(creator),
+ contributors = contributors_formated,
+ language = language,
+ publisher = escape(publisher),
+ subject = escape(subject),
+ source = escape(source),
+ rights = escape(rights),
+ relation = escape(relation),
+ coverage = escape(coverage),
+
+ resource_type = "MLHIM Concept Constraint Definition (CCD)",
+ resource_format = "text/xml",
+ identifier = ccd_id,
+
+ ))
+
+
+ f.write("<!-- Here are some UUIDs to use for complexType names:\n\n")
+
+ for x in range(0,10):
+ f.write("ct_"+str(uuid.uuid4()).replace('-','_')+"\n\n")
+
+ f.write("-->")
+
+ f.close()
+ return ccd_id
=== added file 'Generator/cdg/cdg_extra.py'
--- Generator/cdg/cdg_extra.py 1970-01-01 00:00:00 +0000
+++ Generator/cdg/cdg_extra.py 2012-07-02 17:23:35 +0000
@@ -0,0 +1,108 @@
+# -*- coding: utf-8 -*-
+import os
+import locale
+import pkgutil
+import StringIO
+
+import wx
+from wx.lib.wordwrap import wordwrap
+
+
+
+def help_box(self):
+
+ dlg = wx.MessageDialog(self, """
+Emails are formatted as:
+Timothy W. Cook <timothywayne.cook@xxxxxxxxx>
+
+Separate multiple contributors with a semi-colon and format them as:
+Eduardo Cesar <xcesar@xxxxxxxxx>; Luciana Cavalini <lutricav@xxxxxxxxx>
+""",
+ 'Help',
+ wx.OK | wx.ICON_INFORMATION
+ #wx.YES_NO | wx.NO_DEFAULT | wx.CANCEL | wx.ICON_INFORMATION
+ )
+ dlg.ShowModal()
+ dlg.Destroy()
+
+def about_box(self):
+ info = wx.AboutDialogInfo()
+ info.Name = "CDG Version 1.0 - [RM version (2.3.0)]"
+ #info.Version = "1.2.3"
+
+ info.Description = wordwrap(
+ "See http://dublincore.org/documents/dcmi-terms/ for explanation of how to enter the metadata for the CCD.",
+ 400, wx.ClientDC(self))
+ info.WebSite = ("http://www.hkcr.net/tools", "HKCR Website")
+
+ info.Developers = [ "Eduardo César <xcesar@xxxxxxxxx>",
+ "Timothy W. Cook <timothywayne.cook@xxxxxxxxx>",
+ ]
+
+ info.License = wordwrap(LICENSE, 500, wx.ClientDC(self))
+ # Then we call wx.AboutBox giving it that info object
+ return wx.AboutBox(info)
+
+
+def wrote_diag(self, ccd_id):
+ schema = ccd_id + ".xsd"
+ dlg = wx.MessageDialog(self, "%s" % schema,
+
+ 'Generated the file',
+ wx.OK | wx.ICON_INFORMATION
+ #wx.YES_NO | wx.NO_DEFAULT | wx.CANCEL | wx.ICON_INFORMATION
+ )
+ dlg.ShowModal()
+ dlg.Destroy()
+
+
+
+def get_path(self):
+ path = os.getcwd()
+
+ dlg = wx.DirDialog(self, "Choose a directory to put the generated files:",
+ path,
+ style=wx.DD_DEFAULT_STYLE
+ #| wx.DD_DIR_MUST_EXIST
+ #| wx.DD_CHANGE_DIR
+ )
+
+
+ if dlg.ShowModal() == wx.ID_OK:
+ path = dlg.GetPath()
+ else:
+ return None
+
+ dlg.Destroy()
+ return path
+
+def get_lang_list():
+ l = list(set(locale.locale_alias.keys()))
+ l.sort()
+ l2 = [i.replace('_','-')[0:3] + i[3:].upper() for i in l if ((len(i) < 6 and '_' in i) or len(i) == 2)]
+
+ return l2
+
+def set_icon(self):
+ logo_str = pkgutil.get_data(__name__, 'logo.png')
+ stio = StringIO.StringIO(logo_str)
+ image = wx.ImageFromStream(stio)
+ bitmap = wx.BitmapFromImage(image)
+ icon = wx.IconFromBitmap(bitmap)
+ self.SetIcon(icon)
+
+
+LICENSE = """
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+"""
=== added file 'Generator/cdg/logo.png'
Binary files Generator/cdg/logo.png 1970-01-01 00:00:00 +0000 and Generator/cdg/logo.png 2012-07-02 17:23:35 +0000 differ
=== added file 'Generator/cdg_wxglade.wxg'
--- Generator/cdg_wxglade.wxg 1970-01-01 00:00:00 +0000
+++ Generator/cdg_wxglade.wxg 2012-07-02 17:23:35 +0000
@@ -0,0 +1,471 @@
+<?xml version="1.0"?>
+<!-- generated by wxGlade 0.6.4 on Mon Jul 2 04:15:30 2012 -->
+
+<application path="cdg" name="" class="" option="1" 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="MainFrame" name="frame_principal" base="EditFrame">
+ <style>wxDEFAULT_FRAME_STYLE</style>
+ <title>Constraint Definition Generator</title>
+ <centered>1</centered>
+ <size>800, 470</size>
+ <object class="wxBoxSizer" name="sizer_principal" base="EditBoxSizer">
+ <orient>wxVERTICAL</orient>
+ <object class="sizeritem">
+ <flag>wxEXPAND</flag>
+ <border>0</border>
+ <option>1</option>
+ <object class="wxPanel" name="panel_principal" base="EditPanel">
+ <style>wxTAB_TRAVERSAL</style>
+ <object class="wxBoxSizer" name="sizer_vertical" base="EditBoxSizer">
+ <orient>wxHORIZONTAL</orient>
+ <object class="sizeritem">
+ <border>0</border>
+ <option>0</option>
+ <object class="spacer" name="spacer" base="EditSpacer">
+ <height>20</height>
+ <width>20</width>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <flag>wxEXPAND</flag>
+ <border>0</border>
+ <option>1</option>
+ <object class="wxBoxSizer" name="sizer_3" base="EditBoxSizer">
+ <orient>wxVERTICAL</orient>
+ <object class="sizeritem">
+ <border>0</border>
+ <option>0</option>
+ <object class="spacer" name="spacer" base="EditSpacer">
+ <height>20</height>
+ <width>20</width>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <flag>wxALL|wxEXPAND</flag>
+ <border>1</border>
+ <option>1</option>
+ <object class="wxBoxSizer" name="sizer_4" base="EditBoxSizer">
+ <orient>wxHORIZONTAL</orient>
+ <object class="sizeritem">
+ <flag>wxALIGN_CENTER_VERTICAL</flag>
+ <border>1</border>
+ <option>0</option>
+ <object class="wxStaticText" name="label_title" base="EditStaticText">
+ <style>wxALIGN_CENTRE</style>
+ <attribute>1</attribute>
+ <label>Title: </label>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <flag>wxALIGN_CENTER_VERTICAL</flag>
+ <border>1</border>
+ <option>1</option>
+ <object class="wxTextCtrl" name="text_ctrl_title" base="EditTextCtrl">
+ </object>
+ </object>
+ <object class="sizeritem">
+ <border>0</border>
+ <option>0</option>
+ <object class="spacer" name="spacer" base="EditSpacer">
+ <height>20</height>
+ <width>20</width>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <flag>wxALIGN_CENTER_VERTICAL</flag>
+ <border>0</border>
+ <option>0</option>
+ <object class="wxStaticText" name="label_date" base="EditStaticText">
+ <attribute>1</attribute>
+ <tooltip>Defalts to current day.</tooltip>
+ <label>Date :</label>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <flag>wxALIGN_CENTER_VERTICAL</flag>
+ <border>0</border>
+ <option>0</option>
+ <object class="wxDatePickerCtrl" name="datepicker_ctrl_date" base="EditDatePickerCtrl">
+ <size>105, 28</size>
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <flag>wxEXPAND</flag>
+ <border>0</border>
+ <option>1</option>
+ <object class="wxBoxSizer" name="sizer_5" base="EditBoxSizer">
+ <orient>wxHORIZONTAL</orient>
+ <object class="sizeritem">
+ <flag>wxALIGN_CENTER_VERTICAL</flag>
+ <border>0</border>
+ <option>0</option>
+ <object class="wxStaticText" name="label_description" base="EditStaticText">
+ <attribute>1</attribute>
+ <label>Description: </label>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <flag>wxEXPAND|wxALIGN_CENTER_VERTICAL</flag>
+ <border>0</border>
+ <option>1</option>
+ <object class="wxTextCtrl" name="text_ctrl_description" base="EditTextCtrl">
+ <style>wxTE_MULTILINE</style>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <border>0</border>
+ <option>0</option>
+ <object class="spacer" name="spacer" base="EditSpacer">
+ <height>20</height>
+ <width>20</width>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <flag>wxALIGN_CENTER_VERTICAL</flag>
+ <border>0</border>
+ <option>0</option>
+ <object class="wxStaticText" name="label_language" base="EditStaticText">
+ <attribute>1</attribute>
+ <label>Language: </label>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <flag>wxALIGN_CENTER_VERTICAL</flag>
+ <border>0</border>
+ <option>0</option>
+ <object class="wxChoice" name="choice_lang" base="EditChoice">
+ <selection>0</selection>
+ <choices>
+ </choices>
+ <extraproperties>
+ <property name="items">cdg_extra.get_lang_list()</property>
+ <property name="selection">cdg_extra.get_lang_list().index('en-US') | 0</property>
+ </extraproperties>
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <flag>wxEXPAND</flag>
+ <border>0</border>
+ <option>1</option>
+ <object class="wxBoxSizer" name="sizer_6" base="EditBoxSizer">
+ <orient>wxHORIZONTAL</orient>
+ <object class="sizeritem">
+ <flag>wxALIGN_CENTER_VERTICAL</flag>
+ <border>0</border>
+ <option>0</option>
+ <object class="wxStaticText" name="label_creator" base="EditStaticText">
+ <attribute>1</attribute>
+ <tooltip>Format emails as: Timothy W. Cook <timothywayne.cook@xxxxxxxxx></tooltip>
+ <label>Creator: </label>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <flag>wxALIGN_CENTER_VERTICAL</flag>
+ <border>1</border>
+ <option>1</option>
+ <object class="wxTextCtrl" name="text_ctrl_creator" base="EditTextCtrl">
+ <tooltip>Format emails as: Timothy W. Cook <timothywayne.cook@xxxxxxxxx></tooltip>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <border>0</border>
+ <option>0</option>
+ <object class="spacer" name="spacer" base="EditSpacer">
+ <height>20</height>
+ <width>20</width>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <flag>wxALIGN_CENTER_VERTICAL</flag>
+ <border>0</border>
+ <option>0</option>
+ <object class="wxStaticText" name="label_publisher" base="EditStaticText">
+ <attribute>1</attribute>
+ <label>Publisher: </label>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <flag>wxALIGN_CENTER_VERTICAL</flag>
+ <border>1</border>
+ <option>1</option>
+ <object class="wxTextCtrl" name="text_ctrl_publisher" base="EditTextCtrl">
+ <tooltip>Format emails as: Timothy W. Cook <timothywayne.cook@xxxxxxxxx></tooltip>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <border>0</border>
+ <option>0</option>
+ <object class="spacer" name="spacer" base="EditSpacer">
+ <height>20</height>
+ <width>20</width>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <flag>wxALIGN_CENTER_VERTICAL</flag>
+ <border>0</border>
+ <option>0</option>
+ <object class="wxStaticText" name="label_subject" base="EditStaticText">
+ <attribute>1</attribute>
+ <label>Subject: </label>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <flag>wxALIGN_CENTER_VERTICAL</flag>
+ <border>1</border>
+ <option>1</option>
+ <object class="wxTextCtrl" name="text_ctrl_subject" base="EditTextCtrl">
+ <tooltip>Format emails as: Timothy W. Cook <timothywayne.cook@xxxxxxxxx></tooltip>
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <flag>wxEXPAND</flag>
+ <border>0</border>
+ <option>1</option>
+ <object class="wxBoxSizer" name="sizer_7" base="EditBoxSizer">
+ <orient>wxHORIZONTAL</orient>
+ <object class="sizeritem">
+ <flag>wxALIGN_CENTER_VERTICAL</flag>
+ <border>0</border>
+ <option>0</option>
+ <object class="wxStaticText" name="label_source" base="EditStaticText">
+ <attribute>1</attribute>
+ <label>Source: </label>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <flag>wxALIGN_CENTER_VERTICAL</flag>
+ <border>1</border>
+ <option>1</option>
+ <object class="wxTextCtrl" name="text_ctrl_source" base="EditTextCtrl">
+ </object>
+ </object>
+ <object class="sizeritem">
+ <border>0</border>
+ <option>0</option>
+ <object class="spacer" name="spacer" base="EditSpacer">
+ <height>20</height>
+ <width>20</width>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <flag>wxALIGN_CENTER_VERTICAL</flag>
+ <border>0</border>
+ <option>0</option>
+ <object class="wxStaticText" name="label_rights" base="EditStaticText">
+ <attribute>1</attribute>
+ <label>Rights: </label>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <flag>wxALIGN_CENTER_VERTICAL</flag>
+ <border>1</border>
+ <option>1</option>
+ <object class="wxTextCtrl" name="text_ctrl_rights" base="EditTextCtrl">
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <flag>wxEXPAND</flag>
+ <border>0</border>
+ <option>1</option>
+ <object class="wxBoxSizer" name="sizer_8" base="EditBoxSizer">
+ <orient>wxHORIZONTAL</orient>
+ <object class="sizeritem">
+ <flag>wxALIGN_CENTER_VERTICAL</flag>
+ <border>0</border>
+ <option>0</option>
+ <object class="wxStaticText" name="label_relation" base="EditStaticText">
+ <attribute>1</attribute>
+ <label>Relation: </label>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <flag>wxALIGN_CENTER_VERTICAL</flag>
+ <border>1</border>
+ <option>1</option>
+ <object class="wxTextCtrl" name="text_ctrl_relation" base="EditTextCtrl">
+ </object>
+ </object>
+ <object class="sizeritem">
+ <border>0</border>
+ <option>0</option>
+ <object class="spacer" name="spacer" base="EditSpacer">
+ <height>20</height>
+ <width>20</width>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <flag>wxALIGN_CENTER_VERTICAL</flag>
+ <border>0</border>
+ <option>0</option>
+ <object class="wxStaticText" name="label_coverage" base="EditStaticText">
+ <attribute>1</attribute>
+ <label>Coverage: </label>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <flag>wxALIGN_CENTER_VERTICAL</flag>
+ <border>1</border>
+ <option>1</option>
+ <object class="wxTextCtrl" name="text_ctrl_coverage" base="EditTextCtrl">
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <flag>wxEXPAND</flag>
+ <border>0</border>
+ <option>1</option>
+ <object class="wxBoxSizer" name="sizer_1" base="EditBoxSizer">
+ <orient>wxHORIZONTAL</orient>
+ <object class="sizeritem">
+ <flag>wxALIGN_CENTER_VERTICAL</flag>
+ <border>0</border>
+ <option>0</option>
+ <object class="wxStaticText" name="label_contributors" base="EditStaticText">
+ <attribute>1</attribute>
+ <tooltip>Separate multiple contributors with a semi-colon and format them as:Eduardo Cesar <xcesar@xxxxxxxxx>; Luciana Cavalini <lutricav@xxxxxxxxx></tooltip>
+ <label>Contributors: </label>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <flag>wxALIGN_CENTER_VERTICAL</flag>
+ <border>1</border>
+ <option>1</option>
+ <object class="wxTextCtrl" name="text_ctrl_contributors" base="EditTextCtrl">
+ <tooltip>Separate multiple contributors with a semi-colon and format them as:Eduardo Cesar <xcesar@xxxxxxxxx>; Luciana Cavalini <lutricav@xxxxxxxxx></tooltip>
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <flag>wxEXPAND</flag>
+ <border>0</border>
+ <option>1</option>
+ <object class="wxBoxSizer" name="sizer_2" base="EditBoxSizer">
+ <orient>wxHORIZONTAL</orient>
+ <object class="sizeritem">
+ <flag>wxALIGN_CENTER_VERTICAL</flag>
+ <border>0</border>
+ <option>0</option>
+ <object class="wxStaticText" name="label_ccd_definition" base="EditStaticText">
+ <attribute>1</attribute>
+ <label>CCD definition class: </label>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <flag>wxALIGN_CENTER_VERTICAL</flag>
+ <border>0</border>
+ <option>0</option>
+ <object class="wxComboBox" name="combo_box_ccd" base="EditComboBox">
+ <style>wxCB_SIMPLE|wxCB_DROPDOWN|wxCB_READONLY</style>
+ <selection>0</selection>
+ <choices>
+ <choice>CareEntryType</choice>
+ <choice>AdminEntryType</choice>
+ <choice>DemographicEntryType</choice>
+ <choice>ClusterType</choice>
+ <choice>ElementType</choice>
+ <choice>SlotType</choice>
+ </choices>
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <flag>wxEXPAND</flag>
+ <border>0</border>
+ <option>1</option>
+ <object class="wxBoxSizer" name="sizer_2_copy" base="EditBoxSizer">
+ <orient>wxHORIZONTAL</orient>
+ <object class="sizeritem">
+ <flag>wxALIGN_BOTTOM</flag>
+ <border>0</border>
+ <option>0</option>
+ <object class="wxButton" name="button_about" base="EditButton">
+ <label>&About</label>
+ <events>
+ <handler event="EVT_BUTTON">about</handler>
+ </events>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <flag>wxEXPAND</flag>
+ <border>1</border>
+ <option>1</option>
+ <object class="spacer" name="spacer" base="EditSpacer">
+ <height>20</height>
+ <width>20</width>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <border>0</border>
+ <option>0</option>
+ <object class="spacer" name="spacer" base="EditSpacer">
+ <height>20</height>
+ <width>20</width>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <flag>wxALIGN_BOTTOM</flag>
+ <border>0</border>
+ <option>0</option>
+ <object class="wxButton" name="button_help" base="EditButton">
+ <stockitem>HELP</stockitem>
+ <label>&Help</label>
+ <events>
+ <handler event="EVT_BUTTON">help</handler>
+ </events>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <border>0</border>
+ <option>0</option>
+ <object class="spacer" name="spacer" base="EditSpacer">
+ <height>20</height>
+ <width>20</width>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <flag>wxALIGN_RIGHT|wxALIGN_BOTTOM|wxALIGN_CENTER_VERTICAL</flag>
+ <border>1</border>
+ <option>0</option>
+ <object class="wxButton" name="button_generate" base="EditButton">
+ <label>&Generate</label>
+ <events>
+ <handler event="EVT_BUTTON">generate</handler>
+ </events>
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <border>0</border>
+ <option>0</option>
+ <object class="spacer" name="spacer" base="EditSpacer">
+ <height>20</height>
+ <width>20</width>
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <border>0</border>
+ <option>0</option>
+ <object class="spacer" name="spacer" base="EditSpacer">
+ <height>20</height>
+ <width>20</width>
+ </object>
+ </object>
+ </object>
+ </object>
+ </object>
+ </object>
+ </object>
+</application>
=== added file 'Generator/make_zip'
--- Generator/make_zip 1970-01-01 00:00:00 +0000
+++ Generator/make_zip 2012-07-02 17:23:35 +0000
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+zip -j cdg.zip cdg/{__main__.py,cdg_custom.py,cdg_extra.py,MainFrame.py,logo.png}
=== added directory 'Generator/windows'
=== added file 'Generator/windows/setup_single_exe.py'
--- Generator/windows/setup_single_exe.py 1970-01-01 00:00:00 +0000
+++ Generator/windows/setup_single_exe.py 2012-07-02 17:23:35 +0000
@@ -0,0 +1,11 @@
+from distutils.core import setup
+import py2exe, sys, os
+
+sys.argv.append('py2exe')
+
+setup(
+ options = {'py2exe': {'bundle_files': 1}},
+ windows = [{'script': "app.py"}],
+ zipfile = None,
+)
+
=== removed file 'abstract.png'
Binary files abstract.png 2011-01-14 23:25:21 +0000 and abstract.png 1970-01-01 00:00:00 +0000 differ