Merge async and xmpp work #34
2 changed files with 12 additions and 9 deletions
|
|
@ -82,11 +82,15 @@ def db_file():
|
||||||
|
|
||||||
|
|
||||||
def os_db_path():
|
def os_db_path():
|
||||||
|
db_path = ""
|
||||||
if platform.system() == "Windows":
|
if platform.system() == "Windows":
|
||||||
return os.path.join(os.getenv("APPDATA"), "bumper.db")
|
|
||||||
else:
|
|
||||||
return os.path.expanduser("~/.config/bumper.db")
|
|
||||||
|
|
||||||
|
db_path = os.path.join(os.getenv("APPDATA"))
|
||||||
|
else:
|
||||||
|
db_path = os.path.expanduser("~/.config")
|
||||||
|
|
||||||
|
os.makedirs(db_path, exist_ok=True) #Ensure db_path directory exists or create
|
||||||
|
return os.path.join(db_path, "bumper.db")
|
||||||
|
|
||||||
def db_get():
|
def db_get():
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import asyncio
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
args = sys.argv
|
args = sys.argv
|
||||||
|
listen_host = ""
|
||||||
|
|
||||||
if len(args) > 0:
|
if len(args) > 0:
|
||||||
if "--debug" in args:
|
if "--debug" in args:
|
||||||
|
|
@ -24,16 +25,14 @@ def main():
|
||||||
)
|
)
|
||||||
# format="[%(asctime)s] :: %(levelname)s :: %(name)s :: %(module)s :: %(funcName)s :: %(lineno)d :: %(message)s")
|
# format="[%(asctime)s] :: %(levelname)s :: %(name)s :: %(module)s :: %(funcName)s :: %(lineno)d :: %(message)s")
|
||||||
|
|
||||||
listen_host = args.index("--listen")
|
if "--listen" in args:
|
||||||
if (len(args) - 1) >= (listen_host + 1):
|
listen_host = args[args.index("--listen") + 1]
|
||||||
listen_host = args[listen_host+1]
|
|
||||||
else:
|
if listen_host == "":
|
||||||
if platform.system() == "Darwin": # If a Mac, use 0.0.0.0 for listening
|
if platform.system() == "Darwin": # If a Mac, use 0.0.0.0 for listening
|
||||||
listen_host = "0.0.0.0"
|
listen_host = "0.0.0.0"
|
||||||
else:
|
else:
|
||||||
listen_host = socket.gethostbyname(socket.gethostname())
|
listen_host = socket.gethostbyname(socket.gethostname())
|
||||||
#listen_host = "localhost" # Try this if the above doesn't work
|
|
||||||
|
|
||||||
|
|
||||||
conf_address_443 = (listen_host, 443)
|
conf_address_443 = (listen_host, 443)
|
||||||
conf_address_8007 = (listen_host, 8007)
|
conf_address_8007 = (listen_host, 8007)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue