* Release -> release, we're case sensitive
* source is not a list * some more working no XmlFile support in autoxml, looking for a way :(
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE Project SYSTEM "Project-3.8.dtd">
|
<!DOCTYPE Project SYSTEM "Project-3.8.dtd">
|
||||||
<!-- Project file for project pisi -->
|
<!-- Project file for project pisi -->
|
||||||
<!-- Saved: 2005-10-20, 23:32:54 -->
|
<!-- Saved: 2005-10-26, 20:31:35 -->
|
||||||
<!-- Copyright (C) 2005 PiSi Development Team, -->
|
<!-- Copyright (C) 2005 PiSi Development Team, -->
|
||||||
<Project version="3.8">
|
<Project version="3.8">
|
||||||
<ProgLanguage mixed="0">Python</ProgLanguage>
|
<ProgLanguage mixed="0">Python</ProgLanguage>
|
||||||
@@ -360,6 +360,10 @@
|
|||||||
<Dir>pisi</Dir>
|
<Dir>pisi</Dir>
|
||||||
<Name>atomicoperations.py</Name>
|
<Name>atomicoperations.py</Name>
|
||||||
</Source>
|
</Source>
|
||||||
|
<Source>
|
||||||
|
<Dir>tests</Dir>
|
||||||
|
<Name>specfilenewtests.py</Name>
|
||||||
|
</Source>
|
||||||
</Sources>
|
</Sources>
|
||||||
<Forms>
|
<Forms>
|
||||||
</Forms>
|
</Forms>
|
||||||
@@ -397,10 +401,10 @@
|
|||||||
<VcsOtherData>{'standardLayout': 1}</VcsOtherData>
|
<VcsOtherData>{'standardLayout': 1}</VcsOtherData>
|
||||||
</Vcs>
|
</Vcs>
|
||||||
<FiletypeAssociations>
|
<FiletypeAssociations>
|
||||||
<FiletypeAssociation pattern="*.py" type="SOURCES" />
|
|
||||||
<FiletypeAssociation pattern="*.ui.h" type="FORMS" />
|
<FiletypeAssociation pattern="*.ui.h" type="FORMS" />
|
||||||
<FiletypeAssociation pattern="*.idl" type="INTERFACES" />
|
|
||||||
<FiletypeAssociation pattern="*.ui" type="FORMS" />
|
<FiletypeAssociation pattern="*.ui" type="FORMS" />
|
||||||
|
<FiletypeAssociation pattern="*.idl" type="INTERFACES" />
|
||||||
|
<FiletypeAssociation pattern="*.py" type="SOURCES" />
|
||||||
<FiletypeAssociation pattern="*.ptl" type="SOURCES" />
|
<FiletypeAssociation pattern="*.ptl" type="SOURCES" />
|
||||||
</FiletypeAssociations>
|
</FiletypeAssociations>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
+4
-2
@@ -73,7 +73,7 @@ class Patch:
|
|||||||
|
|
||||||
class Update:
|
class Update:
|
||||||
|
|
||||||
a_Release = [xmlfile.String, xmlfile.mandatory]
|
a_release = [xmlfile.String, xmlfile.mandatory]
|
||||||
t_Date = [xmlfile.String, xmlfile.mandatory]
|
t_Date = [xmlfile.String, xmlfile.mandatory]
|
||||||
t_Version = [xmlfile.String, xmlfile.mandatory]
|
t_Version = [xmlfile.String, xmlfile.mandatory]
|
||||||
t_Type = [xmlfile.String, xmlfile.optional]
|
t_Type = [xmlfile.String, xmlfile.optional]
|
||||||
@@ -168,7 +168,9 @@ class Package:
|
|||||||
class SpecFile(XmlFile):
|
class SpecFile(XmlFile):
|
||||||
__metaclass__ = xmlfile.autoxml #needed when we specify a superclass
|
__metaclass__ = xmlfile.autoxml #needed when we specify a superclass
|
||||||
|
|
||||||
t_Source = [ [Source], xmlfile.mandatory, "Source"]
|
tag = "PISI"
|
||||||
|
|
||||||
|
t_Source = [ Source, xmlfile.mandatory]
|
||||||
t_Packages = [ [Package], xmlfile.mandatory, "Package"]
|
t_Packages = [ [Package], xmlfile.mandatory, "Package"]
|
||||||
t_History = [ [Update], xmlfile.mandatory, "Update"]
|
t_History = [ [Update], xmlfile.mandatory, "Update"]
|
||||||
|
|
||||||
|
|||||||
+5
-4
@@ -199,9 +199,10 @@ class autoxml(oo.autosuper):
|
|||||||
#print 'generating class', name
|
#print 'generating class', name
|
||||||
|
|
||||||
# add XmlFile as one of the superclasses of cls
|
# add XmlFile as one of the superclasses of cls
|
||||||
bases = list(bases)
|
#bases = list(bases)
|
||||||
if not XmlFile in bases:
|
#if not XmlFile in bases:
|
||||||
bases.append(XmlFile)
|
# bases.append(XmlFile)
|
||||||
|
bases = (XmlFile)
|
||||||
|
|
||||||
# standard initialization
|
# standard initialization
|
||||||
super(autoxml, cls).__init__(name, bases, dict)
|
super(autoxml, cls).__init__(name, bases, dict)
|
||||||
@@ -267,7 +268,7 @@ class autoxml(oo.autosuper):
|
|||||||
def check(self, where = unicode()):
|
def check(self, where = unicode()):
|
||||||
errs = []
|
errs = []
|
||||||
for checker in self.__class__.checkers:
|
for checker in self.__class__.checkers:
|
||||||
errs.extend(checker(self), where)
|
errs.extend(checker(self, where))
|
||||||
return errs
|
return errs
|
||||||
cls.check = check
|
cls.check = check
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class XmlFileTestCase(unittest.TestCase):
|
|||||||
|
|
||||||
def testMetaClass(self):
|
def testMetaClass(self):
|
||||||
|
|
||||||
class OtherInfo(object):
|
class OtherInfo:
|
||||||
__metaclass__ = xmlfile.autoxml
|
__metaclass__ = xmlfile.autoxml
|
||||||
t_BirthDate = [types.StringType, xmlfile.mandatory]
|
t_BirthDate = [types.StringType, xmlfile.mandatory]
|
||||||
t_Interest = [types.StringType, xmlfile.optional]
|
t_Interest = [types.StringType, xmlfile.optional]
|
||||||
@@ -41,11 +41,14 @@ class XmlFileTestCase(unittest.TestCase):
|
|||||||
t_Number = [types.IntType, xmlfile.optional]
|
t_Number = [types.IntType, xmlfile.optional]
|
||||||
t_Email = [types.StringType, xmlfile.optional]
|
t_Email = [types.StringType, xmlfile.optional]
|
||||||
a_href = [types.StringType, xmlfile.mandatory]
|
a_href = [types.StringType, xmlfile.mandatory]
|
||||||
t_Projects = [ [types.StringType], xmlfile.mandatory, 'Project']
|
t_Projects = [ [types.StringType], xmlfile.mandatory, 'Project', '']
|
||||||
t_OtherInfo = [ OtherInfo, xmlfile.optional ]
|
t_OtherInfo = [ OtherInfo, xmlfile.optional ]
|
||||||
|
|
||||||
a = A()
|
a = A()
|
||||||
print A.__class__
|
print A.__class__
|
||||||
|
print super(A)
|
||||||
|
print A.__dict__
|
||||||
|
print OtherInfo.__dict__
|
||||||
self.assertEqual(a.href, None)
|
self.assertEqual(a.href, None)
|
||||||
dom = mdom.parse('tests/a.xml')
|
dom = mdom.parse('tests/a.xml')
|
||||||
node = getNode(dom, 'A')
|
node = getNode(dom, 'A')
|
||||||
|
|||||||
Reference in New Issue
Block a user