* 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"?>
|
||||
<!DOCTYPE Project SYSTEM "Project-3.8.dtd">
|
||||
<!-- 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, -->
|
||||
<Project version="3.8">
|
||||
<ProgLanguage mixed="0">Python</ProgLanguage>
|
||||
@@ -360,6 +360,10 @@
|
||||
<Dir>pisi</Dir>
|
||||
<Name>atomicoperations.py</Name>
|
||||
</Source>
|
||||
<Source>
|
||||
<Dir>tests</Dir>
|
||||
<Name>specfilenewtests.py</Name>
|
||||
</Source>
|
||||
</Sources>
|
||||
<Forms>
|
||||
</Forms>
|
||||
@@ -397,10 +401,10 @@
|
||||
<VcsOtherData>{'standardLayout': 1}</VcsOtherData>
|
||||
</Vcs>
|
||||
<FiletypeAssociations>
|
||||
<FiletypeAssociation pattern="*.py" type="SOURCES" />
|
||||
<FiletypeAssociation pattern="*.ui.h" type="FORMS" />
|
||||
<FiletypeAssociation pattern="*.idl" type="INTERFACES" />
|
||||
<FiletypeAssociation pattern="*.ui" type="FORMS" />
|
||||
<FiletypeAssociation pattern="*.idl" type="INTERFACES" />
|
||||
<FiletypeAssociation pattern="*.py" type="SOURCES" />
|
||||
<FiletypeAssociation pattern="*.ptl" type="SOURCES" />
|
||||
</FiletypeAssociations>
|
||||
</Project>
|
||||
|
||||
+4
-2
@@ -73,7 +73,7 @@ class Patch:
|
||||
|
||||
class Update:
|
||||
|
||||
a_Release = [xmlfile.String, xmlfile.mandatory]
|
||||
a_release = [xmlfile.String, xmlfile.mandatory]
|
||||
t_Date = [xmlfile.String, xmlfile.mandatory]
|
||||
t_Version = [xmlfile.String, xmlfile.mandatory]
|
||||
t_Type = [xmlfile.String, xmlfile.optional]
|
||||
@@ -168,7 +168,9 @@ class Package:
|
||||
class SpecFile(XmlFile):
|
||||
__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_History = [ [Update], xmlfile.mandatory, "Update"]
|
||||
|
||||
|
||||
+5
-4
@@ -199,9 +199,10 @@ class autoxml(oo.autosuper):
|
||||
#print 'generating class', name
|
||||
|
||||
# add XmlFile as one of the superclasses of cls
|
||||
bases = list(bases)
|
||||
if not XmlFile in bases:
|
||||
bases.append(XmlFile)
|
||||
#bases = list(bases)
|
||||
#if not XmlFile in bases:
|
||||
# bases.append(XmlFile)
|
||||
bases = (XmlFile)
|
||||
|
||||
# standard initialization
|
||||
super(autoxml, cls).__init__(name, bases, dict)
|
||||
@@ -267,7 +268,7 @@ class autoxml(oo.autosuper):
|
||||
def check(self, where = unicode()):
|
||||
errs = []
|
||||
for checker in self.__class__.checkers:
|
||||
errs.extend(checker(self), where)
|
||||
errs.extend(checker(self, where))
|
||||
return errs
|
||||
cls.check = check
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ class XmlFileTestCase(unittest.TestCase):
|
||||
|
||||
def testMetaClass(self):
|
||||
|
||||
class OtherInfo(object):
|
||||
class OtherInfo:
|
||||
__metaclass__ = xmlfile.autoxml
|
||||
t_BirthDate = [types.StringType, xmlfile.mandatory]
|
||||
t_Interest = [types.StringType, xmlfile.optional]
|
||||
@@ -41,11 +41,14 @@ class XmlFileTestCase(unittest.TestCase):
|
||||
t_Number = [types.IntType, xmlfile.optional]
|
||||
t_Email = [types.StringType, xmlfile.optional]
|
||||
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 ]
|
||||
|
||||
a = A()
|
||||
print A.__class__
|
||||
print super(A)
|
||||
print A.__dict__
|
||||
print OtherInfo.__dict__
|
||||
self.assertEqual(a.href, None)
|
||||
dom = mdom.parse('tests/a.xml')
|
||||
node = getNode(dom, 'A')
|
||||
|
||||
Reference in New Issue
Block a user