Esempio n. 1
0
# -*- coding: utf-8 -*-
"""
openaccess_epub.quickstart

Used for configuring an installation of OpenAccess_EPUB
"""

from openaccess_epub.utils import cache_location, evaluate_relative_path, mkdir_p
from openaccess_epub import __version__ as OAE_VERSION
import os
import sys
import time

LOCAL_DIR = os.getcwd()
CACHE_LOCATION = cache_location()

CONFIG_TEXT = """# -*- coding: utf-8 -*-
#
# OpenAccess_EPUB configuration file, created by oae-quickstart on
# {now}.
#
# The script detected OpenAccess_EPUB v.{oae-version}
#
# At this point in time, all possible values for configuration are represented
# in this file. Suggested defaults exist for all values, but each may receive
# alternatives from the user. To reconfigure, simply run oae-quickstart again.
# To quickly reset all values to default, run oae-quickstart -d
#
# Please note that some of the configurations in this file may be overridden by
# flags passed manually to the oaepub script.
Esempio n. 2
0
import shutil
import logging
import traceback
import subprocess

#OpenAccess_EPUB Modules
from ._version import __version__
import openaccess_epub.utils as utils
import openaccess_epub.utils.input as u_input
from openaccess_epub.utils.images import get_images
import openaccess_epub.opf as opf
import openaccess_epub.ncx as ncx
import openaccess_epub.ops as ops
from openaccess_epub.article import Article

CACHE_LOCATION = utils.cache_location()
LOCAL_DIR = os.getcwd()

log = logging.getLogger('Main')

def OAEParser():
    """
    This function returns the parser args to the main method.
    """
    parser = argparse.ArgumentParser(description='OpenAccess_EPUB Parser')
    parser.add_argument('--version', action='version',
                        version='OpenAccess_EPUB {0}'.format(__version__))
    parser.add_argument('-o', '--output', action='store',
                        default=None,
                        help='''Specify a non-default directory for the
                        placement of output.''')