add a __main__.py file

This commit is contained in:
Mike Fährmann
2017-01-16 02:57:04 +01:00
parent 659577ae54
commit 501b64fa9d

20
gallery_dl/__main__.py Normal file
View File

@@ -0,0 +1,20 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2017 Mike Fährmann
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
import sys
if __package__ is None and not hasattr(sys, "frozen"):
import os.path
path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, os.path.realpath(path))
import gallery_dl
if __name__ == "__main__":
gallery_dl.main()