forked from guinslym/pyexifinfo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
100 lines (84 loc) · 2.69 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#Imports
from setuptools import setup, find_packages # Always prefer setuptools over distutils
from codecs import open # To use a consistent encoding
import os
from os import path
import sys
import subprocess
def print_frog():
frog ="""
" _,-. "
" ,-. ,--' o ) "
" \\(,' ' ,,-' "
",-.\\-.__,\\\\_ "
"\\(`--' `\\ "
''
"""
print(frog)
def print_a_header(message="-"):
"""Header
This function will output a message in a header
Keyword Arguments:
message {str} -- [the message string] (default: {"-"})
"""
print("-".center(60,'-'))
print(message.center(60,'-'))
print("-".center(60,'-'))
print()
def check_if_exiftool_is_already_installed():
"""Requirements
This function will check if Exiftool is installed
on your system
Return: True if Exiftool is Installed
False if not
"""
result = 1;
command = ["exiftool", "-ver"]
with open(os.devnull, "w") as fnull:
result = subprocess.call(
command,
stdout = fnull,
stderr = fnull
)
#Exiftool is not installed
if result != 0:
print_a_header('Exiftool needs to be installed on your system')
print_a_header('Visit http://www.sno.phy.queensu.ca/~phil/exiftool/')
return False
else:
return True
#Begin the installation
here = path.abspath(path.dirname(__file__))
setup(
name='pyexifinfo',
version='0.4.0',
description="Simple Metadata extraction using Exiftool",
url='https://github.com/guinslym/pyexifinfo',
author='Guinslym',
author_email='[email protected]',
license='GNU GPLv2',
packages=['pyexifinfo'],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Topic :: Internet :: WWW/HTTP :: Indexing/Search'
],
keywords='exiftool reader stats metadata image linux',
#packages=find_packages(exclude=['contrib', 'docs', 'tests*']),
)
result = check_if_exiftool_is_already_installed()
if not result:
print_frog()
print_a_header('Exiftool needs to be installed on your system')
print_a_header('Visit http://www.sno.phy.queensu.ca/~phil/exiftool/')
print_frog()