def toManager(i): a = employeeList[i].GetJobTitle() b = employeeList[i].GetEmployeeID() c = employeeList[i].GetDepartment() d = employeeList[i].GetFirstName() e = employeeList[i].GetLastName() f = employeeList[i].GetGender() g = employeeList[i].GetBirthDate() h = employeeList[i].GetSINNumber() I = employeeList[i].GetPayroll() j = employeeList[i].GetMaritalStatus() k = employeeList[i].GetHomePhone() l = employeeList[i].GetWorkPhone() m = employeeList[i].GetAddress() n = employeeList[i].GetManagerName() o = employeeList[i].GetEducation() p = employeeList[i].GetStartDate() q = employeeList[i].GetEmail() r = employeeList[i].GetEmergencyFirstName() s = employeeList[i].GetEmergencyLastName() t = employeeList[i].GetEmergencyRelationship() u = employeeList[i].GetEmergencyPhoneNumber() v = employeeList[i].GetNumSickDaysTaken() w = employeeList[i].GetNumVacationDaysTaken() x = employeeList[i].GetPaytype() y = employeeList[i].GetNumDaysWorked() z = employeeList[i].GetOvertimeHours() deleteEmployee(b) blah = Manager("Manager", b, c, d, e, f, g, h, I, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z) employeeList.insert(i, blah)
def open_channels(self): file_path = tkFileDialog.askopenfilenames( title='Select MOLE tunnel files', filetypes=[('MOLE tunnels', '.xml .pdb .py')]) if self.plugin_type == "PyMOL": file_path = self.fix_list(file_path) for chan_file in file_path: chan_file = os.path.normcase(chan_file) extension = os.path.splitext(chan_file)[1].lower() name = os.path.basename(chan_file).split('.')[0].lower() if len(extension) < 3: return try: if extension == '.py': plugin.run(chan_file) if extension == '.xml': Manager.Manager().parse_XML_channel(chan_file, name, self) if extension == '.pdb': plugin().parse_PDB_channel(chan_file, name) except Exception, e: print(e)
def main(): app = QGuiApplication(argv) qmlRegisterType(Manager.Manager, 'BTManager', 1, 0, 'BTManager') qmlRegisterType(Notifier.Notifier, 'BTNotifier', 1, 0, 'BTNotifier') qmlRegisterType(Device.Device, 'Device', 1, 0, 'Device') print('Create my device') notifier = Notifier.Notifier() manager = Manager.Manager() manager.set_notifier(notifier) print('Bluetooth manager create') path = os.path.dirname(__file__) print('Detect run path') print('Run GUI') engine = QQmlApplicationEngine() engine.rootContext().setContextProperty('AppPath', path) engine.rootContext().setContextProperty('MyDevice', manager.my_device) engine.rootContext().setContextProperty('BTManager', manager) engine.rootContext().setContextProperty('BTNotifier', notifier) engine.load('ui/Main.qml') print('Start search for near by devices') manager.search(True) print('Execute app') exit(app.exec_())
def editor(state, feeds, googleapis, json_file, spread_sheet_name): print("Wait while Editor loads") manager = Manager( Authorize(feeds, googleapis, json_file, spread_sheet_name)) termination_clause = "EXIT" manager_functions = { "exit": lambda: termination_clause, "help": lambda: manager_keys, "grade": manager.grade_name_week, "range": manager.grade_by_range } manager_keys = "The commands are: " + ', '.join( [k for k in manager_functions.keys()]) while state != termination_clause: try: print(state) command, arguments = manager.parse_input( input("Ready for next Command \n")) state = manager_functions[command](*arguments) except KeyError: state = "Wrong command!" except TypeError: state = "Wrong arguments!" except ValueError: state = "Invalid argument types!" except gspread.exceptions.CellNotFound: state = "Cell not found!" except IndexError: state = "Not a valid range!"
def __init__(self): self.manager = Manager.Manager() self.downloader = html_downloader.Downloader() self.saver = html_saver.Saver() self.parser = html_parser.Parser(self.manager) self.manager.add_one_url("https://book.douban.com/") #self.manager.add_one_url("https://www.baidu.com/") self.limits = 100
def crete_manager(self): data = { "ManagerName": "superadmin", "ManagerPsd": "b9d9b8ddd5e59bc8cac074a2272dfb28" } obj = Manager.Manager(**data) session.add(obj) session.commit()
def handleFile(outFile): manager = Manager() with open(fName, mode='r') as file: _lines = list(line for line in (l.strip() for l in file) if line) for lines in _lines: # line = lines.rstrip('\r\n') line = lines.split() # print(line) if not line: break ## Case: Init if line[0] == "in": outFile.write("\n") outFile.write(manager.initialize()) ## Case: Create elif line[0] == "cr": output = manager.create(int(line[1])) if output == -1: outFile.write("-1 ") else: outFile.write(output) ## Case: Time Out elif line[0] == "to": outFile.write(manager.timeout()) ## Case: Request elif line[0] == "rq": output = manager.request(int(line[1]), int(line[2])) if output == -1: outFile.write("-1 ") else: outFile.write(output) ## Case: Release elif line[0] == "rl": if int(line[1]) > 3 or int(line[1]) < 0: outFile.write("-1 ") else: r = manager.rcbList[int(line[1])] result = manager.release(r, int(line[2])) if result == -1: outFile.write("-1 ") else: outFile.write(result) ## Case: Destroy elif line[0] == "de": if manager.pCount <= int(line[1]): outFile.write("-1 ") else: p = manager.pcbList[int(line[1])] output = manager.destroy(p) if output == -1: outFile.write("-1 ") else: outFile.write(output)
def check_status(self): if len(self.__host) == 0: print('No device host address set') return False self.__updating = True self.updatingChanged.emit() Manager.Manager().find_device_state(self)
def setDiag(self, sender): if sender == 'CQC Check-out': return Checkout.Checkout() elif sender == 'CQC WIP Report': return Report.Report(self.cs) elif sender == 'Product Manager': return Manager.Manager(self.cs) elif sender == 'CQC on the Way': return Shipment.Shipment(self.cs) elif sender == 'CQC Check-in': return Receipt.Receipt(self.cs) elif sender == ' CQC Transfer ': return Lookup.Lookup(self.cs)
def newEmployee(a, c, d, e, f, g, i, h, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z): global largestEmployeeID largestEmployeeID = largestEmployeeID + 1 if a == "Associate": blah = Associate(a, largestEmployeeID, c, d, e, f, g, i, h, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z) employeeList.append(blah) elif a == "Manager": blah = Manager(a, largestEmployeeID, c, d, e, f, g, i, h, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z) employeeList.append(blah)
def handleInput(): print("Test") manager = Manager() while True: x = raw_input().split() if "-1" == x[0]: break ## Case: Init if x[0] == "in": print manager.initialize() ## Case: Create elif x[0] == "cr": if manager.create(int(x[1])) == -1: print("-1") ## Case: Time Out elif x[0] == "to": manager.timeout() ## Case: Request elif x[0] == "rq": if manager.request(int(x[1]), int(x[2])) == -1: print("-1") ## Case: Release elif x[0] == "rl": r = manager.rcbList[int(x[1])] if r == -1: print("-1") else: manager.release(r, int(x[2])) ## Case: Destroy elif x[0] == "de": p = manager.pcbList[int(x[1])] if p == -1: print("-1") else: manager.destroy(p)
def new(): os.chdir('shelve_database') db = shelve.open('people-classes') while True: print('Введите имя и фамилию нового сотрудника:') name = input() while True: # цикл для неверной должности print('Введите должность сотрудника: ') print('Person\nManager\nUrbanist') input_class = input() if input_class == 'person' or input_class == 'Person': rec = Person.Person() break elif input_class == 'manager' or input_class == 'Manager': rec = Manager.Manager() break elif input_class == 'urbanist' or input_class == 'Urbanist': rec = Urbanist.Urbanist() break else: print('Неверная должность') rec.name = name blacklist = ['name'] if rec.job is not None: blacklist.append('job') print('Заполним: ') for key in rec.__dict__: if key not in blacklist: print(key + ' = ') new_value = input() setattr(rec, key, new_value) db[name] = rec print('Запись ' + rec.name + ' успешно добавлена') print('Вы хотите добавить другую запись? Нажмите y или n') choice = input() if choice == 'y': continue else: break
def __init__(self): manager = Manager.Manager() f = open("/Users/richardle/Desktop/init.txt", "r") line1 = f.readline() #ST Line 1: s1 z1 f1 s2 z2 f2 … sn zn fn line2 = f.readline() #PT Line 2: s1 p1 f1 s2 p2 f2 … sm pm fm line1 = line1.rstrip() line2 = line2.rstrip() line1 = line1.split(" ") line2 = line2.split(" ") manager.init_pm(line1,line2) va = open("/Users/richardle/Desktop/input.txt", "r") va_line1 = va.readline() va_line1 = va_line1.split(" ") open("/Users/richardle/Desktop/output.txt","w").close() for va in va_line1: manager.translate(int(va),"/Users/richardle/Desktop/nodp_output.txt")
def main(): manager = Manager() root = Tk() root.title("Employee Attendance Management System") root.geometry("500x330") title = Label(root, text="Choose an option:") title.pack() options = [ "1. Add employee manually", "2. Add employees from file", "3. Delete employee manually", "4. Delete employees from file", "5. Mark attendance", "6. Generate attendance report of an employee", "7. Print a report for current month for all employees", "8. Print an attendance report for all employees who were late (came after 9:30am)", ] r = IntVar() r.set(0) i = 1 for option in options: Radiobutton(root, text=option, variable=r, value=i, padx=10, pady=5).pack(anchor=W) i += 1 btn = Button(root, text="Launch", padx=20, pady=5, command=lambda: launch(r.get(), manager)) btn.pack() root.mainloop()
def main(): oldFileName = input("请输入文件夹的名字:") #创建一个文件夹 newFileName = oldFileName+".复件" os.mkdir(newFileName) #获取old文件夹中的文件 fileName = os.listdir(oldFileName) pool = Pool(5) queue = Manager().Queue() for name in fileName: pool.apply_async(copyFileTask,args=(name,oldFileName,newFileName,queue)) num = 0 allNum = len(fileName) while num<allNum: queue.get() num+=1 copyReta = num/allNum print("\rcopy的进度:%.2f%%"%(copyReta*100),end=" ") print("\n")
def main(self): # Endless while loop of which runs throughout the execution of the program while True: # Printing the restaurant name print(data.restaurant.capitalize() + " Restaurant Management System") # Taking user input to whether he/she wants to continue as a manager or an employee # or wants to quit the program choice = input("""Enter 1 for Manager 2 for Employee Any other number to exit""") if choice.isnumeric(): if int(choice) == 1: # Object of Manager() class of Manager.py created and its main method called manager = Manager.Manager() manager.main() elif int(choice) == 2: # Object of Employee() class of Employee.py created and its main method called employee = Employee.Employee() employee.main() else: break else: print("Invalid choice")
def getent(): from tkinter import messagebox b = int(entry1.get()) c = entry2.get() if b == 1: if c == "123manage": Manager() else: root = Tk() root.withdraw() messagebox.showerror("Error", "Wrong Password or Id") elif b == 2: if c == "123emp": Emp() else: root = Tk() root.withdraw() messagebox.showerror("Error", "Wrong Password or Id") else: root = Tk() root.withdraw() messagebox.showerror("Error", "Wrong Password or Id")
def main(): # Test Cases ''' dylan = Customer("Dylan", 19, 724, "MALE", 123, 10000, 2000) print(dylan.accessCustomerSupport()) print(dylan) money = dylan.withdrawal(123, 200) print(money) money2 = dylan.withdrawal(123, 2000) print(money2) money3 = dylan.withdrawal(123456789, 200) print(money3) dylan.deposit(5000000) dylan.deposit(5000000) print(Customer.amountOfCustomer()) del(dylan) print(Customer.amountOfCustomer()) ''' ''' dylan = Customer("Dylan", 19, 724, "MALE", 123, 10000, 2000) dylan2 = Customer("Dylan2", 19, 724, "MALE", 123, 90, 2000) print(dylan) print(dylan2) dylan.transferFunds(10, dylan2) print(dylan) print(dylan2) ''' ''' eric = Employee('Eric', 19, 7245491059, 'Male', 14, 'ewb5319', 'hello') #print(eric.paygrade()) #print(eric.accessCustomerSupport()) #print(eric.getEmployeeNumber()) #eric.changePassword() print(eric) print(Employee.employeeCount()) del(eric) print(Employee.employeeCount()) eric = Employee('Eric', 19, 7245491059, 'Male', 14, 'ewb5319', 'hello') print(eric) dude = Manager('dude', 19, 12345678, 'Male', 14, 'asdf', 'asdf') dude.givePromotion(eric, 1500) print(eric) ''' ''' dude = Manager('dude', 19, 12345678, 'Male', 14, 'asdf', 'asdf') dylan2 = Customer("Dylan", 19, 724, "MALE", 123, 10000, 2000) eric = Teller('Eric', 19, 7245491059, 'Male', 14, 1234, 1234, 'ewb5319', 'hello', dude) print(eric) print(dylan2) print(dude.seeCustomerDetails(dylan2)) print(eric.seeCustomerDetails(dylan2)) ''' ''' dylan2 = Customer("Dylan", 19, 724, "MALE", 123, 10000, 2000) print(dylan2) ATM(dylan2) print(dylan2) ''' ''' eric3 = Child('Eric', 14, 724, 'Male', 1234, 1000.50, 1000.50) print(eric3) print(Customer.amountOfCustomer()) print(Child.amountOfChildren()) eric3.deposit(500) eric3.checkChecBalance() eric3.checkSavBalance() print(eric3) ''' eric = Child('Eric', 14, 724, 'Male', 1, 1000, 1000) ATM(eric) dude = Manager('dude', 19, 12345678, 'Male', 14, 'asdf', 'asdf') print(dude.seeCustomerDetails(eric)) print(Customer.amountOfCustomer()) del eric print(Customer.amountOfCustomer()) ''' eric2 = Adult('Eric2', 19, 724, 'Male', 2, 1000, 1000) ''' ''' eric.checkChecBalance() eric2.checkChecBalance() eric.deposit(20) eric2.deposit(20) eric.checkChecBalance() eric2.checkChecBalance() eric2.childDeposit(20, eric) eric.checkChecBalance() eric2.withdrawal(2,20) eric2.checkChecBalance() ''' '''
import Manager start = Manager.Manager() start.run()
from attractions.Catapult import * from attractions.ChildrenTrain import * from attractions.ElectricCarAutodrome import * from attractions.FerrisWheel import * from attractions.Labyrinth import * from attractions.LaughRoom import * from Manager import * if __name__ == '__main__': manager = Manager() catapult = Catapult("Catapult", 18, 9, 8, 10.0) children_train = ChildrenTrain("ChildrenTrain", 5, 8, 78, "Anna") electric_car_autodrome = ElectricCarAutodrome("ElectricCarAutodrome", 5, 7, 8, 12) ferris_wheel = FerrisWheel("FerrisWheel", 4, 8, 9, 100) labyrinth = Labyrinth("Labyrinth", 8, 78, 7, 50) laugh_room = LaughRoom("LaughRoom", 4, 89, 78, 10) manager.attractions = [ catapult, children_train, electric_car_autodrome, ferris_wheel, labyrinth, laugh_room ] print("Initial list:") manager.print_list() manager.sort_by_price() print("Sorted list") manager.print_list() manager.attractions = manager.find_by_age(18)
from flask import Flask, render_template, render_template_string, \ abort, request, send_from_directory, session, redirect from flask_login import LoginManager, UserMixin, \ login_required, login_user, logout_user import hashlib import db.dbutils as dbutils import Goal as gl import GoalList as gls import Manager as man app = Flask(__name__) manager = man.Manager(1, 1, 1, 1) pages = [] goals = manager.WantList needs = manager.NeedList login_manager = LoginManager() login_manager.init_app(app) login_manager.login_view = '/login' login_manager.login_message = 'Please login to view the page' @app.route('/') @app.route('/index') def list_articles(): return render_template('index.html', title='kewl game', pages=pages) @app.route('/loggedin') @login_required
import Stepper, Manager manager = Manager.Manager() manager.start() manager.set_state('PISTON') manager.set_event('retractAll') carriage = Stepper.Stepper(speed = 500, accel = 250) carriage.home(0) carriage.goToPosition(230) manager.set_event('playC_InvertedChord')
def new_game(): def_competitions = [] def_managers = [] min_active_rep = TEAM_GLOBALS["MAX_REP"] - (TEAM_GLOBALS["MAX_REP"] - TEAM_GLOBALS["MIN_REP"]) * 0.85 rep_step = (TEAM_GLOBALS["MAX_REP"] - min_active_rep) / float( GAME_GLOBALS["ACTIVE_LEAGUES"] * GAME_GLOBALS["TEAMS_PER_LEAGUE"]) current_rep = TEAM_GLOBALS["MAX_REP"] for comp_id in range(GAME_GLOBALS["ACTIVE_LEAGUES"]): c = League.League("League " + str(comp_id + 1)) for team_id in range(GAME_GLOBALS["TEAMS_PER_LEAGUE"]): t = Team.Team(rep=int(current_rep)) m = Manager.Manager() hire_manager(team=t, manager=m) def_managers.append(m) #CREATE PLAYERS player_list = [] average_skill = sum( t.skill) / 3.0 - PLAYER_GLOBALS["MAX_SKILL"] * 0.05 for pos, qty in enumerate(TEAM_GLOBALS["PLAYERS_PER_POSITION"]): if pos == 0: how_many_players = qty + random.randint(0, 1) else: how_many_players = qty + random.randint(0, 2) for i in range(how_many_players): this_player_skill = average_skill - ( PLAYER_GLOBALS["MAX_SKILL"] * 0.05 * i) / float(how_many_players) player = Player.Player(skill=this_player_skill, pos=pos, avg_skill=True) player.season_training_increase_per_turn() player_list.append(player) t.players = player_list t.league_stats = TeamStats.TeamStats(c) c.teams.append(t) current_rep -= rep_step def_competitions.append(c) c = League.League("Non League") for team_id in range(GAME_GLOBALS["TEAMS_PER_LEAGUE"]): t = Team.Team(rep=int(current_rep - rep_step)) m = Manager.Manager() hire_manager(team=t, manager=m) def_managers.append(m) #CREATE PLAYERS player_list = [] average_skill = sum(t.skill) / 3.0 for pos, qty in enumerate(TEAM_GLOBALS["PLAYERS_PER_POSITION"]): for i in range(qty): player = Player.Player(skill=average_skill, pos=pos, avg_skill=True) player.season_training_increase_per_turn() player_list.append(player) t.players = player_list t.league_stats = TeamStats.TeamStats(c) c.teams.append(t) def_competitions.append(c) global competitions competitions = def_competitions global managers managers = def_managers
from Employee import* from Manager import* emp= Employee("Julia", 200000) print("Employee %s pay %.2f"% (emp.getFormattedName() ,emp.calculatePay())) emp= Employee("Anna", 200000, exempt=2) print("Employee %s pay %.2f"% (emp.getFormattedName() ,emp.calculatePay())) man=Manager("Hhhm", 10000000, 10000, "BeastMaster") print("Manager %s pay %.2f"% (man.getFormattedName() ,man.calculatePay()))
def __init__(self): self._client = InfluxDBClient(host=CNST.INFLUXDB_ADDR, port=8086, database=CNST.INFLUXDB_DB_NAME) self.manager = Manager() self._lc = Manager().Lock() self._var_list = self.manager.list() self.wrk = None
Usage: shell-3 --file=FILE shell-3 list This command does some useful things. Arguments: FILE a file name Options: -f specify the file """ arguments.FILE = arguments['--file'] or None VERBOSE(arguments) m = Manager() if arguments.FILE: print("option a") m.list(path_expand(arguments.FILE)) elif arguments.list: print("option b") m.list("just calling list without parameter") Console.error("This is just a sample") return ""
parser.AddOption("--as-sid", metavar="SID", help="restore the database as this SID rather than the one " "embedded in the backup file") cx_LoggingOptions.AddOptions(parser) parser.AddArgument( "baseFileName", required=True, help="the base name of the files to create; the extension .rmn will " "be added to this for the RMAN backup file and the extension " ".info will be added for the associated database info file") options = parser.Parse() cx_LoggingOptions.ProcessOptions(options) # perform the work manager = Manager.Manager(options.configFileName) backupSet = BackupSet.BackupSet(options.baseFileName) backupSet.PrepareForRestore(manager, options.sysPassword, options.tnsentry) databaseFromEnv = manager.DatabaseFromEnvironment(options.sysPassword, options.tnsentry) if databaseFromEnv: if options.replaceExisting: sid = options.asSid or databaseFromEnv.sid existingDatabase = manager.DatabaseBySid(sid, ignoreIfMissing=True) if existingDatabase is not None: existingDatabase.Remove() mapping = None database = backupSet.database if options.asSid: newDatabase = Database.Database(manager, options.asSid, databaseFromEnv.oracleHome,
def start(): aManager = Manager() aManager.runSimulation()
def ReadFile(): global largestEmployeeID try: f = open("workIdNumbers.txt", "r") largestEmployeeID = int(f.readline()) workIDList = f.readlines() f.close() for fileName in workIDList: if (fileName[-1:] == "\n"): fileName = fileName[:-1] f = open((str(fileName) + ".txt"), "r") jobTitle = f.readline()[:-1] if (jobTitle == "Associate"): fileName = Associate(jobTitle, f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()) employeeList.append(fileName) elif (jobTitle == "Manager"): fileName = Manager(jobTitle, f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()[:-1], f.readline()) employeeList.append(fileName) f.close() except: #the workIDNumbers.txt will be reset to blank workId.txt if it can not read the save files properly print "except" f = open("WorkIDNumbers.txt", "w") f.write("0\n") largestEmployeeID = 0 f.close()
def add_human_manager(str_name, team_idx): manager = Manager.Manager(name=str_name, human=True) team = get_team_by_idx(team_idx) hire_manager(team=team, manager=manager) managers.append(manager) return True