If you might have noticed, the bash scripts that you can execute by simply typing out their relative/absolute path, they are "executable" files. In order to achieve this, a few things should be done first. sh like you do with Python scripts by typing python. You may have encountered executing bash scripts simply by typing out their relative/absolute path in the terminal. This will ensure that if the file's contents are valid, it will be executed without any problems. The easiest method to run a Python script on any Linux distribution is by invoking the python command and provide it with the name of your Python script. So if you want Python 3 to be guaranteed, use python3. The remote debugger running inside calibre.Some distributions have used python2 as python and have an explicit command python3 for python3. Your IDE should now be able to connect to Remote debugger to calibre at the point of interest, for example in the mainįunction. Add whatever code is needed to launch the Then place the IDE’s remote debugger module into the src sub-folder In other words, the folder you set asĬALIBRE_DEVELOP_FROM above, must also be in the PYTHONPATH of your IDE. The first step is to add the calibre src checkout to It is possible to use the builtin debugger in your favorite Python IDE, if it Using the debugger in your favorite Python IDE ¶ The Python debugger cannot handle multiple threads, so you have toĬall set_trace once per thread, each time with a different port number. Installing Git, you can get the calibre source code with the command: Git is available on all the platforms calibre supports. You can get the calibre source code in two ways, using a version control system orĬalibre uses Git, a distributed version control If you need help understanding the code, post in the development forumĪnd you will most likely get help from one of calibre’s many developers. Look at the entry_points structure in linux.py. If you want to locate the entry points for all the various calibre executables, GUI initialization happens in gui2.main and gui2.ui. See API documentation for the database interface for the interface to the calibre library.Ĭontent server: srv is the calibre Content server. It isĭocumented in API documentation for the e-book editing tools.ĭb - The database back-end. And the input and outputĮ-book editing happens using a different container object. Various transformations that are applied to the book duringĬonversions live in oeb/transforms/*.py. TheĬlass that manages this representation is OEBBook in. Manifest, spine, toc, guide, html content, etc. Representation of an e-book that is like an unzipped epub, with The code that constructsĪnd drives the pipeline is in plumber.py. Plugin, various transforms and an output plugin. Metadata reading, writing, and downloading is all in tadataĬonversion happens in a pipeline, for the structure of the pipeline, This package contains the following main sub-packages Code layout ¶Īll the calibre Python code is in the calibre package. For more examples of plugins designed to add features to calibre, see the Index of plugins. Another example of the modular design is the recipe system forįetching news. Similarly, adding supportįor new conversion formats involves writing input/output format plugins. There is a tutorial on writing calibre plugins.įor example, adding support for a new device to calibre typically involves writing less than a 100 lines of code in the form ofĪ device driver plugin. The modular design of calibre is expressed via Plugins. Because of its roots, calibre has aĬomprehensive command line interface for all its functions, documented in Command Line Interface. This makes adding new features and fixingīugs in calibre very easy, resulting in a frenetic pace of development. The modules interact with each other via well defined interfaces. Using the debugger in your favorite Python IDEĮxecuting arbitrary scripts in the calibre Python environmentĪPI documentation for various parts of calibreĬalibre has its roots in the Unix world, which means that its design is highly modular. Using the Python debugger as a remote debugger Having separate “normal” and “development” calibre installs on the same computer Note that calibre requires at least Python 3.8. You will learn how to get a calibre development environment set up on the operating system of your choice.Ĭalibre is written primarily in Python with some C/C++ code for speed and system interfacing. This means that you are free to download and modify the program to your heart’s content. Setting up a calibre development environment ¶Ĭalibre is completely open source, licensed under the GNU GPL v3.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |