1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-11-21 16:55:07 -05:00

Making xeputil.py work.

git-svn-id: file:///home/ksmith/gitmigration/svn/xmpp/trunk@4088 4b5297f7-1745-476d-ba37-a9c6900126ab
This commit is contained in:
Tobias Markmann 2010-03-16 17:10:28 +00:00
parent ccac599756
commit 47c91ed367

View File

@ -29,6 +29,7 @@
## END LICENSE ##
import pysvn
import os
import tempfile
from xepinfo import XEPInfo
from xml.dom.minidom import parse,parseString,Document,getDOMImplementation
@ -47,8 +48,8 @@ class XEP:
def revisions(self):
client = pysvn.Client(self.BASEDIR);
rev = client.info("xep-" + nr + ".xml").revision.number
log = client.log("xep-" + nr + ".xml", pysvn.Revision( pysvn.opt_revision_kind.number, 0 ),pysvn.Revision( pysvn.opt_revision_kind.number, rev ), True)
rev = client.info("xep-" + self.nr + ".xml").revision.number
log = client.log("xep-" + self.nr + ".xml", pysvn.Revision( pysvn.opt_revision_kind.number, 0 ),pysvn.Revision( pysvn.opt_revision_kind.number, rev ), True)
revs = []
for l in log:
@ -67,11 +68,12 @@ def getLatestXEPFilename(XEPDIR, nr, no_interim=True):
try:
xep = XEP(XEPDIR, nr)
revs = xep.revisions()
revs.reverse()
content = ""
if no_iterim:
for rev in revs.reverse():
if no_interim:
for rev in revs:
tmp_content = xep.contentOfRevision(rev)
info = XEPInfo("", tmp_content)
info = XEPInfo(tmp_content, " ")
if not info.interim:
content = tmp_content
break;
@ -79,7 +81,8 @@ def getLatestXEPFilename(XEPDIR, nr, no_interim=True):
else:
content = xep.contentOfRevision(revs[len(revs)-1])
handle, name = mkstemp();
(fd, name) = tempfile.mkstemp();
handle = os.fdopen(fd, "w+b")
handle.write(content)
handle.close()
return name;