def update(): """ Update all application data not in repository (copy, assets, etc). """ text.update() assets.sync() data.update()
def update(): """ Update all application data not in repository (copy, assets, etc). """ utils.install_font(force=False) text.update() assets.sync() data.update()
def update(): """ Update all application data not in repository (copy, assets, etc). 5/23/18 - DISABLED GDOCS CONNECTION """ print 'The Google Spreadsheets connection has been disabled. See project README.' #text.update() assets.sync() data.update()
async def write_single(item: Json): try: item = parse(*(await get_item(session, item, length, **kwargs))) data.update({ item['name']: item }) except Exception as e: if not isinstance(e, URLException): logger.exception("Exception occurred") else: with open(file_name, 'w', encoding='utf-8') as file: json.dump(data, file, ensure_ascii=False, indent=4)
def update(): """ Update all application data not in repository (copy, assets, etc). """ utils.install_font(force=False) text.update() assets.sync() data.update() # Get google document exported as HTML text.get_transcript()
def task(): taskApp = data.read() task = taskapp_pb2.Task() newTask = toBuffer(request.data, task, gettingJson(request)) matchingTasks = filterById(taskApp.tasks, newTask.id) if len(matchingTasks) > 0: data.update(matchingTasks[0], newTask) data.write(taskApp) else: newTask.time_created.GetCurrentTime() newTask.last_updated.GetCurrentTime() newTask.id = str(uuid.uuid4()) taskApp.tasks.extend([newTask]) data.write(taskApp) return fromBuffer(newTask, gettingJson(request))
def xlsx_fitting_data(fitting_data, label, participant, file_name_generator): """ Saves the fitting data to an XLSX file Parameters ---------- fitting_data : dict, optional Dictionary of details of the different fits, including an ordered dictionary containing the parameter values tested, in the order they were tested, and a list of the fit qualities of these parameters. label : str The label used to identify the fit in the file names participant : dict The participant data file_name_generator : function Creates a new file with the name <handle> and the extension <extension>. It takes two string parameters: (``handle``, ``extension``) and returns one ``fileName`` string """ data = {} partData = outputting.newListDict(participant, 'part') data.update(partData) parameter_fitting_dict = copy.copy(fitting_data["tested_parameters"]) parameter_fitting_dict['participant_fitting_name'] = fitting_data.pop("Name") #parameter_fitting_dict['fit_quality'] = fittingData.pop("fit_quality") #parameter_fitting_dict["fitQualities"] = fittingData.pop("fitQualities") for k, v in fitting_data.pop("final_parameters").items(): parameter_fitting_dict[k + "final"] = v parameter_fitting_dict.update(fitting_data) data.update(parameter_fitting_dict) record_data = outputting.newListDict(data, "") record = pd.DataFrame(record_data) name = "data/" + label output_file = file_name_generator(name, 'xlsx') xlsxT = pd.ExcelWriter(output_file) record.to_excel(xlsxT, sheet_name='ParameterFits') xlsxT.save()
def editItem(self): print "Edit Item" if self.isstatus() is False: self.status.focus_set() return False if self.issize() is False: self.size.focus_set() return False if self.isqty() is False: self.getqty.focus_get() return False if self.id.get(): item_id= str(self.id.get()) m=[str(i['id']) for i in GET_ITEMS] if item_id in m: eid=self.id.get() print eid issue_status=self.isvalue(self.status.get()) issue_from=self.isvalue(self.fromL.get()) issue_to=self.isvalue(self.toL.get()) issue_date=self.isvalue(self.date.get()) issue_size=self.isvalue(self.size.get()) issue_product=self.isvalue(self.product.get()) issue_qty=self.isvalue(self.qty.get()) issue_type=self.isvalue(self.type.get()) remarks=self.isvalue(self.remark.get(1.0,END)) create_by=self.username create_date=datetime.datetime.now().strftime('%Y/%m/%d-%H%M') edit_list=[issue_status,issue_from,issue_to,issue_date,issue_type,issue_size,issue_qty,issue_product,remarks,create_by,create_date] a=data.update('safety_shoes',eid,edit_list) if a: tkMessageBox.showinfo('Notice','Edit Success.') self.clearItem() self.get_item_list() self.id.set('') self.get_first_page() self.status.focus_set() else: tkMessageBox.showinfo('Notice','plese try again.') self.status.focus_set() return else: tkMessageBox.showinfo('Notice','Please check your data.') self.status.focus_set() return
def run(self): while self.__active: time.sleep(60) if self.__api.getOnlineState(self.__channel_name): self.__users = data.load(config.PATH+"channel/"+self.__channel_name+"/users.csv") if self.__active: users_chat = self.__api.getChatters(self.__channel_name) if users_chat is not None: for i in range(len(users_chat)): user = data.get_element(users_chat[i].lower(), self.__users) if user is not None: watched = int(user[eUser.watchtime]) + 1 if not data.update(users_chat[i].lower(), [None, None, None, None, None, None, None, watched], self.__users): self.__users.append([users_chat[i].lower(), 0, 100, False, 0, 0, 0, watched]) else: watched = 1 self.__users.append([users_chat[i].lower(), 0, 100, False, 0, 0, 0, watched]) data.save(config.PATH+"channel/"+self.__channel_name+"/users.csv", self.__users)
def editItem(self): if not self.isstatus(): self.status.focus_set() return False if not self.issize(): self.size.focus_set() return False if not self.isqty(): self.getqty.focus_get() return False if self.id.get(): item_id= int(self.id.get()) print item_id m=list(i['id'] for i in GET_ITEMS) print m if item_id in m: id=self.id.get() issue_status=self.isvalue(self.status.get()) issue_from=self.isvalue(self.fromL.get()) issue_to=self.isvalue(self.toL.get()) issue_date=self.isvalue(self.date.get()) size=self.isvalue(self.size.get()) product_name=self.isvalue(self.product.get()) qty=self.isvalue(self.qty.get()) remarks=self.isvalue(self.remark.get(1.0,END)) create_by=self.user create_date=datetime.datetime.now().strftime('%Y%m%d-%MH%M') edit_list=[issue_from,issue_to,product_name,size,qty,issue_date,issue_status,remarks,create_by,create_date] a=data.update(id,edit_list) if a: tkMessageBox.showinfo('Notice','Edit Success.') self.clearItem() self.id.set('') self.get_first_page() self.status.focus_set() else: tkMessageBox.showinfo('Notice','plese try again.') self.status.focus_set() return else: tkMessageBox.showinfo('Notice','Please check your data.') self.status.focus_set() return
import sqlalchemy as sa from data import insert, select, update from models import create_tables engine = sa.create_engine("sqlite:///some.db") create_tables(engine) insert(engine) select(engine) update(engine)
def targetload(items): for each in items: jso = {'ip': each['ipv4'], 'dns': each['hostname'], 'ops': 'add'} data.update(jso)
from data import update update()
def _tursib_version(): return data.update()
def dataupdate(): tmp = json.loads(bottle.request.body.read().decode()) return data.update(tmp)
def update_student(): global students student = request.get_json(force=True) students = data.update(students, student) return "Updated"
pos = agrid[int(j / rez)][int(i / rez)] if pos.val == 'p': app.fill(20, 20, 255) elif pos.val == "n": app.fill(255, 10, 30) elif pos.val == "b": app.fill(150, 150, 20) else: g = pos.val * 255 app.fill(20, g, 10) app.rect(i, j, rez, rez) app.textAlign(CENTER, CENTER) app.fill(255) app.textSize(22) app.pushMatrix() app.translate(rez / 2, rez / 2) if pos.isDigit: app.text(f'{pos.val : .2f}', i, j) else: app.text(pos.pval, i, j) if pos.isDigit: showDir(pos, i, j) app.popMatrix() delta, agrid = update(agrid) delay(0.2) if delta >= 0.005 * (1 - l) / l: app.redraw() else: boolean = False print(f'total iteration before convergence : {iter}') iter += 1