32 lines
771 B
Python
Executable File
32 lines
771 B
Python
Executable File
import initialise
|
|
try:
|
|
import users
|
|
except:
|
|
print("No users database")
|
|
initialise.initialise()
|
|
import config
|
|
import newpost
|
|
import rebuild
|
|
from datetime import datetime
|
|
|
|
username = input("Username: ").lower()
|
|
|
|
# Check if this user exists
|
|
user_present = False
|
|
for current_user in range(len(users.users)):
|
|
if users.users[current_user] == username:
|
|
user_present = True
|
|
userID = current_user
|
|
if user_present == True:
|
|
print('''What do you want to do?
|
|
1. Create (N)ew post
|
|
2. (R)ebuild''')
|
|
|
|
answer = input()
|
|
if answer == 'N' or answer == '1':
|
|
newpost.newpost(userID, username, datetime)
|
|
if answer == 'R' or answer == '2':
|
|
rebuild.rebuild()
|
|
else:
|
|
print('Sorry, that account does not exist, If it should, please ask the webadmin to add this account')
|