Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 05-14-2017, 05:06 PM   #196
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by kovidgoyal View Post
@chaley: From looking at the code, the best approach seems to be to allow TemplateFormatter to take an argument formatter_funcs which defaults to None. When None, it uses the global formatter_funcs, otherwise it uses the local one. Then have each db object keep its own copy of the formatter_funcs() with its funcs loaded. In get_metadata()/proxy_metadata() it will pass in a formatter to the Metadata() object that uses this copy instead of the gloabl formatter_funcs()

I could be way off base, however.
I am worried that this won't be reliable in the face of creating formatters on the fly, something that happens. There is also the fact that the current global deals with functions from multiple libraries, both when adding and deleting, and I think it gets it wrong if there are function name conflicts.

But that aside, your suggestion is where I was leaning, although if we go this far then we might want to get rid of the global. I am thinking the following might work:
a) we add a positional parameter to TemplateFormatter.
b) the db layer keeps the functions for that db, loading them when the library is opened (as it does today)
c) the function editing layer manipulates the db copy instead of the global list.
d) the db copy is serialized to the db when closed
e) the global function management stuff is removed
then function state becomes private to the db (library). Anyone who creates a formatter would need to provide the dict of functions. This implementation would permit defining functions using a non-GUI API, which might be interesting to do some day.

The biggest problem with this idea is that it is an incompatible change that would break plugins that use TemplateFormatter (are there any of these?). Making the argument named instead of positional deals with this. Perhaps the compromise is if the named argument is None then the functions are loaded from the current GUI db. But that leads to the problem where we don't have a current GUI so don't have access to the db, which will happen in helper functions. This pushes for leaving the global as a fallback or disabling custom template functions in plugin invocations of TemplateFormatter with no GUI. This might be acceptable given that the number of such invocations is probably zero.

A second incompatibility is really a bug. If two libraries have functions with the same name then the second one wins. Which one is "second" depends on dict iter order, which means it is "random". Removing that ambiguity might change behavior, but I think it changes it for the better.
chaley is offline   Reply With Quote
Old 05-14-2017, 08:15 PM   #197
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,355
Karma: 169098492
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by eschwartz View Post

Quote:
Originally Posted by kovidgoyal View Post
FYI: You should use http://127.0.0.1 not 0.0.0.0 as the server IP address.
Is this like a "calibre won't work" thing, or a best-practices-when-referencing-localhost thing? Because zeroes are easier to type really really fast.
Mostly that 127.0.0.1/32 is defined as part of the loopback address block (127.0.0.0/8) -- see RC5735. I've rarely seen any other members of that block used.

0.0.0.0 is defined as part of the 0.0.0.0/8 "current network" block in the same RFC. In practice using either the all zeroes or all ones addresses for an address block is not a good idea since some software treats the all zeroes address in the same way as the all ones address, acting as if it was the broadcast address.
DNSB is offline   Reply With Quote
Advert
Old 05-14-2017, 09:29 PM   #198
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: 45,377
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
@charles: IMO we should keep a global as a fallback and make the argument to the formatter class a named argument. Reduces chances of breaking backwards compat.

In contexts where there is no GUI and callers do not provide a function set, the template formatter can just fail, as it does today.
I think it's good if we solve this before 3.0. Since 3.0 has other backwards comapt breaks, might as well get them all out of the way at once. Although I think if we keep the global as fallback, there shouldn't be any problems in practice.

It might be a it painful to have the function changing code change two sets of formatter objects, but it shouldn't be to bad, since I dont think there are many places where functions are modified.

Last edited by kovidgoyal; 05-14-2017 at 09:32 PM.
kovidgoyal is offline   Reply With Quote
Old 05-15-2017, 06:06 AM   #199
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by kovidgoyal View Post
@charles: IMO we should keep a global as a fallback and make the argument to the formatter class a named argument. Reduces chances of breaking backwards compat.

...
I pushed a set of changes to my vs2015 repository copy on github.

I tested it using two libraries, lib A with no user template functions and lib B where a user-defined function was used in a composite column. Before the change:
  • the content server saw function errors when looking at lib B when the GUI is showing lib A.
  • the content server saw correct content when the GUI is showing lib B.
After the change, the content server shows correct content no matter which library the GUI is showing.

The change should be fully compatible. It is possible that performance has gone down a smidgen, but not enough for me to measure on my test libraries.
chaley is offline   Reply With Quote
Old 05-15-2017, 06:57 AM   #200
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: 45,377
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
@chaley: Thanks, looks good.

@Terisa: Thanks to chaley your problem should be fixed in the next beta.
kovidgoyal is offline   Reply With Quote
Advert
Old 05-15-2017, 12:36 PM   #201
Tuxracer
Junior Member
Tuxracer began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jul 2015
Device: iPad
Hi,

i have a problem using the content-server on Win10Pro 64Bit.

- Calibre-version 2.99 from 13th May
- Server is running on Port 8080
- open the webside directly on the server http://localhost:8080 is working fine
- open the webside from a Mac-Notebook http://<Server-IP>:8080 , the webside shows me the libary, select this libary it take round about 30 sec. i get a timeout:

--

Fehler beim Laden der Bücher aus der Calibre-Bibliothek – Fehlermeldung:
( Error loading the books from the Caliber library - Error message: )
Failed to communicate with "interface-data/books-init?library_id=Calibre_Bibliothek&sort=timestamp. desc&1494865627723", timed out after: 30 seconds

--
The some via iPad going to the OPDS-directory ( http://<server-IP>:8080/opds/

The Server self is reachabel, the is another webservice running on this maschine and this works normal. When i fallback to 2.8x fix the problem.


I do the same on my MacBook and there it works normal, also from a iPad via OPDS.


On my server the libary is stored on a slow harddisk, on the Macbook on the internal Flashdrive.

Any idea what i can check ?

Thanks in advance

Thomas
Tuxracer is offline   Reply With Quote
Old 05-15-2017, 12:46 PM   #202
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: 45,377
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Look in the server log (preferences->sharing by net) and make sure your antivirus/firewall is not blocking calibre.exe
kovidgoyal is offline   Reply With Quote
Old 05-16-2017, 03:32 AM   #203
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: 45,377
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Released beta version: 2.99.5 with the following changes
  1. Make the per user library restriction dialog in preferences a little friendlier
  2. Add a button on the home page to show the currently logged in user
  3. Fix potential XSS vulnerabilities when displaying comments in the browser, by using a sandboxed iframe for them
  4. Fix columns using a template that uses user defined functions not working properly
  5. calibre-server.exe: If no libraries are specified, use all the libraries known to the GUI
  6. Fix covers not showing up in browser if content server is restarted in GUI
  7. Various minor internal fixes to the code that runs in the browser
kovidgoyal is offline   Reply With Quote
Old 05-17-2017, 04:42 AM   #204
nqk
Fanatic
nqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beauty
 
Posts: 564
Karma: 32228
Join Date: Feb 2012
Device: Onyx Boox Leaf
I found the following issues:
1) Cover page loses a part of the image on the right. (Cover generated by Polish Book)
2) When I tap on an internal link (one way link), it jumps to the END of the target file rather than the top.
nqk is offline   Reply With Quote
Old 05-17-2017, 05:26 AM   #205
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: 45,377
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
@nqk: For (2) is this a link pointing to an anchor in the file or just to the file?
kovidgoyal is offline   Reply With Quote
Old 05-17-2017, 07:29 AM   #206
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: 45,377
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
@nqk: this will fix (1) but note that you have to reload the book (right click or tap in the top area and choose reload).

https://github.com/kovidgoyal/calibr...d378dc2ffc9644


I cannot reproduce (2), can you attach a book that shows this behavior.
kovidgoyal is offline   Reply With Quote
Old 05-17-2017, 08:37 AM   #207
Maxine2
Junior Member
Maxine2 began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Nov 2015
Location: London, U.K.
Device: Kobo Aura H20 Edition 2
Thumbs up Hangs

Hiya there, I am having the same problem. I used the steps you advised. It worked so much better however not perfectly and did freeze after trying to select some items and did not open my books.
the quote from the debug from mine was:
calibre 2.85.1 [64bit] embedded-python: True is64bit: True
Windows-8-6.2.9200 Windows ('64bit', 'WindowsPE')
('Windows', '8', '6.2.9200')
Python 2.7.9
Windows: ('8', '6.2.9200', '', 'Multiprocessor Free')
Qt: Untested Windows version 10.0 detected!
Successfully initialized third party plugins: DeDRM (6, 0, 9) && Overdrive Link (2, 12, 0) && Goodreads Sync (1, 10, 1) && Find Duplicates (1, 6, 2) && Kobo Utilities (2, 5, 2) && KoboBooks (1, 0, 0) && Goodreads (1, 1, 12) && KoboTouchExtended (2, 8, 2) && Reading List (1, 6, 6) && Kindle Collections (1, 7, 17) && KindleUnpack - The Plugin (0, 81, 4)
devicePixelRatio: 1.0
logicalDpi: 96.0 x 96.0
physicalDpi: 91.9457013575 x 91.8072289157
Starting up...
DEBUG: 0.0 KoboUtilites::action.py - loading translations
DEBUG: 0.0 KoboUtilites::dialogs.py - loading translations
DEBUG: 0.0 KoboUtilites::action.py - loading translations
DEBUG: 0.0 HttpHelper::__init__: proxy=None
DEBUG: 2.0 No Kobo Touch, Glo or Mini appears to be connected
DEBUG: 2.0 rebuild_menus - self.supports_ratings=None, self.supports_tiles=None
DEBUG: 2.0 KoboUtilities:set_toolbar_button_tooltip - start: text='None'
DEBUG: 2.0 KoboUtilities:set_toolbar_button_tooltip - setting to text='Utilities to use with Kobo ereaders

Driver: KoboTouchExtended'
C:\Users\Maxine\Documents\My Kindle Content is not a valid directory to watch for new ebooks, ignoring
Started up in 3.46 seconds with 1219 books

Hope you can help.

Oh and secondly, if I can get this sorted I would happily test the Calibre 3.0 beta.
Your work is fantastic and Calibre is my favourite programme on my PC. (trust me I have a lot). I love it.
keep up the good work.

Thanks in advance,

Maxine

Quote:
Originally Posted by kovidgoyal View Post
A browser for what?


As for the hang,
Run it with

calibre-debug -g

and post the output
Maxine2 is offline   Reply With Quote
Old 05-17-2017, 08:50 AM   #208
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,796
Karma: 146391129
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by kovidgoyal View Post
Regarding calibre portable -- i must say I am at a loss. I cant imagine what could cause only calibre portable and not normal calibre to hang -- calibre portable is not that different from normal calibre (its just a couple of environment variables that control where to look for config files and libraries).

Hopefully something will turn up -- either a brainwave or some common factor that identifies the problem as more people reproduce it.
The Calibre Portable 2.99.5 installer is unstable. Sometimes it crashes and sometimes it works. This is with Windows 10 64-bit.
JSWolf is offline   Reply With Quote
Old 05-17-2017, 09:55 AM   #209
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: 45,377
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by JSWolf View Post
The Calibre Portable 2.99.5 installer is unstable. Sometimes it crashes and sometimes it works. This is with Windows 10 64-bit.
The installer is literally identical to the installer used for calibre 2.x

So do you mean calibre portable itself or its installer
kovidgoyal is offline   Reply With Quote
Old 05-17-2017, 10:20 AM   #210
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: 45,377
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
@Maxine: Sorry my advice about running calibre-debug -g was incorrect (if you do that it runs the old calibre 2.x). I assume you are experiencing the same hang with calibre portable as was described earlier in this thread? If you are getting hangs even with running calibre-debug -g then the problem is not in the beta at all, since calibre-debug -g runs the non beta calibre.

Anybody else also experiencing the hand with 2.99.5?
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Beta testers needed kovidgoyal Calibre 54 05-20-2016 12:34 PM
Windows beta testers needed kovidgoyal Calibre 19 02-08-2016 04:38 PM
Beta testers for calibre 2.0 needed kovidgoyal Calibre 142 05-08-2015 04:44 AM
Arc Updated Jelly Bean release - Beta testers needed kobo-adrian Kobo Tablets 19 05-23-2013 09:32 PM
Web Browsing from the Ebw-1150 - BETA Testers needed Nate the great Fictionwise eBookwise 26 09-21-2008 11:52 PM


All times are GMT -4. The time now is 02:36 PM.


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