Skip to content

Commit

Permalink
Added config generator
Browse files Browse the repository at this point in the history
  • Loading branch information
louisa-uno committed Feb 1, 2022
1 parent 6687a48 commit a7d35ff
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions activate_packages.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import asyncio
import time
import json
import logging
import sys
import time

import requests
from ASF import IPC
from tqdm import tqdm
import json

config = json.load(open("config.json"))

logging.basicConfig(
filename="logging.txt",
Expand All @@ -17,6 +17,28 @@

log = logging.getLogger('urbanGUI')

try:
config = json.load(open("config.json"))
log.debug("Found config file")
except FileNotFoundError:
log.debug("Couldn't find config file")
config = {
"IPC": {
"host": "http://localhost:1242",
"password": "your IPC password"
},
"git_token": "NOT needed if only used to activate packages"
}
config["IPC"]["host"] = input("Enter your ArchiSteamFarm host address: ")
config["IPC"]["host"] = input("Enter your ArchiSteamFarm host password: ")
log.debug("Saving config file")
with open("config.json", "w") as f:
f.write(json.dumps(config))
log.debug("Saved config file")
except json.JSONDecodeError:
log.error("Couldn't decode config to json")
sys.exit()


async def main():
async with IPC(ipc=config["IPC"]["host"],
Expand Down

0 comments on commit a7d35ff

Please sign in to comment.