mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2025-12-06 17:02:43 +01:00
Fix defaults.ini for CLI pip install.
This commit is contained in:
parent
47c1b45b9c
commit
fbffee6cb5
6 changed files with 21 additions and 15 deletions
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2014 Fanficdownloader team
|
||||
# Copyright 2015 Fanficdownloader team
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the 'License');
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
#
|
||||
|
||||
from optparse import OptionParser
|
||||
from os.path import expanduser, isfile, join
|
||||
from os.path import expanduser, isfile, join, dirname
|
||||
from subprocess import call
|
||||
import ConfigParser
|
||||
import getpass
|
||||
|
|
@ -25,7 +25,6 @@ import pprint
|
|||
import string
|
||||
import sys
|
||||
|
||||
|
||||
if sys.version_info < (2, 5):
|
||||
print 'This program requires Python 2.5 or newer.'
|
||||
sys.exit(1)
|
||||
|
|
@ -160,6 +159,9 @@ def main(argv=None, parser=None, passed_defaultsini=None, passed_personalini=Non
|
|||
if passed_defaultsini:
|
||||
configuration.readfp(passed_defaultsini)
|
||||
|
||||
if isfile(join(dirname(__file__), 'defaults.ini')):
|
||||
conflist.append(join(dirname(__file__), 'defaults.ini'))
|
||||
|
||||
if isfile(join(homepath, 'defaults.ini')):
|
||||
conflist.append(join(homepath, 'defaults.ini'))
|
||||
if isfile(join(homepath2, 'defaults.ini')):
|
||||
|
|
|
|||
|
|
@ -402,7 +402,7 @@ class Configuration(ConfigParser.SafeConfigParser):
|
|||
else:
|
||||
return self.linenos.get(section,None)
|
||||
|
||||
## Copied from Python library so as to make it save linenos too.
|
||||
## Copied from Python 2.7 library so as to make it save linenos too.
|
||||
#
|
||||
# Regular expressions for parsing section headers and options.
|
||||
#
|
||||
|
|
@ -461,7 +461,9 @@ class Configuration(ConfigParser.SafeConfigParser):
|
|||
#raise MissingSectionHeaderError(fpname, lineno, line)
|
||||
# an option line?
|
||||
else:
|
||||
mo = self._optcre.match(line)
|
||||
mo = self.OPTCRE.match(line) # OPTCRE instead of
|
||||
# _optcre so it works
|
||||
# with python 2.6
|
||||
if mo:
|
||||
optname, vi, optval = mo.group('option', 'vi', 'value')
|
||||
# This check is fine because the OPTCRE cannot
|
||||
|
|
|
|||
|
|
@ -44,11 +44,11 @@ if __name__=="__main__":
|
|||
files,
|
||||
exclude=exclude)
|
||||
|
||||
os.chdir('../cli')
|
||||
# 'a' for append
|
||||
createZipFile("../"+filename,"a",
|
||||
['downloader.py','defaults.ini'],
|
||||
exclude=exclude)
|
||||
# os.chdir('../cli')
|
||||
# # 'a' for append
|
||||
# createZipFile("../"+filename,"a",
|
||||
# ['downloader.py','defaults.ini'],
|
||||
# exclude=exclude)
|
||||
|
||||
os.chdir('..')
|
||||
# 'a' for append
|
||||
|
|
|
|||
12
setup.py
12
setup.py
|
|
@ -25,7 +25,7 @@ setup(
|
|||
# Versions should comply with PEP440. For a discussion on single-sourcing
|
||||
# the version across setup.py and the project code, see
|
||||
# https://packaging.python.org/en/latest/single_source_version.html
|
||||
version="2.2.0.dev6",
|
||||
version="2.2.0.dev8",
|
||||
|
||||
description='A tool for downloading fanfiction to eBook formats',
|
||||
long_description=long_description,
|
||||
|
|
@ -69,18 +69,21 @@ setup(
|
|||
],
|
||||
|
||||
# What does your project relate to?
|
||||
keywords='fanfiction download ebook epub',
|
||||
keywords='fanfiction download ebook epub html',
|
||||
|
||||
# You can just specify the packages manually here if your project is
|
||||
# simple. Or you can use find_packages().
|
||||
# packages=find_packages(exclude=['contrib', 'docs', 'tests*']),
|
||||
packages=['fff_internals', 'fff_internals.adapters', 'fff_internals.writers'],
|
||||
|
||||
# for package_data
|
||||
package_dir={'fff_internals': 'fff_internals'},
|
||||
|
||||
# List run-time dependencies here. These will be installed by pip when
|
||||
# your project is installed. For an analysis of "install_requires" vs pip's
|
||||
# requirements files see:
|
||||
# https://packaging.python.org/en/latest/requirements.html
|
||||
install_requires=['beautifulsoup4','chardet','six','html5lib'],
|
||||
install_requires=['beautifulsoup4','chardet','html5lib'], # html5lib requires 'six'.
|
||||
|
||||
# List additional groups of dependencies here (e.g. development
|
||||
# dependencies). You can install these using the following syntax,
|
||||
|
|
@ -95,8 +98,7 @@ setup(
|
|||
# installed, specify them here. If using Python 2.6 or less, then these
|
||||
# have to be included in MANIFEST.in as well.
|
||||
package_data={
|
||||
'defaults.ini': ['defaults.ini'],
|
||||
'example.ini': ['example.ini'],
|
||||
'fff_internals': ['defaults.ini', 'example.ini'],
|
||||
},
|
||||
|
||||
# Although 'package_data' is the preferred approach, in some case you may
|
||||
|
|
|
|||
Loading…
Reference in a new issue