Advertisement
Guest User

Untitled

a guest
May 27th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.12 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. """
  3. Created on Fri May 24 13:37:36 2019
  4.  
  5. @author: Llama
  6. """
  7. from pickle import load
  8. from sys import path
  9. path.append("..")
  10. import functions
  11.  
  12.  
  13. # main code
  14. try:
  15.     users = open("data//users.csms", "rb")
  16. except FileNotFoundError:
  17.     functions.restoreUsers()
  18. else:
  19.     userlist = load(users)
  20.     users.close()
  21. functions.clear()
  22.  
  23.  
  24. try:
  25.     currUser, rootDir, currDir = functions.startup(userlist)
  26. except FileNotFoundError:
  27.     print("Error happened during startup")
  28.     functions.restoreFiles()
  29. msg = ""
  30. while "Everyone except Cosmic47 is gay":
  31.     functions.clear()
  32.     print(currDir.name)
  33.     functions.listdir(currDir)
  34.     print(msg)
  35.     inp = input("input command >")
  36.     command = inp.split(" ")[0]
  37.     if command == "moveto" or command == "mvback":
  38.         output = functions.comm(inp, currDir, currUser.access, rootDir)
  39.         if type(output) is str:
  40.             msg = output
  41.         else:
  42.             currDir = output
  43.     else:
  44.         msg = functions.comm(inp, currDir, currUser.access, rootDir)
  45.     if msg == "exiting...":
  46.         break
  47. functions.save(userlist, rootDir)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement