def __init__(self, rootPath=""): self.rootPath = rootPath PXPaths.normalPaths(self.rootPath) SystemManager.__init__(self) self.LOG = PXPaths.LOG # Will be used by DirCopier self.debug = 0
def __init__(self, drbdPath=False): """ drbdPath: drbd path or False, drbd path if we use other root than /apps """ if drbdPath: PDSPaths.drbdPaths(drbdPath) else: PDSPaths.normalPaths() SystemManager.__init__(self) self.LOG = PDSPaths.LOG # Will be used by DirCopier
def __init__(self, width, hight, parent=None): super(RightPanel, self).__init__(parent) # set width and hight self.width = width self.hight = hight # declare page self.page0 = LoginSignup(300, 170) self.page1 = Top3() self.page2 = Interest() self.page3 = SearchPage() self.page4 = Messages() self.page5 = History() self.page6 = ClientProjs() self.page7 = DevProjs() self.page8 = SystemManager() self.page9 = TeamPage() self.initUI()
def sortInFolders(self): fileList = sysman.getFilesFromFolder(self.path) for fileNumber, fileName in enumerate(fileList): extension = sysman.getFileExtension(fileName) folderName = sysman.getFolderName(extension, self.settings) if (folderName == "WORKFILE"): print("{} is still downloading, skipping that one".format(fileName)) continue folderStatus = sysman.makeFolder(self.path + "\\" + folderName) if (folderStatus): print("Working on {}, creating {} folder".format(fileName, folderName)) else: print("Working on {}, placing in {} folder".format(fileName, folderName)) sysman.moveFile(self.path + "\\" + fileName, self.path + "\\" + folderName + "\\" + fileName) print("Finished file {} out of {}".format(fileNumber+1, len(fileList)))
import urllib.parse import FrontendManager import SystemManager #from Camera import Camera from flask_cors import CORS, cross_origin app = Flask(__name__) CORS(app) logging.getLogger('flask_cors').level = logging.DEBUG frontendManager = FrontendManager.FrontendManager() systemManager = SystemManager.SystemManager() @app.route("/add_faces/<token>", methods=['POST', 'GET']) def add_faces(token): if request.method == 'POST': name = request.form.get("name") pic = request.form.get("pic").split(',')[-1] accessToken = token return jsonify(frontendManager.doAddFace(name, pic, accessToken)) return frontendManager.getAddFacesPage(token) @app.route("/auth/<token>") def auth_page(token): return frontendManager.getAdminPanel(token)
from logging import exception import MySQLdb import Student import Teacher import Login import SystemManager if __name__ == '__main__': conn = MySQLdb.connect(user='******', passwd='password', db='test') log = Login.Login(conn) if log.main_func(): account = log.get_login_account() if account[2] == 0: usr = SystemManager.SystemManager(conn, account[0], account[1]) usr.main_func() elif account[2] == 1: usr = Teacher.Teacher(conn, account[0], account[1]) usr.main_func() elif account[2] == 2: usr = Student.Student(conn, account[0], account[1]) usr.main_func() else: conn.close() raise exception() conn.close()