![]() |
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 ;)
|
Re: mbarcode
Thanks dragly. Very usefull app. Looking forward for the new version soon.
|
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 :) |
Re: mbarcode
Seems like they only needed to be rebuilt.
All packages are built and available in extras-devel now. |
Re: mbarcode
Quote:
|
Re: mbarcode
The new version 0.2.3.5 works. Thanks
|
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 |
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 :) |
Re: mbarcode
Quote:
You could also try the sip package for creating a wrapper as I did for my project. |
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. |
Re: mbarcode
when i use mbarcode it reads codes ok, but no plugin (isbn,..) ever comes up with anything i always only get the copy button .. when i start from the console i get messages about isbn plugin getting stuff,.. but still nothing in mBarcode itself .. any ideas?
maybe this is answered somewhere before in this thread but it'S v long and i just briefly read over it.. if so sorry for asking again .. |
Re: mbarcode
@LordVan: No worries ;)
The reason is most likely some issues with the update to PR1.3. I suggest you reinstall both mbarcode and the plugins package. That should put things back to normal. Even if you have successfully updated both mbarcode and maemo to the newest version, there seems to be a problem getting the plugins loading. The last report I got was that a reinstall fixed the issue. |
Re: mbarcode
Thanks . apt-get remove <insert everything mbarcode here> and then an apt-get install <..> did the job fine for me. This program rocks ;)
btw i was thinkig it'd be really cool to have a plugin which talks to some sort of personal 'library' thing so i scan a manga and it tells me if i go tthat volume or still need vol XX of manga YY .. and put new ones on a wishlist ^^ or is there something like that already? |
Re: mbarcode
I'm working on it, should have some code out in the next couple of weeks
|
Re: mbarcode
1 Attachment(s)
In fact here's my start at some code (attached).
If anyone fancies doing some hacking on it please help yourselves. The plan is that it runs as a stand-alone Python app and data is passed to it (and it is started if necessary) via a DBus call from mBarcode. Which leads me onto the second point - this Python plugin is driving me mad! I've decided that it's probably easier for people to write a Python plugin to call QtDbus methods rather than making a rather complex ExternalDBusPlugin plugin for mBarcode (complex because the plugin conf file would need to contain regex expressions to determine what should be done with the barcode contents and how it should be turned into a DBus message - thinking of e.g. converting a geo:// payload to a DBus call to open a lat/lon in the wonderful Ovi Maps) The Python plugin stuff is curious - despite stdout/stderr not supposed to be redirected, there is no output at the terminal when the plugin is loaded by mBarcode. If, however, in the __init__() method of the Python plugin class I set a redirect for the sys.stderr filehandle, I can write to a file. Very odd, and rather annoying as it then requires the class to at least be initialised before I can see any error output. I need to try setting the redirect in the main Python "workspace" before each plugin script is loaded. I've been working through this by writing a script which runs at the command line, then trying to work out why it won't run as a plugin - curiously I see no output (which I presume indicates an error before the class is initialised) if I try to import things like PyQt4, which doesn't make me overly optimistic for the use of *Dbus imports. Any help trying to work out what's going on appreciated as ever. |
Re: mbarcode
hmm, seems to just be down to "import PyQt4" causing an error, I wonder if the search path is causing troubles (standard packages such as sys,os etc can be imported as can PythonQt itself).
need to do more digging tomorrow |
Re: mbarcode
hmmkeeps giving me indentation errors here. maybe will check it out in more detail tomorrow.
|
Re: mbarcode
1 Attachment(s)
so .. i went and fixed your indentation errors, missing (), 'pass' (empty blocks) and missing self. where u tried to call class methods without that, else if -> elif , missing \ in some places,..
which python version are you testing on? the 2.5 on my N900 only is able to run the version of the file attached now (it does complain about missing .service file but at least it parses now ;)) there r still more bugs i was too lazy to fix with khteditor / pygtkeditor on my n900 but they didn'T stop it parsing the file so i left it for now. |
Re: mbarcode
I was actually running it with Python2.5 (under Windows XP) on my netbook (as it's easier that way to code and test in front of the TV).
But yeah, I've added some new code recently and not got round to running it so there were no doubt quite a few errors. Thanks for the fixes. I'll stick the code up on SVN which should make it easier for people to add changes. |
Re: mbarcode
heh ok, but keep in mind that i just made it parseable there r quite a few bugs left that'll keep it from actually working..
|
Re: mbarcode
I'll do some cleaning up with evening and upload it to the ItemDB Garage SVN, once the project is setup click to be added to the project.
Yeah it also needs the service file to actually do anything useful (which is something that Windows doesn't do - DBus, so I'd not bothered until I had more code down, and indeed until I had a way of passing data to the app over DBus). |
Re: mbarcode
actually there is some dbus implementation on windows it comes with kde-installer for win32 in any case ;)
|
Re: mbarcode
hi
is mbarcode in extras-devel or has it come to extras thanks |
Re: mbarcode
http://maemo.org/packages/view/mbarcode/ says 0.0.8 in -testing and 0.2.4 in -devel (imho the -devel version is so much better ;))
|
Re: mbarcode
The version in -testing is a relic, we'll push through the -devel version to extras proper quite soon (via -testing of course), but I'd like to get Python plugins working first (and we also need to fix a few other odds and sods, including adding some more payload types for 2D barcodes)
|
Re: mbarcode
1 Attachment(s)
Current test Python plugin for use with mbarcode-plugin-pythonqtwrapper 0.0.2 (in extras-devel).
Rename to .py and place in /usr/share/mbarcode/plugins/pythonqt/ Note that I've not worked out how to get any UI items to show, but you should see the text printed out at the terminal. Work in progress. If anyone fancies hacking on this then I'd appreciate the help. What I'd really like is for the plugin to be able to generate and populate its own window, but I fear the event loop won't run for the Python objects, so I'll have to have a look at the low level code that implements that and see if I can get it working somehow. |
Re: mbarcode
The alternative method, which is implemented in PythonPluginWrapper (in SVN, note the lack of a Qt in the name, to differentiate the two plugins) is to cast the python plugin to a C++ class and call methods on it directly from C++ (using SIP bindings) - I'm not sure if this is a better approach, but it currently segfaults. If anyone fancies working on that, that would also be useful :)
|
Re: mbarcode
Hmm, regarding these plugins, I guess I may need to use locks when the Python-C functions are called by the sinks assuming the sinks run in different threads (though I need to check that). In that case I'll also need to enable Python threading when I initialise the interpreter.
|
Re: mbarcode
well i'd love to if i got my scratchbox to compile something useful *and* display tinyx(was it tinyx? nm doesn't matter u know what i mean ;) ;)
|
Re: mbarcode
Here is one use case (mine :) ) I feel mbarcode doesn't address adequately presently:
I have a set of storage boxes, which each have a QR-encoded sticker with a URL in them pointing to a page that describes the contents of the box along with a few photos of the contents. I would like to whip out my N900, point it towards the boxes and have my web browser be redirected to the said URL without needing other interaction; should I point to another box, the browser should be redirected to that new page, again without any interaction other than moving the camera. Now, maybe mbarcode isn't the application for this special use case. But it'd be nice if it were :). An alternative to use mbarcode would in my mind be a fork that would use a webkit widget for displaying the page. That way it could still provide its own menu for options. |
Re: mbarcode
I see no problem with this usecase. We need to implement a plugin selection dialog in any case, in which one could check the default plugin to handle a given payload. Then all we'd need to do is create a setting such that the results window is not displayed if not wanted (it provides the copy button, but with a default plugin has no other use).
Regarding opening the web-browser, there are two ways it can open - either in a new window, or in the same window; a settings dialog for the qrcode plugin could allow the user to select which of these happens. I'll add these to my ToDo list :) |
Re: mbarcode
Right, hugopl (in #pyside) pointed out that my widget variable is being decref'd as soon as the window is created, so simply making the widget a member of the class (e.g. adding it as self.widget in __init__() sorts that out and displays the window).
Looks like Python scripting is go! I'll come up with an example code tomorrow, and also one which uses DBus to notify/start external apps (e.g. Map apps for geo:// payloads). |
Re: mbarcode
@flux might be interesting to see this as an option for mbarcode as a plugin or something but i duno if mbarcode does support automatic action.
|
Re: mbarcode
Quote:
Quote:
|
Re: mbarcode
Ok, so MECARD decoding now works, I'll push an update to extras-devel later on today (mbarcode-plugin-qrcode)
|
Re: mbarcode
How would I implement this: http://www.ebayinc.com/content/press...20100623006637 or something like this?
I realise this is an iPhone app, so would RedLaser need to do it, or would I be able to? (If I could write the plugin for mBarcode) |
Re: mbarcode
sounds like basically they want to save ppl with iPhones from having to type the EAN,.. code into whatever selling app .. since afaik there's no ebay listing app for the n900 this is not really much of an option - u can of course use mbarcode to read the ean , copy and paste it into ebay-webform .. unless you are planning to write an ebay listing app .. ^^
|
Re: mbarcode
Quote:
Now that we have working Python plugins, it should be significantly easier to do the weblookups/scraping required to do this. If there's any exsiting Python code out there that we could start with to save writing the whole thing from scratch, that would be good :) |
Re: mbarcode
Quote:
E.g. http://developer.ebay.com/devzone/sh...s_nv_json.html |
Re: mbarcode
Quote:
|
| All times are GMT. The time now is 17:51. |
vBulletin® Version 3.8.8