maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   mbarcode (https://talk.maemo.org/showthread.php?t=34996)

dragly 2010-10-26 11:40

Re: mbarcode
 
I had no idea the firmware upgrade had been released yet. That's good news :) I guess the plugins might have to be recompiled against the latest firmware libraries. I'll try to update and see what happens ;)

donj541 2010-10-26 13:17

Re: mbarcode
 
Thanks dragly. Very usefull app. Looking forward for the new version soon.

dragly 2010-10-26 13:38

Re: mbarcode
 
Looks like it is broken here too. I'll try to push one of the plugins and the mbarcode package to the autobuilder right away to see if that helps.

I think there is some binary incompatibility for plugins between different versions of Qt. Rebuilding both the application and the plugins should hopefully work.

I'll be back with updates soon :)

dragly 2010-10-26 17:34

Re: mbarcode
 
Seems like they only needed to be rebuilt.

All packages are built and available in extras-devel now.

dragly 2010-10-26 19:34

Re: mbarcode
 
Quote:

Originally Posted by lardman (Post 846066)
http://chart.apis.google.com/chart?c...%A9my+Hubscher

This has the BOM encoded at the start to indicate it's UTF-8, which seems to decode properly.


On a completely different note, has anyone else found that you sometimes revert back to continuous scanning until you open the Settings dialog? I thought I'd fixed this but apparently not. Drat! :) - seems to happen to me after I've scanned something. I'll have to check and see what's going wrong there

This has been fixed in version 0.2.4-0. The error was that the continuous scanning setting was only being honoured on first run, leaving it "forgotten" after a successful scan. Now it is checked whenever the camera (video widget) is started.

donj541 2010-10-27 00:47

Re: mbarcode
 
The new version 0.2.3.5 works. Thanks

lardman 2010-10-30 13:28

Re: mbarcode
 
Right, I've got PythonQt plugins working. They now load :)

We need to decide on an API (take a look at the example python code in SVN to see my current ideas) and then check what we can do with Python. E.g. whether we can interact with the UI, which we should be able to do, or whether we'll need to pass the python code a wrapped window that it can draw to if it requests it.

Anyway I hope to soon have this finalised and then you guys can write some Python plugins :)

Edit: I've just pushed the plugin to the build queue, so you can have a mess around with it yourselves in 10min or so (assuming it builds ok! ;)).

Python scripts should go in /usr/share/mbarcode/pythonqt/

The script should contain a class whose name is the same as the filename (case sensitive of course). I'm attaching an example. Please do some testing, etc., and see what you can and can't get it to do and feedback so I can fix things and get this working asap :)


I can't upload the file, so here's a link to the SVN: https://garage.maemo.org/plugins/scm...de&view=markup

lardman 2010-11-01 23:29

Re: mbarcode
 
Hmm pretty much a singular lack of interest, oh well.

I've tried to create a window in my Python plugin without success - I need to hook up the stderr output from the Pytyhon interpreter to see what's going wrong. Help appreciated as ever :)

gri 2010-11-01 23:36

Re: mbarcode
 
Quote:

Originally Posted by lardman (Post 860286)
Hmm pretty much a singular lack of interest, oh well.

I've tried to create a window in my Python plugin without success - I need to hook up the stderr output from the Pytyhon interpreter to see what's going wrong. Help appreciated as ever :)

Did you create the window with a parent from c++? I once tried the same and the program crashed all the time when my python QDialog had a C++ QWidget as parent. Leaving out the parent window worked.

You could also try the sip package for creating a wrapper as I did for my project.

lardman 2010-11-04 08:22

Re: mbarcode
 
I've been trying to work out why I can call some methods of my Python plugin but not others, all the time working on the understanding that Python's stderr should end up in the terminal window. But apparently this is actually not the case.

I've added a sys.stderr = open("logfile", "w") type line to the __init__() method of the plugin class and can now see Python errors caused by my HandleBarcode() method.

Speaking of which, my error seems to be to do with Python not finding QWidget(). I've tried QtGui.QWidget() and also Qt.QWidget() (Qt should provide all the methods and objects provided by PythonQt) but in both cases I get an error.

I was then thinking that I'd just skip trying to get the imports from PythonQt and see if PyQt would work, but I see the version in the repo is marked as for PR1.2 - does it work on Pr1.3, or does it try to pull in the old Qt versions?

So to summarise, Python plugins are working, make sure you set stderr so you can see error output (I'll eventually add this line to the overall setup when the classes are loaded to avoid individuals needing to add this), and do let me know how you get on with it.


All times are GMT. The time now is 08:47.

vBulletin® Version 3.8.8