mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
commit
68f148a352
25
manual/develop.rst
Executable file → Normal file
25
manual/develop.rst
Executable file → Normal file
@ -149,23 +149,22 @@ the previously checked out |app| code directory, for example::
|
|||||||
|
|
||||||
calibre is the directory that contains the src and resources sub-directories. Ensure you have installed the |app| commandline tools via :guilabel:`Preferences->Advanced->Miscellaneous` in the |app| GUI.
|
calibre is the directory that contains the src and resources sub-directories. Ensure you have installed the |app| commandline tools via :guilabel:`Preferences->Advanced->Miscellaneous` in the |app| GUI.
|
||||||
|
|
||||||
The next step is to set the environment variable ``CALIBRE_DEVELOP_FROM`` to the absolute path of the src directory.
|
The next step is to create a bash script that will set the environment variable ``CALIBRE_DEVELOP_FROM`` to the absolute path of the src directory when running calibre in debug mode.
|
||||||
So, following the example above, it would be ``/Users/kovid/work/calibre/src``.
|
|
||||||
`How to set environment variables <http://www.dowdandassociates.com/content/howto-set-environment-variable-mac-os-x-etclaunchdconf>`_.
|
|
||||||
|
|
||||||
Once you have set the environment variable, open a new Terminal and check that it was correctly set by using
|
Create a plain text file::
|
||||||
the command::
|
#!/bin/sh
|
||||||
|
export CALIBRE_DEVELOP_FROM="/Users/kovid/work/calibre/src"
|
||||||
|
calibre-debug -g
|
||||||
|
|
||||||
echo $CALIBRE_DEVELOP_FROM
|
Save this file as ``/usr/bin/calibre-develop``, then set its permissions so that it can be executed::
|
||||||
|
chmod +x /usr/bin/calibre-develop
|
||||||
|
|
||||||
Setting this environment variable means that |app| will now load all its Python code from the specified location.
|
Once you have done this, type::
|
||||||
|
calibre-develop
|
||||||
|
|
||||||
That's it! You are now ready to start hacking on the |app| code. For example, open the file :file:`src/calibre/__init__.py`
|
You should see some diagnostic information in the Terminal window as calibre
|
||||||
in your favorite editor and add the line::
|
starts up, and you should see an asterisk after the version number in the GUI
|
||||||
|
window, indicating that you are running from source.
|
||||||
print ("Hello, world!")
|
|
||||||
|
|
||||||
near the top of the file. Now run the command :command:`calibredb`. The very first line of output should be ``Hello, world!``.
|
|
||||||
|
|
||||||
Linux development environment
|
Linux development environment
|
||||||
------------------------------
|
------------------------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user