Problems with the Python bindings
Martin Bergner <[email protected]> Fri, 23 Mar 2007 10:53:16 +0100
| Newsgroups | gmane.comp.sysutils.backup.dar.libdar |
|---|---|
| Message-ID | <[email protected]> |
--=-cCzi8KDaN/hjcAIC0c6L
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Hi,
I'm one of the developers of HUBackup [0] in Ubuntu. As the program is
written in Python, we now decided that it would be nice if we used the
DAR Python bindings [1].
However, there seem to be some problems with the bindings themselves. I
could fix some, but I'm now at a point where I don't really know where
the problem is exactly.
The problems I fixed were:
1. The bindings wouldn't compile in one step. Once invoking "make"
failed, doing it a second time worked. The fix was a small %import
statement in user_interaction.i
2. The bindings wouldn't work with the default Debian mode of 64. I
fixed that by changing the Makefiles and adjusting one or two *.i files.
The bindings now compile and load with every mode.
3. The bindings didn't work when specifying a user_interaction object.
As python does not work with something like that:
test.py:
*********************************
#!/usr/bin/env python
def fun_test(param1):
print param1
def fun_fail(param1):
if param1 == None:
fun_test = None
else:
fun_test(param1)
fun_fail("Bla")
*********************************
But that was also easily fixable.
I will attach a small patch that fixes these problems when the patch is
applied. I deleted the Perl and Ruby bindings stuff since it is not
really necessary.
Our code now successfully uses the List job and I can even see all the
files in an dar archive so that works correctly. However, I can not use
the Extract Job. When I set Verbose to "true" I get the message
"Extracting contents from the archive" but that is it. The dar archive
is small enough so that it shouldn't take long to extract something.
However, the "Extracting ..." is the last message that I get. (My
interaction stuff is ok since it works with the list job).
I suspect that there is a problem with the masks. I get a lot of
"swig/python detected a memory leak of type 'std::string *', no
destructor found." warnings which I think appear in mask. Also, I can't
use the list job with a specific mask to only show parts of the files in
the archive.
I currently use the following code snippet to access the extract object:
Excerpt from hurestore.py:
*********************************
from dar import job
class hurestore:
restore(self):
job_extract = job.Extract()
job_extract.interaction = gtk_interaction(self.window)
job_extract.root_path = self.path_to_which_restoring
job_extract.archive_path = self.path_where_archive_is
job_extract.archive_name = self.archive_name
job_extract.verbose = True
job_extract.selection = True
job_extract.run()
*********************************
This gives me the above behaviour.
This is all the information I think are interesting so far but if you
need more, just ask.
Thanks in advance,
Martin
[0] https://launchpad.net/hubackup
[1] http://darbinding.sourceforge.net
--=-cCzi8KDaN/hjcAIC0c6L
Content-Disposition: attachment; filename=various_fixes.patch.gz
Content-Type: application/x-gzip; name=various_fixes.patch.gz
Content-Transfer-Encoding: base64
H4sICCieA0YAA3ZhcmlvdXNfZml4ZXMucGF0Y2gA7Rr7b9pM8ufwV+znUmEXbAykSY4KqYSQBJWQ
CEi/q2jONWYBX4xNvSZprsr/fjPrFw8bQtRWOulIGsPO+7GzM0tH5nhM5EXHJSPdlUd0rC8srzg7
LLJHc6LMDvmysWCeM1tazciynEJwUFbVY1mtyOUKKanV8mFVPVTU8EXyaklVM/l8PpnxJnVF3aD+
+JHIx+8LxyQPf4/Ix48Z4r9GtkXmunGvTyiTBGLaZKw/OC5xxsSbUiLbjruwPXNGydjSJ0pIZgKY
Mo8I2d7frQvtc7Pba113BCJPKBFKakUtHwofkIMdUhDCMTvX3dtOv3XV1M7b9YtaLpeRQ3gbEW7a
uEZW174srVGL0Ri+Ww811ANdcFJBF5yUV1ywzjNFU9lY0mtsJugtWxiSuZWkfwB7imDAgXCdSodq
4RjiVKqcrKh1J4XvuDo3X7R267RXE7K6oRkP2vzJmzq2ZplDJmQinXytYq/cNLttgfxVI4Lt2BT8
ooeu6t22+vXTdlMgAHyiLHRTYFa9oV31LrTGZbPxqdW5EAdz6lrkgbrMdGxQTY7Tp+N4FGh1j2fM
d1EiQ9MjJsOPLkAcAhlljsjCHuqWbht0RIYupBz12DKbx6lpTAlsH5fqlvVERg5lds4jlnlPlRAR
7QmjXBO+cfuITEnuuzgYSB/I3DVtj2Tv7sg72Az8VcgWP+S+CWuGdZu923ZfHGSXOcZ2rXpwLa/e
q+oJMF7zWBCnRrtZ72jd23YTY7W+RAyL6raMuSDPLYGsEd+0tVan0b49Q+KvWZEvhisSCe29av7w
bj3TYtVqczYEf4IHDMOZeyy2k+d0xD2w+u96txOE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3iR7+dmxSftLz46XsE85O44KpQrJH2EV
RcfCRjq9bbXPtKvrs2al7H9PdfUFRqcaSAgX6lda4+aGT0E1+QyAZ/Uup6hVykRuQWPsa0SyIuBp
N93r86BD5QMUYvrf0a0TZ4Jv9lbUODpcUyNcSFfj6HBFjT31QP7xN4yR2AShe5gK2U4hdOPoEWQ2
9Fj5ciXotPz5tHkOIyqcEnzGiBZverAUXGz7KBI2DZoHJwODHjQr+i5DSxAWJAU8siK3QVIsPeB2
0exwC4Cj3Eom3ARwl2Zk/6ICRvVXcghtuPmy/OXE6qUDkc8u65+bmn/No10GUoPJG2W2U8xV8AqN
yFZocyb/R/QNPkfh3rQg/1oLNnn7tbN3rZ238NusGp59/ERgDoHiDK0cFF1o2vBj1GvjBz6V4puZ
zu75G89xLB9x4zRhzr6Fdd+K+qpS+rtq6P+L5/9c8azw/xxSCace6DBky4FGo0rWk1nDkCsOwctb
bEuwG2GKg9soDTWNCcysKRADINHNUHL1lQ+yG5eyRDa2MOReWma5tPKqSpr/8yrsLo4Qh7XQgP9X
V9Dvqyu7/Z0ewtRIbIr4YxH4DaJ3e/6/hiuCbRwnAAA=
--=-cCzi8KDaN/hjcAIC0c6L
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
--=-cCzi8KDaN/hjcAIC0c6L
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Dar-libdar_api mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dar-libdar_api
--=-cCzi8KDaN/hjcAIC0c6L--