Merge async and xmpp work #34

Merged
bmartin5692 merged 20 commits from dev_broken-XMPP into master 2019-05-23 15:22:58 +02:00
2 changed files with 12 additions and 9 deletions
Showing only changes of commit 2683421c34 - Show all commits

View file

@ -82,11 +82,15 @@ def db_file():
def os_db_path():
db_path = ""
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():
try:

View file

@ -10,6 +10,7 @@ import asyncio
def main():
args = sys.argv
listen_host = ""
if len(args) > 0:
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")
listen_host = args.index("--listen")
if (len(args) - 1) >= (listen_host + 1):
listen_host = args[listen_host+1]
else:
if "--listen" in args:
listen_host = args[args.index("--listen") + 1]
if listen_host == "":
if platform.system() == "Darwin": # If a Mac, use 0.0.0.0 for listening
listen_host = "0.0.0.0"
else:
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_8007 = (listen_host, 8007)