Minor enhancements

Get rid of NonfatalException (an exception is nonfatal iff it is
catched somewhere)

Foreport fixes for #26 and #30.

The current __sersion__ string is now kept in instaloader.py rather than
setup.py. This lets instaloader.__version__ always deliver the version
of the actually-loaded Instaloader module.

Minor changes to README.rst, error handling and which class methods are
public.

With these and the changes of the previous commit, we saved 31 lines of
code, indicating that it might be easier to understand and to maintain.
This commit is contained in:
Alexander Graf
2017-08-11 17:50:37 +02:00
parent 58882f508e
commit 0d9af81ae7
3 changed files with 52 additions and 49 deletions

View File

@@ -1,14 +1,25 @@
#!/usr/bin/env python3
import re
import sys
from setuptools import setup
def get_version():
with open('instaloader.py') as f:
for line in f:
m = re.match("__version__ = '(.*)'", line)
if m:
return m.group(1)
raise SystemExit("Could not find version string.")
if sys.version_info < (3, 5):
sys.exit('Instaloader requires Python >= 3.5.')
setup(
name='instaloader',
version='2.2.2',
version=get_version(),
py_modules=['instaloader'],
url='https://github.com/Thammus/instaloader',
license='MIT',