24
setup.py
24
setup.py
@@ -5,6 +5,7 @@ from __future__ import unicode_literals, print_function
|
|||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os.path
|
import os.path
|
||||||
|
import warnings
|
||||||
|
|
||||||
if sys.hexversion < 0x3040000:
|
if sys.hexversion < 0x3040000:
|
||||||
sys.exit("Python 3.4+ required")
|
sys.exit("Python 3.4+ required")
|
||||||
@@ -22,6 +23,15 @@ def read(fname):
|
|||||||
with open(path, encoding="utf-8") as file:
|
with open(path, encoding="utf-8") as file:
|
||||||
return file.read()
|
return file.read()
|
||||||
|
|
||||||
|
def check_file(fname):
|
||||||
|
if os.path.exists(fname):
|
||||||
|
return True
|
||||||
|
warnings.warn(
|
||||||
|
"Not including file '{}' since it is not present. "
|
||||||
|
"Run 'make' to build all automatically generated files.".format(fname)
|
||||||
|
)
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
# get version without importing the package
|
# get version without importing the package
|
||||||
exec(read("gallery_dl/version.py"))
|
exec(read("gallery_dl/version.py"))
|
||||||
@@ -68,6 +78,15 @@ else:
|
|||||||
"scripts": ["bin/gallery-dl"]
|
"scripts": ["bin/gallery-dl"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data_files = [
|
||||||
|
(path, [f for f in files if check_file(f)])
|
||||||
|
for (path, files) in [
|
||||||
|
('etc/bash_completion.d', ['gallery-dl.bash_completion']),
|
||||||
|
('share/man/man1' , ['gallery-dl.1']),
|
||||||
|
]
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="gallery_dl",
|
name="gallery_dl",
|
||||||
version=__version__,
|
version=__version__,
|
||||||
@@ -90,10 +109,7 @@ setup(
|
|||||||
"gallery_dl.downloader",
|
"gallery_dl.downloader",
|
||||||
"gallery_dl.postprocessor",
|
"gallery_dl.postprocessor",
|
||||||
],
|
],
|
||||||
data_files = [
|
data_files=data_files,
|
||||||
('etc/bash_completion.d', ['gallery-dl.bash-completion']),
|
|
||||||
('share/man/man1' , ['gallery-dl.1']),
|
|
||||||
],
|
|
||||||
keywords="image gallery downloader crawler scraper",
|
keywords="image gallery downloader crawler scraper",
|
||||||
classifiers=[
|
classifiers=[
|
||||||
"Development Status :: 5 - Production/Stable",
|
"Development Status :: 5 - Production/Stable",
|
||||||
|
|||||||
Reference in New Issue
Block a user