mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Added .deb package
This commit is contained in:
parent
46d0874dfc
commit
9d0fc8e073
32
maloja
32
maloja
@ -20,6 +20,21 @@ recommendedmodules = [
|
|||||||
SOURCE_URL = "https://github.com/krateng/maloja/archive/master.zip"
|
SOURCE_URL = "https://github.com/krateng/maloja/archive/master.zip"
|
||||||
|
|
||||||
|
|
||||||
|
def gotodir():
|
||||||
|
if os.path.exists("./server.py"):
|
||||||
|
return True
|
||||||
|
elif os.path.exists("/opt/maloja/server.py"):
|
||||||
|
os.chdir("/opt/maloja/")
|
||||||
|
return True
|
||||||
|
|
||||||
|
print("Maloja installation could not be found.")
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def setup():
|
||||||
|
print("Make sure to add your Last.FM api key in a file called 'apikey' to your main directory if you want to see images.")
|
||||||
|
print("Visit http://localhost:42010 to see your web interface. If you get an error, you probably don't have any scrobbles yet. This will be fixed later.")
|
||||||
|
|
||||||
|
|
||||||
def install():
|
def install():
|
||||||
toinstall = []
|
toinstall = []
|
||||||
@ -99,10 +114,12 @@ def install():
|
|||||||
|
|
||||||
if fail: return False
|
if fail: return False
|
||||||
print("All modules successfully installed!")
|
print("All modules successfully installed!")
|
||||||
|
setup()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print("All necessary modules seem to be installed.")
|
print("All necessary modules seem to be installed.")
|
||||||
|
setup()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
@ -121,13 +138,18 @@ def getInstance():
|
|||||||
def start():
|
def start():
|
||||||
if install():
|
if install():
|
||||||
|
|
||||||
try:
|
if gotodir():
|
||||||
p = subprocess.Popen(["python3","server.py"],stdout=subprocess.DEVNULL,stderr=subprocess.DEVNULL)
|
p = subprocess.Popen(["python3","server.py"],stdout=subprocess.DEVNULL,stderr=subprocess.DEVNULL)
|
||||||
print("Maloja started! PID: " + str(p.pid))
|
print("Maloja started! PID: " + str(p.pid))
|
||||||
return True
|
return True
|
||||||
except:
|
#else:
|
||||||
print("Error while starting Maloja. Are you sure it's not already running?")
|
# os.chdir("/opt/maloja/")
|
||||||
return False
|
# p = subprocess.Popen(["python3","server.py"],stdout=subprocess.DEVNULL,stderr=subprocess.DEVNULL)
|
||||||
|
# print("Maloja started! PID: " + str(p.pid))
|
||||||
|
# return True
|
||||||
|
|
||||||
|
print("Error while starting Maloja.")
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -161,6 +183,8 @@ def update():
|
|||||||
import zipfile
|
import zipfile
|
||||||
import distutils.dir_util
|
import distutils.dir_util
|
||||||
|
|
||||||
|
if not gotodir(): return False
|
||||||
|
|
||||||
print("Updating Maloja...")
|
print("Updating Maloja...")
|
||||||
#with urllib.request.urlopen(SOURCE_URL) as response:
|
#with urllib.request.urlopen(SOURCE_URL) as response:
|
||||||
# with tempfile.NamedTemporaryFile(delete=True) as tmpfile:
|
# with tempfile.NamedTemporaryFile(delete=True) as tmpfile:
|
||||||
|
BIN
packages/maloja.deb
Normal file
BIN
packages/maloja.deb
Normal file
Binary file not shown.
@ -83,7 +83,7 @@ def dynamic_image():
|
|||||||
keys = FormsDict.decode(request.query)
|
keys = FormsDict.decode(request.query)
|
||||||
relevant, _, _, _ = KeySplit(keys)
|
relevant, _, _, _ = KeySplit(keys)
|
||||||
result = resolveImage(**relevant)
|
result = resolveImage(**relevant)
|
||||||
redirect(result)
|
redirect(result,301)
|
||||||
|
|
||||||
@webserver.route("/images/<pth:re:.*\\.jpeg>")
|
@webserver.route("/images/<pth:re:.*\\.jpeg>")
|
||||||
@webserver.route("/images/<pth:re:.*\\.jpg>")
|
@webserver.route("/images/<pth:re:.*\\.jpg>")
|
||||||
|
Loading…
Reference in New Issue
Block a user