mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
c3e5c50f98
commit
a2187a86ac
@ -2,8 +2,14 @@ __license__ = 'GPL v3'
|
|||||||
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
|
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
__appname__ = 'calibre'
|
__appname__ = 'calibre'
|
||||||
__version__ = '0.5.14'
|
__version__ = '0.6.0b1'
|
||||||
__author__ = "Kovid Goyal <kovid@kovidgoyal.net>"
|
__author__ = "Kovid Goyal <kovid@kovidgoyal.net>"
|
||||||
|
|
||||||
|
import re
|
||||||
|
_ver = __version__.split('.')
|
||||||
|
_ver = [int(re.search(r'(\d+)', x).group(1)) for x in _ver]
|
||||||
|
numeric_version = tuple(_ver)
|
||||||
|
|
||||||
'''
|
'''
|
||||||
Various run time constants.
|
Various run time constants.
|
||||||
'''
|
'''
|
||||||
|
@ -5,7 +5,7 @@ __copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
from calibre.ptempfile import PersistentTemporaryFile
|
from calibre.ptempfile import PersistentTemporaryFile
|
||||||
from calibre.constants import __version__, __author__
|
from calibre.constants import numeric_version
|
||||||
|
|
||||||
class Plugin(object):
|
class Plugin(object):
|
||||||
'''
|
'''
|
||||||
@ -176,7 +176,7 @@ class MetadataReaderPlugin(Plugin):
|
|||||||
file_types = set([])
|
file_types = set([])
|
||||||
|
|
||||||
supported_platforms = ['windows', 'osx', 'linux']
|
supported_platforms = ['windows', 'osx', 'linux']
|
||||||
version = tuple(map(int, (__version__.split('.'))[:3]))
|
version = numeric_version
|
||||||
author = 'Kovid Goyal'
|
author = 'Kovid Goyal'
|
||||||
|
|
||||||
type = _('Metadata reader')
|
type = _('Metadata reader')
|
||||||
@ -203,7 +203,7 @@ class MetadataWriterPlugin(Plugin):
|
|||||||
file_types = set([])
|
file_types = set([])
|
||||||
|
|
||||||
supported_platforms = ['windows', 'osx', 'linux']
|
supported_platforms = ['windows', 'osx', 'linux']
|
||||||
version = tuple(map(int, (__version__.split('.'))[:3]))
|
version = numeric_version
|
||||||
author = 'Kovid Goyal'
|
author = 'Kovid Goyal'
|
||||||
|
|
||||||
type = _('Metadata writer')
|
type = _('Metadata writer')
|
||||||
|
@ -5,7 +5,7 @@ import textwrap
|
|||||||
import os
|
import os
|
||||||
import glob
|
import glob
|
||||||
from calibre.customize import FileTypePlugin, MetadataReaderPlugin, MetadataWriterPlugin
|
from calibre.customize import FileTypePlugin, MetadataReaderPlugin, MetadataWriterPlugin
|
||||||
from calibre.constants import __version__
|
from calibre.constants import numeric_version
|
||||||
|
|
||||||
class HTML2ZIP(FileTypePlugin):
|
class HTML2ZIP(FileTypePlugin):
|
||||||
name = 'HTML to ZIP'
|
name = 'HTML to ZIP'
|
||||||
@ -15,7 +15,7 @@ Follow all local links in an HTML file and create a ZIP \
|
|||||||
file containing all linked files. This plugin is run \
|
file containing all linked files. This plugin is run \
|
||||||
every time you add an HTML file to the library.\
|
every time you add an HTML file to the library.\
|
||||||
'''))
|
'''))
|
||||||
version = tuple(map(int, (__version__.split('.'))[:3]))
|
version = numeric_version
|
||||||
file_types = set(['html', 'htm', 'xhtml', 'xhtm'])
|
file_types = set(['html', 'htm', 'xhtml', 'xhtm'])
|
||||||
supported_platforms = ['windows', 'osx', 'linux']
|
supported_platforms = ['windows', 'osx', 'linux']
|
||||||
on_import = True
|
on_import = True
|
||||||
|
@ -9,13 +9,12 @@ from calibre.customize import Plugin, FileTypePlugin, MetadataReaderPlugin, \
|
|||||||
from calibre.customize.conversion import InputFormatPlugin, OutputFormatPlugin
|
from calibre.customize.conversion import InputFormatPlugin, OutputFormatPlugin
|
||||||
from calibre.customize.profiles import InputProfile, OutputProfile
|
from calibre.customize.profiles import InputProfile, OutputProfile
|
||||||
from calibre.customize.builtins import plugins as builtin_plugins
|
from calibre.customize.builtins import plugins as builtin_plugins
|
||||||
from calibre.constants import __version__, iswindows, isosx
|
from calibre.constants import numeric_version as version, iswindows, isosx
|
||||||
from calibre.devices.interface import DevicePlugin
|
from calibre.devices.interface import DevicePlugin
|
||||||
from calibre.ebooks.metadata import MetaInformation
|
from calibre.ebooks.metadata import MetaInformation
|
||||||
from calibre.utils.config import make_config_dir, Config, ConfigProxy, \
|
from calibre.utils.config import make_config_dir, Config, ConfigProxy, \
|
||||||
plugin_dir, OptionParser
|
plugin_dir, OptionParser
|
||||||
|
|
||||||
version = tuple([int(x) for x in __version__.split('.')])
|
|
||||||
|
|
||||||
platform = 'linux'
|
platform = 'linux'
|
||||||
if iswindows:
|
if iswindows:
|
||||||
|
@ -653,8 +653,9 @@ class MobiWriter(object):
|
|||||||
def _generate_end_records(self):
|
def _generate_end_records(self):
|
||||||
self._flis_number = len(self._records)
|
self._flis_number = len(self._records)
|
||||||
self._records.append(
|
self._records.append(
|
||||||
'FLIS\0\0\0\x08\0\x41\0\0\0\0\0\0\xff\xff\xff\xff\0\x01\0\x03\0\0\0\x03\0\0\0\x01')
|
'FLIS\0\0\0\x08\0\x41\0\0\0\0\0\0\xff\xff\xff\xff\0\x01\0\x03\0\0\0\x03\0\0\0\x01'+
|
||||||
fcis = 'FCIS\x00\x00\x00\x14\x00\x00\x00\x10\x00\x00\x00\x00'
|
'\xff'*4)
|
||||||
|
fcis = 'FCIS\x00\x00\x00\x14\x00\x00\x00\x10\x00\x00\x00\x01\x00\x00\x00\x00'
|
||||||
fcis += pack('>I', self._text_length)
|
fcis += pack('>I', self._text_length)
|
||||||
fcis += '\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x08\x00\x01\x00\x01\x00\x00\x00\x00'
|
fcis += '\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x08\x00\x01\x00\x01\x00\x00\x00\x00'
|
||||||
self._fcis_number = len(self._records)
|
self._fcis_number = len(self._records)
|
||||||
|
10
upload.py
10
upload.py
@ -17,6 +17,7 @@ __appname__ = re.search(r'__appname__\s+=\s+[\'"]([^\'"]+)[\'"]', raw).group(1)
|
|||||||
|
|
||||||
PREFIX = "/var/www/calibre.kovidgoyal.net"
|
PREFIX = "/var/www/calibre.kovidgoyal.net"
|
||||||
DOWNLOADS = PREFIX+"/htdocs/downloads"
|
DOWNLOADS = PREFIX+"/htdocs/downloads"
|
||||||
|
BETAS = DOWNLOADS +'/betas'
|
||||||
DOCS = PREFIX+"/htdocs/apidocs"
|
DOCS = PREFIX+"/htdocs/apidocs"
|
||||||
USER_MANUAL = PREFIX+'/htdocs/user_manual'
|
USER_MANUAL = PREFIX+'/htdocs/user_manual'
|
||||||
HTML2LRF = "src/calibre/ebooks/lrf/html/demo"
|
HTML2LRF = "src/calibre/ebooks/lrf/html/demo"
|
||||||
@ -429,8 +430,9 @@ class upload_demo(OptionlessCommand):
|
|||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
check_call(
|
check_call(
|
||||||
'''html2lrf --title='Demonstration of html2lrf' --author='Kovid Goyal' '''
|
'''ebook-convert %s/demo.html /tmp/html2lrf.lrf '''
|
||||||
'''--header --output=/tmp/html2lrf.lrf %s/demo.html '''
|
'''--title='Demonstration of html2lrf' --author='Kovid Goyal' '''
|
||||||
|
'''--header '''
|
||||||
'''--serif-family "/usr/share/fonts/corefonts, Times New Roman" '''
|
'''--serif-family "/usr/share/fonts/corefonts, Times New Roman" '''
|
||||||
'''--mono-family "/usr/share/fonts/corefonts, Andale Mono" '''
|
'''--mono-family "/usr/share/fonts/corefonts, Andale Mono" '''
|
||||||
''''''%(HTML2LRF,), shell=True)
|
''''''%(HTML2LRF,), shell=True)
|
||||||
@ -442,8 +444,8 @@ class upload_demo(OptionlessCommand):
|
|||||||
check_call('scp /tmp/html-demo.zip divok:%s/'%(DOWNLOADS,), shell=True)
|
check_call('scp /tmp/html-demo.zip divok:%s/'%(DOWNLOADS,), shell=True)
|
||||||
|
|
||||||
check_call(
|
check_call(
|
||||||
'''txt2lrf -t 'Demonstration of txt2lrf' -a 'Kovid Goyal' '''
|
("ebook-convert %s/demo.txt /tmp/txt2lrf.lrf -t 'Demonstration of txt2lrf'"
|
||||||
'''--header -o /tmp/txt2lrf.lrf %s/demo.txt'''%(TXT2LRF,), shell=True)
|
"-a 'Kovid Goyal' --header ")%(TXT2LRF,), shell=True)
|
||||||
|
|
||||||
check_call('cd src/calibre/ebooks/lrf/txt/demo/ && '
|
check_call('cd src/calibre/ebooks/lrf/txt/demo/ && '
|
||||||
'zip -j /tmp/txt-demo.zip * /tmp/txt2lrf.lrf', shell=True)
|
'zip -j /tmp/txt-demo.zip * /tmp/txt2lrf.lrf', shell=True)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user