Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 07-24-2014, 05:42 PM   #1
kabirmaar
Member
kabirmaar began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Feb 2014
Device: none
Install of simple plugin works on Linux and Win but not on OSX

I started to work on plugin Kaliweb.

At the moment it is very simple start. It only brings QWebView opened like a drop down menu from main toolbar (screenshots at the bottom). My idea is to make a skeleton so one could bring to Calibre remote web service, local HTML/JS or web app running locally.

Code is at: https://bitbucket.org/kabiir/kaliweb/src

Problem: it installs seamlessly on vanilla Ubuntu Live and vanilla WindowsXP. It doesn't install completely on OSX. It doesn't ask for placement of the icon to toolbars. It just installs there but after restart I can't find the icon in Preferences>Toolbar. But, if I start Calibre from terminal like:
Quote:
calibre-debug -g
I can find the icon in Preferences>Toolbar and if I add it to main toolbar it works as expected.

If I run Calibre normally e.g. double click on icon in Applications, after it worked in debug mode, it still doesn't work. If I run it again as `calibre-debug -g` it works fine.

I think that code which should be considered is in InterfaceAction class (https://bitbucket.org/kabiir/kaliweb...master#cl-57):

Code:
   def genesis(self):
        icon_resources = self.load_resources(PLUGIN_ICONS)
        set_plugin_icon_resources(self.name, icon_resources)

        self.qaction.setIcon(get_icon(PLUGIN_ICONS[0]))
        self.old_actions_unique_map = {}
        self.us = UnitedStates()

        res = self.load_resources(PORTABLE_RESOURCES)
        os.makedirs(os.path.join(self.us.portable_directory, 'portable'))
        for resource in res.keys():
            logger.debug("RESOURCE KEY: {}".format(resource))
            with open(os.path.join(self.us.portable_directory,
                                   resource), 'wb') as portable:
                portable.write(res[resource])

        self.popup_type = QToolButton.InstantPopup

        base_plugin_object = self.interface_action_base_plugin
        do_user_config = base_plugin_object.do_user_config

        self.d = KaliwebDialog(self.gui,
                               self.qaction.icon(),
                               do_user_config,
                               self.qaction, self.us)
        m = QMenu(self.gui)
        self.qaction.setMenu(m)
        a = QWidgetAction(m)
        a.setDefaultWidget(self.d)
        m.addAction(a)
I don't have idea how to start to debug that. It is obviously something which affects only OSX but somehow it doesn't if it is run as `calibre-debug -g`.

Any idea?
Attached Thumbnails
Click image for larger version

Name:	kaliweb_in_action.png
Views:	363
Size:	164.5 KB
ID:	125803   Click image for larger version

Name:	OSX_finished_installation.png
Views:	353
Size:	304.9 KB
ID:	125804   Click image for larger version

Name:	OSX_running_kaliweb.png
Views:	345
Size:	270.9 KB
ID:	125805  
kabirmaar is offline   Reply With Quote
Old 07-24-2014, 11:26 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,849
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Look for debug output in console.app
kovidgoyal is offline   Reply With Quote
Advert
Old 07-25-2014, 09:35 AM   #3
kabirmaar
Member
kabirmaar began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Feb 2014
Device: none
`calibre-debug -g` on OSX behaves the same like `calibre` on Linux and Windows

One thing I didn't test before:
On OSX, I only used `calibre-debug -g` and when I use it like that everything works just fine. While installing it asks me for placement in main toolbar etc. and I did it. After restart and running again `calibre-debug -g` plugin is installed just like in Linux and Windows.

The only message I get while running `calibre-debug -g` is:
Code:
QCocoaView handleTabletEvent: This tablet device is unknown (received no proximity event for it). Discarding event.
`calibre-debug -g` on OSX behaves exactly the same like `calibre` on Linux and Windows. Unfortunately running `calibre` on OSX brings problems I described above.

I wonder what are the differences in running `calibre` and `calibre-debug -g` on OSX? Is there anything I can add to plugin which will run only on OSX so it gets installed and running?

I'm happy to explore the differences in calibre-debug and calibre. The only problem I see at the moment is compiling calibre with debugging/print statements on OSX. I never compiled Calibre on OSX, I run it inside of a Virtualbox on my Linux machine and I would prefer if I don't need to go through custom compiles of Calibre on OSX.
kabirmaar is offline   Reply With Quote
Old 07-25-2014, 09:38 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,849
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Is there some reason you are ignoring my advice to look for debug output in console.app when running the normal GUI?
kovidgoyal is offline   Reply With Quote
Old 07-25-2014, 09:41 AM   #5
kabirmaar
Member
kabirmaar began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Feb 2014
Device: none
Quote:
Originally Posted by kovidgoyal View Post
Is there some reason you are ignoring my advice to look for debug output in console.app when running the normal GUI?
I was looking in terminal output of `calibre-debug -g` and I posted the message I found there. I also looked if there is any .log file and couldn't find any so I thought output in terminal is the one you were refering to. I was following your advice as far as I understood it. I'm sorry for any mistake here. I'm doing my best.
kabirmaar is offline   Reply With Quote
Advert
Old 07-25-2014, 09:42 AM   #6
kabirmaar
Member
kabirmaar began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Feb 2014
Device: none
Quote:
Originally Posted by kovidgoyal View Post
Is there some reason you are ignoring my advice to look for debug output in console.app when running the normal GUI?
Hm. Let me see. I'll try now debug output when running normal GUI. Sorry didn't get that at first.
kabirmaar is offline   Reply With Quote
Old 07-25-2014, 10:08 AM   #7
kabirmaar
Member
kabirmaar began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Feb 2014
Device: none
Quote:
Originally Posted by kovidgoyal View Post
Is there some reason you are ignoring my advice to look for debug output in console.app when running the normal GUI?
OK, I'm probably missing something very obvious here. I'm sorry for that. I tried to run:
Code:
/Applications/calibre.app/Contents/console.app/Contents/MacOS/calibre
When I do that it doesn't give me the top bar (OSX one) where I can find Preferences and without it I don't know how to install plugin [screenshot attached]. I installed it then in normal Calibre and then run again:
Code:
/Applications/calibre.app/Contents/console.app/Contents/MacOS/calibre
Nothing happens and again no Preferences so I can't find if there is a icon in Toolbar menu. Still the only output in terminal is still:
Code:
QCocoaView handleTabletEvent: This tablet device is unknown (received no proximity event for it). Discarding event.
Also I couldn't find any debug file in /Applications/calibre.app/Contents/console.app/ or any other directory. So I'm stuck. Is there a web page where I can learn how to debug on OSX?

As said above I'm probably missing something completely obvious and for that I apologise. I would highly appreciate if anyone can point me to a documentation or tell me here how I'm supposed to debug this.
Attached Thumbnails
Click image for larger version

Name:	OSX_no_preferences.png
Views:	315
Size:	270.1 KB
ID:	125839  

Last edited by kabirmaar; 07-25-2014 at 10:11 AM.
kabirmaar is offline   Reply With Quote
Old 07-25-2014, 10:55 AM   #8
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,849
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
console.app is an os x application that shows you the terminal output from a GUI program. Run calibre as normal and start console.app, anything calibre writes to stdout and stderr will show up in console.app
kovidgoyal is offline   Reply With Quote
Old 07-25-2014, 11:07 AM   #9
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
http://en.wikipedia.org/wiki/Console_(OS_X)
eschwartz is offline   Reply With Quote
Old 07-26-2014, 07:49 PM   #10
kabirmaar
Member
kabirmaar began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Feb 2014
Device: none
Console.app showed where was the problem. Thank you people.

I was wrong thinking anything Qt related was problematic. The buggy part was logging which tried to open file and not having enough of permissions to do that. Disabling logging solved the problem.
kabirmaar is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Win 8.1 64 Bit Version 1.27.0 - Hang on install AfricanTech Devices 1 03-11-2014 12:41 AM
Calibre on Win 7 install path character limit johnswolter Calibre 2 10-02-2012 08:26 PM
How-To: Tether the Kindle 3 (Win/OS X/Linux) excelangue Kindle Developer's Corner 6 02-11-2012 01:54 PM
ereader for windows, linux and OSX lookin Reading and Management 3 06-23-2011 04:25 AM
Developing a plugin on osx 10.5 macuser15905 Plugins 2 08-28-2009 03:54 PM


All times are GMT -4. The time now is 07:55 PM.


MobileRead.com is a privately owned, operated and funded community.