Commit cd2a76f0 authored by prx's avatar prx

major update. Separated lib

parent 9f5cefaa
all:
find . -name '*.pyc' -exec rm '{}' \;
find . -name '*.deb' -exec rm '{}' \;
find . -name '*.tar.gz' -exec rm '{}' \;
find . -name '*.dsc' -exec rm '{}' \;
find . -name '*.changes' -exec rm '{}' \;
find . -name '*.*un\~' -exec rm '{}' \;
#equivs-build eqctl -f
#equivs-build eqctl
#mv *.deb ./site/downloads/dontpanic-latest.deb
# vim:set ft=make:
#!/bin/sh
# start dontpanic as single user or the server
PYTHON=$(which python3)
PYTHON=$(which python3.4)
if [ $? -ne 0 ]; then
PYTHON=$(which python)
PYTHON=$(which python3)
fi
if [ $? -ne 0 ]; then
PYTHON=$(which python2.7)
fi
if [ -d /usr/share/dontpanic ]; then
cd /usr/share/dontpanic
elif [ -d ./src ]; then
cd src
fi
if [ -e ./dontpanic.py ]; then
......
No preview for this file type
......@@ -2,7 +2,7 @@
#Auteur : thuban <thuban@yeuxdelibad.net>
REP=~/geek/gitreps/3hg/dontpanic
OUT=~/geek/gitreps/3hg-website/dontpanic/downloads/
OUT=~/geek/gitreps/3hg/3hg-website/dontpanic/downloads/
if [ -d /tmp/dontpanic ]; then
rm -rf /tmp/dontpanic
......@@ -14,7 +14,7 @@ cp -r * /tmp/dontpanic
rm -r /tmp/dontpanic/site
cd /tmp
tar cvzf "dontpanic-latest.tgz" "dontpanic"
mv dontpanic-latest.tgz $OUT
mv /tmp/dontpanic-latest.tgz $OUT/
exit
......@@ -18,9 +18,9 @@ import sys
from argparse import ArgumentParser
from dontpanic import DontPanic
from i18n import _
from utils import setup_logging, progname, progversion
from dontpanic.ui import DontPanic
from dontpanic.i18n import _
from dontpanic.utils import setup_logging, progname, progversion
serverlist = ["cgi", "paste", "cherrypy", "tornado", "auto"]
logger = logging.getLogger(__name__)
......
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Auteur : thuban <thuban@yeuxdelibad.net>
licence : MIT
Description :
Just watch your favorite show and keep track of them.
"""
import getpass
import sys
import os
from argparse import ArgumentParser
from dontpanic.ui import *
logger = logging.getLogger(__name__)
if __name__ == '__main__':
parser = ArgumentParser(prog=progname, description=_("Dontpanic is a python app to look for any movie or"
" serie and watch them in streaming. It looks like popcorntime"
", but doesn't depend of a centralized api."))
parser.add_argument("-v", "--verbose", action="count", default=0, help=_("Increase output verbosity"))
parser.add_argument("--version", action="version", version=progversion, help=_("Print version"))
parser.add_argument("magnet", nargs='?', action="store", default="", help=_("Stream a magnet link"))
args = parser.parse_args()
setup_logging(args.verbose)
os.chdir(os.path.dirname(os.path.abspath(__file__)))
prepconfig()
port = lock()
# In case if the login contains weird characters
if sys.platform == 'win32' and sys.version_info < (3, 0):
me = getpass.getuser().decode('utf-8', errors='ignore')
else:
me = getpass.getuser()
# a magnet link is passed as argument
mgt = ""
if args.magnet.startswith("magnet:"):
mgt = quoteurl(args.magnet)
if not port: # already running
with open(lock_file, 'r') as l:
port = l.read().strip()
if mgt != "":
webbrowser.open("http://localhost:{}/stream/dontpanic/{}/0".format(port, mgt))
else:
webbrowser.open("http://localhost:{}".format(port))
else:
myapp = DontPanic('localhost', port, me, magnet=mgt)
myapp.run()
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
......@@ -7,7 +7,7 @@ import os
import logging
import sys
from utils import confdir
from .utils import confdir
logger = logging.getLogger(__name__)
......
......@@ -14,8 +14,8 @@ import logging
import os
import sys
from utils import progname, progversion, progurl, get_hash
from webutils import do_req_get
from .utils import progname, progversion, progurl, get_hash
from .webutils import do_req_get
logger = logging.getLogger(__name__)
......
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -*- coding:Utf-8 -*-
"""
Auteur : thuban <thuban@yeuxdelibad.net>
licence : MIT
Description :
Just watch your favorite show and keep track of them.
Auteur : thuban <thuban@yeuxdelibad.net>
licence : MIT
"""
import getpass
import sys
from argparse import ArgumentParser
from bottle import *
from threading import Thread
import webbrowser
from database import DontPanicDB
from i18n import _
import locale
from subtitle import Subtitle
from torrentsession import TorrentSession
from utils import *
from webutils import *
from .database import DontPanicDB
from .i18n import _
from .subtitle import Subtitle
from .torrentsession import TorrentSession
from .utils import *
from .webutils import *
if sys.version_info >= (3, 0):
from urllib.parse import quote as quoteurl
else:
from urllib import quote as quoteurl
logger = logging.getLogger(__name__)
import locale
def search2html(keywords, extrawords=' ', searchengine='kickasstorrents', page=0, isserie=0):
"""
......@@ -317,6 +309,8 @@ def pick_logo():
return "favicon.png"
class DontPanic:
def __init__(self, host, port, admin, adminpw="password", local_=True, magnet=""):
self.startperc = None
......@@ -985,43 +979,3 @@ class DontPanic:
del session
if __name__ == '__main__':
parser = ArgumentParser(prog=progname, description=_("Dontpanic is a python app to look for any movie or"
" serie and watch them in streaming. It looks like popcorntime"
", but doesn't depend of a centralized api."))
parser.add_argument("-v", "--verbose", action="count", default=0, help=_("Increase output verbosity"))
parser.add_argument("--version", action="version", version=progversion, help=_("Print version"))
parser.add_argument("magnet", nargs='?', action="store", default="", help=_("Stream a magnet link"))
args = parser.parse_args()
setup_logging(args.verbose)
os.chdir(os.path.dirname(os.path.abspath(__file__)))
prepconfig()
port = lock()
# In case if the login contains weird characters
if sys.platform == 'win32' and sys.version_info < (3, 0):
me = getpass.getuser().decode('utf-8', errors='ignore')
else:
me = getpass.getuser()
# a magnet link is passed as argument
mgt = ""
if args.magnet.startswith("magnet:"):
mgt = quoteurl(args.magnet)
if not port: # already running
with open(lock_file, 'r') as l:
port = l.read().strip()
if mgt != "":
webbrowser.open("http://localhost:{}/stream/dontpanic/{}/0".format(port, mgt))
else:
webbrowser.open("http://localhost:{}".format(port))
else:
myapp = DontPanic('localhost', port, me, magnet=mgt)
myapp.run()
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
......@@ -16,7 +16,7 @@ if sys.version_info >= (3, 0):
else:
import ConfigParser as cp
from i18n import _
from .i18n import _
####################
# Global variables #
......
......@@ -4,9 +4,8 @@ import sys
import requests
import bs4
from utils import convb
from i18n import _
from .utils import convb
from .i18n import _
if sys.version_info >= (3, 0):
from concurrent.futures import ThreadPoolExecutor
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -4,12 +4,12 @@
import logging
import os
import subprocess
from utils import localedir, podir, progname, setup_logging
from dontpanic.i18n import _, i18n_domain
from dontpanic.utils import localedir, podir, progname, setup_logging
from argparse import ArgumentParser
from glob import glob
from i18n import _, i18n_domain
logger = logging.getLogger(__name__)
......@@ -20,7 +20,7 @@ def update_pot():
cmd = ['xgettext', '--language=Python', '--package-name', i18n_domain,
'--output', '{}/{}.pot'.format(podir, i18n_domain)]
for path, names, filenames in os.walk(os.curdir):
for path, names, filenames in os.walk(os.path.join(os.curdir, "dontpanic")):
for f in filenames:
if f.endswith('.py'):
cmd.append(os.path.join(path, f))
......
......@@ -12,10 +12,10 @@
<h3 style="font-size: 40px;">{{version}}</h3>
<br/><br/><br/><br/>
<div style="font-size: 25px; line-height:1.15em;">{{ !htmlstuff }}</div>
<div style="font-size: 21px; line-height:1.15em;margin-top:1em">{{ !htmlstuff }}</div>
</div>
% include('footer.tpl')
% include('scripts.tpl')
</body>
</html>
\ No newline at end of file
</html>
......@@ -5,7 +5,7 @@
<div class="middle-center">
<h1 style="font-size: 50px;">{{title}}</h1>
<br/><br/>
<div style="font-size: 25px; line-height:1.15em;">{{ !htmlstuff }}</div>
<div style="font-size: 25px; line-height:1.15em;margin-top:1em;">{{ !htmlstuff }}</div>
</div>
% include('footer-gb.tpl')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment