Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
I
inary
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
1
Konular (issue)
1
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
SulinOS
inary
Commits
e2c4fd42
Kaydet (Commit)
e2c4fd42
authored
Eki 26, 2005
tarafından
Eray Özkural
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
* add a hook for check() function
* remove the stupid code that tried to add XmlFile as a base class
üst
07b2c79f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
13 deletions
+5
-13
xmlfile.py
pisi/xmlfile.py
+5
-9
xmlfiletests.py
tests/xmlfiletests.py
+0
-4
No files found.
pisi/xmlfile.py
Dosyayı görüntüle @
e2c4fd42
...
...
@@ -198,12 +198,6 @@ class autoxml(oo.autosuper):
"""entry point for metaclass code"""
#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
=
(
XmlFile
)
# standard initialization
super
(
autoxml
,
cls
)
.
__init__
(
name
,
bases
,
dict
)
...
...
@@ -243,7 +237,7 @@ class autoxml(oo.autosuper):
if
not
tag
:
tag
=
cls
.
tag
#self.__super.__init__(tag = tag) #FIXME: doesn't work, why? :(
super
(
cls
,
self
)
.
__init__
(
tag
=
tag
)
super
(
cls
,
self
)
.
__init__
(
tag
=
tag
)
# tag for XmlFile support
for
init
in
self
.
__class__
.
initializers
:
init
(
self
)
# init hook
...
...
@@ -269,6 +263,8 @@ class autoxml(oo.autosuper):
errs
=
[]
for
checker
in
self
.
__class__
.
checkers
:
errs
.
extend
(
checker
(
self
,
where
))
if
hasattr
(
self
,
'check_hook'
):
errs
.
extend
(
self
.
check_hook
(
where
))
return
errs
cls
.
check
=
check
...
...
@@ -287,8 +283,8 @@ class autoxml(oo.autosuper):
for
x
in
errs
:
ctx
.
ui
.
warning
(
x
)
cls
.
print_text
=
print_text
#
if not dict.has_key('__str__'):
# cls.__str__ = str
if
not
dict
.
has_key
(
'__str__'
):
cls
.
__str__
=
print_text
def
gen_attr_member
(
cls
,
attr
):
"""generate readers and writers for an attribute member"""
...
...
tests/xmlfiletests.py
Dosyayı görüntüle @
e2c4fd42
...
...
@@ -45,10 +45,6 @@ class XmlFileTestCase(unittest.TestCase):
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'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment