本文整理匯總了Python中View.View.clean_list方法的典型用法代碼示例。如果您正苦於以下問題:Python View.clean_list方法的具體用法?Python View.clean_list怎麽用?Python View.clean_list使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類View.View
的用法示例。
在下文中一共展示了View.clean_list方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: export_print_page
# 需要導入模塊: from View import View [as 別名]
# 或者: from View.View import clean_list [as 別名]
def export_print_page(self, event):
"""Export a print page using a JSON file"""
event.Skip()
if self.view.image is not None:
# We don't require an RMAP file, just rect data that we can generate
dlg = wx.FileDialog(self, "Choose a JSON file to load", "", "", "", wx.SAVE)
if dlg.ShowModal() == wx.ID_OK:
filename = dlg.GetFilename()
dirname = dlg.GetDirectory()
dlg.Destroy()
else:
self.SetStatusText(Preferences.failedToOpen)
return False
rmap_data = self.view.rects
try:
with open(join(dirname, filename), "r") as f:
json_data = loads(f.read())
except Exception as e:
self.SetStatusText(Preferences.failedToExport)
return False
fd = self.img.split(".")
fd.pop()
fname = ".".join(fd)
rmap_data = View.filter_list(rmap_data)
rmap_data = View.clean_list(rmap_data)
rmap_data = View.generate_data(rmap_data)
self.write_html_printpage(self.filename, fname, rmap_data, json_data)
else:
self.SetStatusText(Preferences.noImageLoaded)