mirror of
https://github.com/janeczku/calibre-web
synced 2025-09-03 19:37:58 +00:00
Bugfix start as program
This commit is contained in:
13
cps.py
13
cps.py
@@ -20,16 +20,15 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
# Are we running from commandline?
|
||||
if __package__ == '':
|
||||
# Add local path to sys.path so we can import cps
|
||||
path = os.path.dirname(os.path.dirname(__file__))
|
||||
sys.path.insert(0, path)
|
||||
|
||||
from cps.main import main as _main
|
||||
# Add local path to sys.path so we can import cps
|
||||
path = os.path.dirname(os.path.abspath(__file__))
|
||||
sys.path.insert(0, path)
|
||||
|
||||
from cps.main import main
|
||||
|
||||
if __name__ == '__main__':
|
||||
_main()
|
||||
main()
|
||||
|
||||
|
||||
|
||||
|
@@ -19,6 +19,8 @@
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
__package__ = "cps"
|
||||
|
||||
import sys
|
||||
import os
|
||||
import mimetypes
|
||||
|
Reference in New Issue
Block a user