Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 06-21-2010, 03:57 PM   #1
artisticforge
Member
artisticforge began at the beginning.
 
Posts: 17
Karma: 30
Join Date: Jun 2010
Location: earth
Device: iPad
calibre and devices questions

hello;

having determined with griker's help why calibre did what it did i have several questions.

how does calibre 'know' which periodicals have all ready been uploaded to the devices?

assuming that calibre stores this information somewhere, where does calibre store this information?

i assume that calibre assumes that there is only one device that it is uploading to automatically. is it correct to assume that calibre does not make any differentiation between devices, there is no way to have calibre upload periodicals to the 32GB iPod but not the 64GB iPod nor the 16GB iPod.

those are my questions for now.
artisticforge is offline   Reply With Quote
Old 06-21-2010, 05:47 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: 26,328
Karma: 5382313
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
calibre simply uploads news to whichever device is first connected after the news download completes.
kovidgoyal is offline   Reply With Quote
Old 06-21-2010, 08:03 PM   #3
artisticforge
Member
artisticforge began at the beginning.
 
Posts: 17
Karma: 30
Join Date: Jun 2010
Location: earth
Device: iPad
hello;

thank you, that is what griker and i had assumed.

how does calibre remember which periodicals have been uploaded and which have not been uploaded to a device?

where does calibre store the information concerning the periodicals and devices?
artisticforge is offline   Reply With Quote
Old 06-21-2010, 10:48 PM   #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: 26,328
Karma: 5382313
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
every time news is downloaded its id in the calibre db is stored in a config file. Then when a device is connected, the news is sent and the id is deleted from the config file.
kovidgoyal is offline   Reply With Quote
Old 06-22-2010, 12:54 AM   #5
artisticforge
Member
artisticforge began at the beginning.
 
Posts: 17
Karma: 30
Join Date: Jun 2010
Location: earth
Device: iPad
calibre and devices

Quote:
Originally Posted by kovidgoyal View Post
every time news is downloaded its id in the calibre db is stored in a config file. Then when a device is connected, the news is sent and the id is deleted from the config file.
would you be willing to provide the name and location of the config file?
artisticforge is offline   Reply With Quote
Old 06-22-2010, 01:06 AM   #6
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: 26,328
Karma: 5382313
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
IIRC the name is dynamic.pickle and the location is easily accessed from Preferences->Advanced
kovidgoyal is offline   Reply With Quote
Old 06-23-2010, 02:42 AM   #7
artisticforge
Member
artisticforge began at the beginning.
 
Posts: 17
Karma: 30
Join Date: Jun 2010
Location: earth
Device: iPad
hello;

i have not programmed in python before so it is taking me time to read and understand the source code. slowly but surely i am beginning to understand the 'class DynamicConfig'
. concerning ~/Library/Preferences/calibre/dynamic.pickle (this is on macosx) is there any documentation concerning the structure of the file. using 'hexdump -C dynamic.pickle' i am able to determine some of the structure. to be honest it is strictly hit-n-miss.

thank you for your replies.
artisticforge is offline   Reply With Quote
Old 06-23-2010, 08:29 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: 26,328
Karma: 5382313
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Its a python pickle file (persistent object storage). Use the pickle module in python to read its contents
kovidgoyal is offline   Reply With Quote
Old 06-25-2010, 01:59 AM   #9
artisticforge
Member
artisticforge began at the beginning.
 
Posts: 17
Karma: 30
Join Date: Jun 2010
Location: earth
Device: iPad
hello;

i have been attempting to use the pickle module and have come to the conclusion that while i am calling it correctly the dynamic.pickle file itself is causing python to search for the module calibre.utils.config . from what i am able to figure out, in the very beginning of the dynamic.pickle file is the name of the module and defined class that was used to create the pickle file. in this case that is calibre.utils.config.DynamicConfig .
to be able to use python to unpickle the pickle file i need to create a 'package' of the necessary python code from calibre and install it in the python sys.path so that python is able to find the module 'calibre.util.config' which will be used to unpickle the dynamic.pickle file. python appears to have the idea that the module and class that wrote the pickle file should be used to unpickle the pickle file.

the alternative of using python would be to use perl or straight c programming to unpickle the dynamic.pickle file. the disadvantage of doing so is not knowing what the structure of the dynamic.pickle file is. i am then back to hit-n-miss.

the upside is that after years of avoiding it i am learning python.
i am learning why not to use 'canned' routines to save configuration information.

anyway, i will keeping plodding forward.
artisticforge is offline   Reply With Quote
Old 06-25-2010, 02:04 AM   #10
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: 26,328
Karma: 5382313
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Use

calibre-debug
kovidgoyal is offline   Reply With Quote
Old 06-25-2010, 03:22 AM   #11
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,094
Karma: 780247
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
Quote:
Originally Posted by artisticforge
i am learning why not to use 'canned' routines to save configuration information.
the pickle file is just a serialization of a Python object which is why the original class file is needed to make sense of it. The advantage from a developers point of view is that no special code is needed to read/write the configuration information as one simply re-instantiates the original python object.

Exactly the same issue would apply in any language that allow objects to be serialized and then reloaded.
itimpi is offline   Reply With Quote
Old 06-25-2010, 05:36 AM   #12
chaley
"chaley", not "charley"
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: 5,798
Karma: 1216080
Join Date: Jan 2010
Location: France
Device: Many android devices
I am not sure what you want to do, but it seems like you want to start by seeing what it in dynamic.pickle. The following code will do that.

Create a file foo.py containing
Code:
import pickle

stuff = pickle.load(open('dynamic.pickle', 'rb'))
for k in sorted(stuff.keys()):
    print '%s: %s'%(k, stuff[k])
Copy the dynamic.pickle file you want to examine to the same directory as xxx.py (or change the path in the code).

From a command line, run
Code:
calibre-debug -e foo.py
The content will be printed as key: value. Some of the values are binary, so will print strangely.

When I run it, the first few lines of the output are
Code:
BooksViewcolumn width map: {u'rating': 80, u'tags': 258, u'series': 120, u'title': 192, u'authors': 184, u'ondevice': 70, u'timestamp': 69}
BooksViewcolumn widths: (232, 195, 140, 87, 79, 237)
DeviceBooksViewcolumn width map: {}
DeviceBooksViewcolumn widths: (340, 102, 88, 69, 380)
chaley is offline   Reply With Quote
Reply

Tags
periodicals, uploads

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre with Multiple Devices? Chrysanthemum Calibre 5 07-24-2010 04:15 AM
Calibre 0.7 and Multiple devices itimpi Calibre 2 06-05-2010 05:45 AM
Using Multiple Devices with Calibre - Problem PaulSmi Calibre 3 04-05-2010 10:48 PM
PDF questions for PRS 600 (and other 6" devices) MLDaeni Which one should I buy? 11 12-08-2009 06:54 AM
Finally thinking to buy an ebook reader, last questions, PDF's, large screen devices fuzzy_dunlop Which one should I buy? 2 10-06-2009 06:30 PM


All times are GMT -4. The time now is 12:24 PM.


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