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
900b48a2
Kaydet (Commit)
900b48a2
authored
Eyl 28, 2006
tarafından
Faik Uygur
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
* get metadata and files info from pisi package without extracting somewhere.
üst
578135a7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
0 deletions
+39
-0
package.py
pisi/package.py
+12
-0
autoxml.py
pisi/pxml/autoxml.py
+19
-0
xmlfile.py
pisi/pxml/xmlfile.py
+8
-0
No files found.
pisi/package.py
Dosyayı görüntüle @
900b48a2
...
...
@@ -105,6 +105,18 @@ class Package:
self
.
extract_files
([
ctx
.
const
.
metadata_xml
,
ctx
.
const
.
files_xml
],
outdir
)
self
.
extract_dir
(
'config'
,
outdir
)
def
get_metadata
(
self
):
"""reads metadata.xml from the PiSi package and returns MetaData object"""
md
=
MetaData
()
md
.
parse
(
self
.
impl
.
read_file
(
ctx
.
const
.
metadata_xml
))
return
md
def
get_files
(
self
):
"""reads files.xml from the PiSi package and returns Files object"""
files
=
Files
()
files
.
parse
(
self
.
impl
.
read_file
(
ctx
.
const
.
files_xml
))
return
files
def
read
(
self
,
outdir
=
None
):
if
not
outdir
:
outdir
=
ctx
.
config
.
tmp_dir
()
...
...
pisi/pxml/autoxml.py
Dosyayı görüntüle @
900b48a2
...
...
@@ -412,6 +412,24 @@ class autoxml(oo.autosuper, oo.autoprop):
cls
.
__ne__
=
notequal
if
xmlfile_support
:
def
parse
(
self
,
xml
,
keepDoc
=
False
):
"parse XML string and decode it into a python object"
self
.
parsexml
(
xml
)
errs
=
[]
self
.
decode
(
self
.
rootNode
(),
errs
)
if
errs
:
errs
.
append
(
_
(
"autoxml.parse: String '
%
s' has errors"
)
%
xml
)
raise
Error
(
*
errs
)
if
hasattr
(
self
,
'read_hook'
):
self
.
read_hook
(
errs
)
if
not
keepDoc
:
self
.
unlink
()
# get rid of the tree
errs
=
self
.
errors
()
if
errs
:
errs
.
append
(
_
(
"autoxml.parse: String '
%
s' has errors"
)
%
xml
)
def
read
(
self
,
uri
,
keepDoc
=
False
,
tmpDir
=
'/tmp'
,
sha1sum
=
False
,
compress
=
None
,
sign
=
None
,
copylocal
=
False
):
"read XML file and decode it into a python object"
...
...
@@ -454,6 +472,7 @@ class autoxml(oo.autosuper, oo.autoprop):
cls
.
read
=
read
cls
.
write
=
write
cls
.
parse
=
parse
def
gen_attr_member
(
cls
,
attr
):
...
...
pisi/pxml/xmlfile.py
Dosyayı görüntüle @
900b48a2
...
...
@@ -54,6 +54,14 @@ class XmlFile(object):
def
rootNode
(
self
):
"""returns root document element"""
return
self
.
doc
def
parsexml
(
self
,
xml
):
"""parses xml string and returns DOM"""
try
:
self
.
doc
=
iks
.
parseString
(
xml
)
return
self
.
doc
except
Exception
,
e
:
raise
Error
(
_
(
"String '
%
s' has invalid XML"
)
%
(
xml
))
def
readxmlfile
(
self
,
file
):
raise
Exception
(
"not implemented"
)
...
...
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