1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00
royalnet/newuser.py

42 lines
999 B
Python
Raw Permalink Normal View History

2017-10-17 18:49:28 +00:00
import db
2017-10-30 09:46:37 +00:00
session = db.Session()
2018-03-21 20:17:34 +00:00
username = input("Nome account: ")
user = session.query(db.Royal).filter_by(username=username).one_or_none()
if user is None:
user = db.Royal.create(session, username)
2017-10-30 09:46:37 +00:00
session.add(user)
session.flush()
2017-10-25 09:09:06 +00:00
try:
2017-10-30 09:46:37 +00:00
steam = db.Steam.create(session, user.id, input("Steam ID 1: "))
2017-10-27 09:53:05 +00:00
except Exception as e:
print(e)
2017-10-25 09:09:06 +00:00
else:
2017-10-30 09:46:37 +00:00
session.add(steam)
2018-06-05 10:33:26 +00:00
try:
dota = db.Dota.create(session, steam.steam_id)
except Exception as e:
print(e)
else:
session.add(dota)
2017-10-25 09:09:06 +00:00
try:
2017-10-30 09:46:37 +00:00
osu = db.Osu.create(session, user.id, input("Osu! username: "))
2017-10-27 09:53:05 +00:00
except Exception as e:
print(e)
2017-10-25 09:09:06 +00:00
else:
2017-10-30 09:46:37 +00:00
session.add(osu)
2017-10-25 09:09:06 +00:00
try:
2017-10-30 09:46:37 +00:00
overwatch = db.Overwatch.create(session, user.id, input("Battle.net battletag: "))
2017-10-27 09:53:05 +00:00
except Exception as e:
print(e)
2017-10-25 09:09:06 +00:00
else:
2017-10-30 09:46:37 +00:00
session.add(overwatch)
2017-10-25 09:09:06 +00:00
try:
2018-12-18 16:34:34 +00:00
lol = db.LeagueOfLegends.create(user.id, input("League summoner name: "))
2017-10-27 09:53:05 +00:00
except Exception as e:
print(e)
2017-10-25 09:09:06 +00:00
else:
2017-10-30 09:46:37 +00:00
session.add(lol)
session.commit()
2018-08-28 13:14:29 +00:00
session.close()