[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue designer/src/ToolSupport.py designer/src/r...
From: |
Jason Cater |
Subject: |
gnue designer/src/ToolSupport.py designer/src/r... |
Date: |
Tue, 23 Jul 2002 13:52:52 -0400 |
CVSROOT: /cvsroot/gnue
Module name: gnue
Changes by: Jason Cater <address@hidden> 02/07/23 13:52:52
Modified files:
designer/src : ToolSupport.py
designer/src/reports: Incubator.py TemplateSupport.py
__init__.py
reports/src : GRLayout.py
Added files:
designer/src/reports: Instance.py LayoutEditor.py
designer/templates/reports: SimpleReport.py
Log message:
added btami's report module/wizard to designer
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/designer/src/ToolSupport.py.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/designer/src/reports/Instance.py?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/designer/src/reports/LayoutEditor.py?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/designer/src/reports/Incubator.py.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/designer/src/reports/TemplateSupport.py.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/designer/src/reports/__init__.py.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/designer/templates/reports/SimpleReport.py?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/reports/src/GRLayout.py.diff?tr1=1.35&tr2=1.36&r1=text&r2=text
Patches:
Index: gnue/designer/src/ToolSupport.py
diff -c gnue/designer/src/ToolSupport.py:1.6
gnue/designer/src/ToolSupport.py:1.7
*** gnue/designer/src/ToolSupport.py:1.6 Thu Jun 27 18:48:18 2002
--- gnue/designer/src/ToolSupport.py Tue Jul 23 13:52:51 2002
***************
*** 32,38 ****
SupportedTools = []
UnsupportedTools = []
Tools = ( 'forms',
! # 'reports',
'navigator',
'schema'
)
--- 32,38 ----
SupportedTools = []
UnsupportedTools = []
Tools = ( 'forms',
! 'reports',
'navigator',
'schema'
)
Index: gnue/designer/src/reports/Incubator.py
diff -c gnue/designer/src/reports/Incubator.py:1.1
gnue/designer/src/reports/Incubator.py:1.2
*** gnue/designer/src/reports/Incubator.py:1.1 Fri Jun 28 00:03:38 2002
--- gnue/designer/src/reports/Incubator.py Tue Jul 23 13:52:51 2002
***************
*** 0 ****
--- 1,118 ----
+ #
+ # This file is part of GNU Enterprise.
+ #
+ # GNU Enterprise 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 2, or (at your option) any later version.
+ #
+ # GNU Enterprise 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 program; see the file COPYING. If not,
+ # write to the Free Software Foundation, Inc., 59 Temple Place
+ # - Suite 330, Boston, MA 02111-1307, USA.
+ #
+ # Copyright 2001-2002 Free Software Foundation
+ #
+ # FILE:
+ # reports/Incubator.py
+ #
+ # DESCRIPTION:
+ # Creates objects to be added to the object
+ #
+ # NOTES:
+ #
+
+ from gnue.common import GDebug
+ from gnue.reports import GRParser, GRReport, GRLayout
+ from gnue.designer.Incubator import *
+
+ def createObject(instance, report, tag, type=None, parent=None,
+ parentHint=None, attributes={}):
+
+
+ GDebug.printMesg(3,'Creating a "%s" object' % tag)
+ GDebug.printMesg(6,"Object's parent is %s" % parentHint)
+
+ try:
+ name = attributes['name']
+ except KeyError:
+ name = instance.getNextGenericName(tag)
+
+ try:
+ objclass = elements[tag]['BaseClass']
+ if elements[tag].has_key('Attributes'):
+ attrs = elements[tag]['Attributes']
+ else:
+ attrs = {}
+ except KeyError:
+ GDebug.printMesg(1, "Attempted to create a '%s', "
+ "but I don't know what to do!" % tag)
+ return
+
+
+ parent = None
+ if tag in ('layout',):
+ parent = report
+
+ o = objclass(parent or parentHint)
+
+ # Pull default values for any attributes not supplied
+ for attr in attrs.keys():
+ if not attributes.has_key(attr):
+ if attrs[attr].has_key('Default'):
+ attributes[attr] = attrs[attr]['Typecast'](attrs[attr]['Default'])
+
+ for attr in attributes.keys():
+ if attrs.has_key(attr):
+ o.__dict__[attr] = attributes[attr]
+ o.name = name
+ instance.nameMappings[o.name] = o
+ o._buildObject()
+ instance.onCreateObject(o, __name__)
+ instance.onSetCurrentObject(o, __name__)
+ return o
+
+
+ def reparentObject(instance, report, object, newParent):
+ if object._parent == newParent:
+ return
+
+ # TODO
+ pass
+
+
+ def deleteObject(instance, report, object, newCurrentObject=None, firstRun=1):
+
+ if firstRun:
+ newCurrentObject = object._parent
+ parent = object._parent
+
+ for child in object._children:
+ child.deleteObject(instance, report, child, firstRun=0)
+
+ instance.onDeleteObject(object, __name__)
+
+ if firstRun:
+ o = parent
+ while not isinstance(o, GRReport.GRReport):
+ o._buildObject()
+ o = o._parent
+
+ if newCurrentObject:
+ instance.onSetCurrentObject(newCurrentObject, __name__)
+
+
+
+ #
+ # Figure out tag dependencies
+ #
+ elements = GRParser.getXMLelements()
+ elementMapping = {}
+ calcDependencies(elements, elementMapping)
+
+
Index: gnue/designer/src/reports/TemplateSupport.py
diff -c gnue/designer/src/reports/TemplateSupport.py:1.1
gnue/designer/src/reports/TemplateSupport.py:1.2
*** gnue/designer/src/reports/TemplateSupport.py:1.1 Fri Jun 28 00:03:38 2002
--- gnue/designer/src/reports/TemplateSupport.py Tue Jul 23 13:52:52 2002
***************
*** 28,38 ****
#
from gnue.designer.TemplateBase import *
! import Incubator
# TODO
def createRootObject(instance):
! return None
--- 28,42 ----
#
from gnue.designer.TemplateBase import *
! try:
! import Incubator
! except:
! print 'Incubator import failed'
! from gnue.reports.GRReport import GRReport
# TODO
def createRootObject(instance):
! return GRReport.GRReport()
***************
*** 44,49 ****
class ReportTemplate(TemplateBase):
# Initialize user code
! def Start(self, report):
pass
--- 48,54 ----
class ReportTemplate(TemplateBase):
# Initialize user code
! def Start(self, root):
pass
+
Index: gnue/designer/src/reports/__init__.py
diff -c gnue/designer/src/reports/__init__.py:1.1
gnue/designer/src/reports/__init__.py:1.2
*** gnue/designer/src/reports/__init__.py:1.1 Thu Jan 10 21:22:07 2002
--- gnue/designer/src/reports/__init__.py Tue Jul 23 13:52:52 2002
***************
*** 0 ****
--- 1,46 ----
+ #
+ # This file is part of GNU Enterprise.
+ #
+ # GNU Enterprise 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 2, or (at your option) any later version.
+ #
+ # GNU Enterprise 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 program; see the file COPYING. If not,
+ # write to the Free Software Foundation, Inc., 59 Temple Place
+ # - Suite 330, Boston, MA 02111-1307, USA.
+ #
+ # Copyright 2002 Free Software Foundation
+ #
+ # FILE:
+ # reports/__init__.py
+ #
+ # DESCRIPTION:
+ # Various constants for the reports designer interface
+ #
+ # NOTES:
+ # This __init__ causes gnue.designer.reports to expose
+ # the Instance class plus a properties object.
+ #
+
+ class ReportsToolProperties:
+
+ module = 'reports'
+ application = 'GNUe Reports'
+ nickname = 'Reports'
+ description = 'GNUe Report Definition'
+ xmlOpeningTag = 'report'
+
+ fileExtensions = { 'grd': 'GNUe Report Definition', }
+
+ defaultFileExtension = 'grd'
+
+ properties = ReportsToolProperties()
+
+
Index: gnue/reports/src/GRLayout.py
diff -c gnue/reports/src/GRLayout.py:1.35 gnue/reports/src/GRLayout.py:1.36
*** gnue/reports/src/GRLayout.py:1.35 Thu May 30 18:26:17 2002
--- gnue/reports/src/GRLayout.py Tue Jul 23 13:52:52 2002
***************
*** 60,66 ****
self._inits = (self.initialize,)
! def _buildObject(self):
# If there is more than one object attached to a layout
# object, then create an unbound section to contain them.
# This is a convenience for the layout engine code :)
--- 60,67 ----
self._inits = (self.initialize,)
! def initialize(self):
! # Find the xml namespace in use by any child passthru objects
# If there is more than one object attached to a layout
# object, then create an unbound section to contain them.
# This is a convenience for the layout engine code :)
***************
*** 78,87 ****
raise GRExceptions.NoLayoutDefined, \
"The layout section does not contain any instructions. What do I do?"
- return GObj._buildObject(self)
-
- def initialize(self):
- # Find the xml namespace in use by any child passthru objects
self._xmlchildnamespace = self._findNamespace(self)
self._parent._namespace = self._xmlchildnamespace
--- 79,84 ----
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnue designer/src/ToolSupport.py designer/src/r...,
Jason Cater <=