fileHelper.saveConfig(ConfigKeys.LastDestinationPath, path) def switchPaths(): helper = uiHelper.sourcePath.get() fileHelper.saveConfig(ConfigKeys.LastSourcePath, uiHelper.destinationPath.get()) uiHelper.sourcePath.set(uiHelper.destinationPath.get()) uiHelper.destinationPath.set(helper) fileHelper.saveConfig(ConfigKeys.LastDestinationPath, helper) # load last paths fileHelper = FileHelper() sourcePath = fileHelper.loadConfig(ConfigKeys.LastSourcePath) destinationPath = fileHelper.loadConfig(ConfigKeys.LastDestinationPath) # setup uiHelper = UiHelper(root=Tk(), fileHelper=fileHelper) uiHelper.sourcePath = sourcePath uiHelper.destinationPath = destinationPath # add ui elements uiHelper.addLabel("Source Path", row=0, column=0) uiHelper.addLabel("Destination Path", row=1, column=0) uiHelper.addTextBoxes() uiHelper.addButton("Open", row=0, column=10, command=openSourcePath) uiHelper.addButton("Open", row=1, column=10, command=openDestinationPath)
def __init__(self): self.reg = r'UI(\d{6})' self.restTemplate = RestTemplate() self.fileHelper = FileHelper() self.attachmentApi = "http://tracker.paas.cmbchina.cn/tracker/attachment/queryAttachFile?referenceId={storyId}&type=story"
"[WARNING] The index of elements data is incorrect. Some data maybe lost ..." ) print("Keep running crawler program.") # Save data cafe_googlemap_info["comments"] = comment_info_list # Back to shop information in Google Map super().click_ele("button.ozj7Vb3wnYq__action-button-clickable", sleep_time=3) return cafe_googlemap_info if __name__ == '__main__': file_helper = FileHelper() # Read the basic data (Target coffee shop list) cafe_data = file_helper.read_data() cafe_ids = [file_helper.get_cafe_id(data) for data in cafe_data] cafe_googlemap_url = [ file_helper.get_googlemap_url(data) for data in cafe_data ] cafe_googlemap_lat = [ file_helper.get_googlemap_lat(data) for data in cafe_data ] cafe_googlemap_lng = [ file_helper.get_googlemap_lng(data) for data in cafe_data ] # Start to crawl data start_index = 14