def keyEvent(self, key): if key == ord('\n'): self.manager.push( factuurList( 1, 1, remote_call('/factuur/vereniging', [('vereniging_id', self.vereniging_info[0])]), remote_call('/budget/vereniging', [ ('vereniging_id', self.vereniging_info[0]) ])[0]['current'], self.manager))
def _budgetSugInit(): global _isInitialized global _budgetList global _budgetNameList _verenigingList = remote_call('/verenigingen') _budgetList = [] for vereniging in _verenigingList: _budgetList = remote_call('/budget/vereniging', [('vereniging_id', vereniging['id'])]) for budget in _budgetList: _budgetNameList.append((vereniging['naam'].encode('utf-8') + '-' + budget['naam'].encode('utf-8'), budget['id'])) _budgetNameList.sort() _isInitialized = True
def sendEdit(self): result = self.generateRegels() if not result[0]: self.statusLine.setText(result[2]) return if not result[1]: self.statusLine.setText("Insufficient input given") return try: data = {} data["factuur_id"] = self.factuur["id"] data["regels"] = result[2] submitResult = remote_call('/factuur/bewerk', jsondata = data) except ServerCallException: self.statusLine.setText("Kon geen verbinding maken met server.") return if 'error' in submitResult: self.statusLine.setText(submitResult['error'].encode('utf-8')) return self.statusLine.setText("") unsetCursor() self.manager.pop() self.resize(self.width, self.height)
def sendFactuur(self): result = self.generateFactuur() if not result[0]: self.statusLine.setText(result[2]) return if not result[1]: self.statusLine.setText("Insufficient input given") return try: submitResult = remote_call('/factuur/create', jsondata=result[2]) except ServerCallException: self.statusLine.setText("Kon geen verbinding maken met server.") return if 'error' in submitResult: self.statusLine.setText(submitResult['error'].encode('utf-8')) return self.statusLine.setText("") self.remChild(self.factuurRegelListIdx) #warning: fragile self.remChild(self.factuurDataIdx) self.factuurData = FactuurData(1, 1) self.factuurDataIdx = self.addChild(0, 0, self.factuurData) self.factuurRegelList = FactuurRegelList(1, 1) self.factuurRegelListIdx = self.addChild(0, 0, self.factuurRegelList) self.resize(self.width, self.height)
def sendFactuur(self): result = self.generateFactuur() if not result[0]: self.statusLine.setText(result[2]) return if not result[1]: self.statusLine.setText("Insufficient input given") return try: submitResult = remote_call('/factuur/create', jsondata = result[2]) except ServerCallException: self.statusLine.setText("Kon geen verbinding maken met server.") return if 'error' in submitResult: self.statusLine.setText(submitResult['error'].encode('utf-8')) return self.statusLine.setText("") self.remChild(self.factuurRegelListIdx) #warning: fragile self.remChild(self.factuurDataIdx) self.factuurData = FactuurData(1,1) self.factuurDataIdx = self.addChild(0,0,self.factuurData) self.factuurRegelList = FactuurRegelList(1,1) self.factuurRegelListIdx = self.addChild(0,0,self.factuurRegelList) self.resize(self.width, self.height)
def _init_vereniging_list(): global _got_info global _name_dict global _id_dict vereniging_list = remote_call('/verenigingen') for vereniging in vereniging_list: _name_dict[vereniging['id']] = vereniging['naam'] _id_dict[vereniging['naam']] = vereniging['id'] _got_info = True
def _init_vereniging_list(): global _got_info global _name_dict global _id_dict vereniging_list = remote_call('/verenigingen') for vereniging in vereniging_list: _name_dict[vereniging['id']] = vereniging['naam'] _id_dict[vereniging['naam']] = vereniging['id'] _got_info = True
def _init_product_list(): global _got_info global _name_dict global _id_dict product_list = remote_call('/product/all') for product in product_list: _name_dict[product['id']] = product['naam'] _type_dict[product['id']] = product['type'] _id_dict[product['naam']] = product['id'] _got_info = True
def _init_product_list(): global _got_info global _name_dict global _id_dict product_list = remote_call('/product/all') for product in product_list: _name_dict[product['id']] = product['naam'] _type_dict[product['id']] = product['type'] _id_dict[product['naam']] = product['id'] _got_info = True
def _verSugInit(): global _isInitialized global _verenigingList global _verenigingNameList _verenigingList = remote_call('/verenigingen') for vereniging in _verenigingList: _verenigingNameList.append((vereniging['naam'].encode('utf-8'), vereniging['id'])) _verenigingNameList.sort() _isInitialized = True
def _verSugInit(): global _isInitialized global _verenigingList global _verenigingNameList _verenigingList = remote_call('/verenigingen') for vereniging in _verenigingList: _verenigingNameList.append( (vereniging['naam'].encode('utf-8'), vereniging['id'])) _verenigingNameList.sort() _isInitialized = True
def _prodSugInit(): global _isInitialized global _productList global _productNameList global _productNumberList _productList = remote_call('/product/all') # Build product name and number lists for product in _productList: _productNameList.append((product['naam'].encode('utf-8'), product['id'])) _productNumberList.append((product['leverancier_id'].encode('utf-8'), product['id'])) _productNameList.sort() _productNumberList.sort() _isInitialized = True
help= 'Gebruikersnaam om mee in te loggen (standaard de gebruikersnaam waarme is ingelogd op de lokale machine).', default=getpass.getuser()) cmd_parser.add_argument('--all', '-a', action='store_true', default=False, help='Geef informatie van alle verenigingen.') arguments = cmd_parser.parse_args() # login prompt_login(arguments.user) try: verenigingen = servercall.remote_call('/verenigingen') except servercall.ServerCallException: print >> sys.stderr, 'Kon geen verbinding opbouwen met madmin server.' sys.exit(1) if arguments.all: for vereniging in verenigingen: try: budgetten = servercall.remote_call( '/budget/vereniging', [('vereniging_id', vereniging['id'])]) except servercall.ServerCallException: print >> sys.stderr, 'Kon geen verbinding opbouwen met madmin server.2' sys.exit(1) print '{0}:'.format(vereniging['naam']) for budget in budgetten: print '{0}: {1} (Minimum: {2})'.format(
def keyEvent(self, key): if key == ord('\n'): self.manager.push( factuurList(1, 1, remote_call('/factuur/leverancier'), self.manager))
def keyEvent(self, key): if key == ord('\n'): self.manager.push(factuurList(1,1, remote_call('/factuur/leverancier'), self.manager))
def keyEvent(self, key): if key == ord('\n'): self.manager.push(factuurList(1,1, remote_call('/factuur/vereniging',[('vereniging_id', self.vereniging_info[0])]), self.manager))
from client_lib.servercall import login, remote_call, ServerLoginError, ServerCallException import getpass import sys username = raw_input("Username: "******"Old password: "******"Kon niet inloggen met gegeven gebruikersnaam/wachtwoord." sys.exit(1) new_pass = getpass.getpass("New password: "******"/setpassword", [('password', new_pass)]) except ServerCallException: print >> sys.stderr, "Fout bij veranderen wachtwoord." sys.exit(1) if not status: print >> sys.stderr, "Wachtwoord kon niet worden veranderd." sys.exit(1)
default=getpass.getuser() ) cmd_parser.add_argument( '--all', '-a', action='store_true', default=False, help='Geef informatie van alle verenigingen.' ) arguments = cmd_parser.parse_args() # login prompt_login(arguments.user) try: verenigingen = servercall.remote_call('/verenigingen') except servercall.ServerCallException: print >> sys.stderr, 'Kon geen verbinding opbouwen met madmin server.' sys.exit(1) if arguments.all: for vereniging in verenigingen: try: budgetten = servercall.remote_call('/budget/vereniging', [('vereniging_id', vereniging['id'])]) except servercall.ServerCallException: print >> sys.stderr, 'Kon geen verbinding opbouwen met madmin server.2' sys.exit(1) print '{0}:'.format(vereniging['naam']) for budget in budgetten: print '{0}: {1} (Minimum: {2})'.format(budget['naam'], moneyConvert(budget['current']), moneyConvert(budget['minimum']))