本文整理匯總了Python中FileManager.FileManager.get_itemat方法的典型用法代碼示例。如果您正苦於以下問題:Python FileManager.get_itemat方法的具體用法?Python FileManager.get_itemat怎麽用?Python FileManager.get_itemat使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FileManager.FileManager
的用法示例。
在下文中一共展示了FileManager.get_itemat方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: on_window_destroy
# 需要導入模塊: from FileManager import FileManager [as 別名]
# 或者: from FileManager.FileManager import get_itemat [as 別名]
#.........這裏部分代碼省略.........
pos = self.filemgr.get_previmagepos(pos)
if(pos != None):
self.iconview.select_path(pos)
self.load_image()
def action_activate_link(self, widget, link):
""" handle clicks in label links """
link = urllib.unquote(link)
self.new_query(link)
def get_currentpos(self):
""" return the number (position) of the currently selected icon
returns None if nothing is selected
"""
pos = self.iconview.get_selected_items()
if(pos == None):
return None;
return pos[0][0] # array, tuple
def load_image(self):
""" Load the next image to show """
self.save_image()
panel = self.builder.get_object('imagepanel')
panel.hide()
self.image.hide()
pos = self.get_currentpos()
if(pos == None):
return
img = self.filemgr.get_itemat(pos)
if(img['ft'] == 'dir'):
return
self.meta = Metadata(img['fn']);
obj = self.builder.get_object('imgtitle')
obj.set_text(self.meta.get_title())
obj.set_sensitive(self.meta.writable)
obj = self.builder.get_object('imgcontent')
obj.set_text(self.meta.get_content())
obj = self.builder.get_object('imgcontentbox')
obj.set_sensitive(self.meta.writable)
obj = self.builder.get_object('imgtags')
obj.set_text(self.meta.get_tags())
obj.set_sensitive(self.meta.writable)
obj = self.builder.get_object('imgname')
obj.set_text(os.path.basename(img['fn']))
panel.show()
while gtk.events_pending():
gtk.main_iteration(False)
self.image.set_from_file(img['fn'])
self.image.show()
def save_image(self):
""" Save metadata of the currently loaded image (if any) """
if(self.meta == None):