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 01-21-2009, 02:52 PM   #16
ilovejedd
hopeless n00b
ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.
 
ilovejedd's Avatar
 
Posts: 5,111
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
Help, the CALIBRE_CONFIG_DIRECTORY doesn't seem like it's doing anything. First I tried the batch file above, didn't work. Then I switched %cd% for an absolute path, didn't work either. Last, I added it via My Computer >> Properties >> Advanced >> Environment Variables and still didn't work.

I tried it on two computers (XP Pro SP2, Vista Ultimate SP1) and one virtual machine (XP Pro SP3) using Calibre 0.4.128 (what I have installed) and Calibre 0.4.127 (version where the CALIBRE_CONFIG_DIRECTORY was introduced based on the changelog).

Thanks!
ilovejedd is offline   Reply With Quote
Old 01-21-2009, 03:11 PM   #17
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,835
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You can check what config directory calibre is using with

Code:
calibre-debug -c "from calibre.utils.config import config_dir; print config_dir"
kovidgoyal is offline   Reply With Quote
Advert
Old 01-21-2009, 04:50 PM   #18
ilovejedd
hopeless n00b
ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.
 
ilovejedd's Avatar
 
Posts: 5,111
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
That's just it. No matter what I try, Calibre still uses %appdata% and ignores the value of the CALIBRE_CONFIG_DIRECTORY environment variable. It doesn't matter if %appdata%\calibre already exists or not. Calibre still uses it.
Attached Thumbnails
Click image for larger version

Name:	Environment Variables.png
Views:	342
Size:	14.4 KB
ID:	21865  
ilovejedd is offline   Reply With Quote
Old 01-21-2009, 04:57 PM   #19
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,835
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Its not picking up the environment variable in that case. What does the following print out

Code:
calibre-debug -c "import os; print os.environ['CALIBRE_CONFIG_DIRECTORY']"
kovidgoyal is offline   Reply With Quote
Old 01-21-2009, 05:15 PM   #20
ilovejedd
hopeless n00b
ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.
 
ilovejedd's Avatar
 
Posts: 5,111
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
Code:
Traceback (most recent call last):
  File "debug.py", line 105, in <module>
  File "debug.py", line 89, in main
  File "<string>", line 1, in <module>
  File "os.pyo", line 423, in __getitem__
KeyError: 'CALIBRE_CONFIG_DIRECTORY'
Thank you very much for the extremely quick replies.

Additional info:
This was using Calibre 0.4.128.
ilovejedd is offline   Reply With Quote
Advert
Old 01-21-2009, 05:26 PM   #21
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,835
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That means the variable is not present in the process environment. Try rebooting.
kovidgoyal is offline   Reply With Quote
Old 01-21-2009, 05:42 PM   #22
ilovejedd
hopeless n00b
ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.
 
ilovejedd's Avatar
 
Posts: 5,111
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
Thanks for the help with troubleshooting. Unfortunately, having to reboot the PC kinda defeats the whole "portable" thing.

Is it possible to include parsing of a config.ini/calibre.ini file inside the calibre install directory? The .ini file could then contain the path of the config files and (and maybe even the path of the library/database) relative to the calibre directory.

Thanks!
ilovejedd is offline   Reply With Quote
Old 01-21-2009, 05:48 PM   #23
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,835
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You only need to reboot if you're adding the environment variable via the control panel. You probably just have to modify your bat file to get it to correctly set the environment variable. Again some one familiar with bat files will have to help you with that
kovidgoyal is offline   Reply With Quote
Old 01-21-2009, 07:51 PM   #24
ilovejedd
hopeless n00b
ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.
 
ilovejedd's Avatar
 
Posts: 5,111
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
Thanks for the tip. Finally figured out my mistake.

I was using:
Code:
set CALIBRE_CONFIG_DIRECTORY = %CD%
instead of:
Code:
set CALIBRE_CONFIG_DIRECTORY=%CD%
Yep, stupid spaces got me.

Tested the fixed batch file on three systems (two PCs w/o Calibre and one VM with Calibre already installed). It seems to work quite well. It didn't overwrite the config files in the native installation of Calibre which is a good thing. Oh well, I'm just happy it doesn't leave any traces in the host computer.

portablecalibre.bat
Code:
@echo off
cd config
set CALIBRE_CONFIG_DIRECTORY=%cd%
cd..
cd calibre
calibre.exe --with-library  ..\calibre-db
exit
Thanks again for all the help and thanks for this wonderful program.
ilovejedd is offline   Reply With Quote
Old 01-22-2009, 02:51 AM   #25
sn123py
Member
sn123py began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Jan 2009
Device: Sony PRS-T1, Kindle4NT
would be in short:

portablecalibre.bat
Code:
@echo off
set CALIBRE_CONFIG_DIRECTORY=%cd%config
cd calibre
calibre.exe --with-library  ..\calibre-db
exit
regards,
Friedhelm.
sn123py is offline   Reply With Quote
Old 02-09-2009, 12:34 AM   #26
markz68
Junior Member
markz68 began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Feb 2009
Device: iPod Touch/Kindle on order
Quote:
Originally Posted by sn123py View Post
would be in short:

portablecalibre.bat
Code:
@echo off
set CALIBRE_CONFIG_DIRECTORY=%cd%config
cd calibre
calibre.exe --with-library  ..\calibre-db
exit
regards,
Friedhelm.
So, what directory structure would I use on my USB key for this .bat file to work? And where do you put the .bat file? In the program directory?
markz68 is offline   Reply With Quote
Old 02-09-2009, 04:17 AM   #27
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,552
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
You are obviously not experienced at reading batch files

The bat file assumes that relative to where it is located on the USB disk you have the following sub-folders:
config
calibre
calibre-db
The config folder is where calibre is going to store its private config information; the calibre folder has a copy of the calibre binaries (in effect a copy of what is normally installed to C:\Program Files\calibre); and the calibre-db folder is where the calibre database is located.

If you want a different folder structure you can modify the .bat file accordingly.

You would normally navigate to the .bat file on the USB stick using Windows Explorer, and then double-click/open the batch file to run it.
itimpi is offline   Reply With Quote
Old 05-18-2011, 04:39 AM   #28
athrarn
Junior Member
athrarn began at the beginning.
 
Posts: 1
Karma: 10
Join Date: May 2011
Device: Nook
Example.

Hi, can you provide a full example of a valid batch?

Thanks.
athrarn is offline   Reply With Quote
Old 05-18-2011, 04:43 AM   #29
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,552
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
Quote:
Originally Posted by athrarn View Post
Hi, can you provide a full example of a valid batch?
Not sure what you mean?

The calibre-portable.bat file that is supplied in the resources sub-folder of the calibre install IS a valid batch file. If you use the folder structure mentioned in at the top in the comments then it will work unmodified. If you want to use alternative locations for any of the files then you need to edit in the paths you want to use instead.
itimpi is offline   Reply With Quote
Reply

Tags
calibre, portable

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
different database for different categories reup Calibre 3 06-20-2010 11:25 AM
Readonly Database seanbw Calibre 6 03-17-2010 06:30 PM
What Database? LadyLou Calibre 8 02-12-2010 06:32 AM
Database outage Alexander Turcic Announcements 2 07-14-2005 04:44 PM
Database troubles Alexander Turcic Announcements 2 04-20-2005 01:02 PM


All times are GMT -4. The time now is 05:53 AM.


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