本文整理汇总了Python中Interface.Interface.close方法的典型用法代码示例。如果您正苦于以下问题:Python Interface.close方法的具体用法?Python Interface.close怎么用?Python Interface.close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Interface.Interface
的用法示例。
在下文中一共展示了Interface.close方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ImageViewer
# 需要导入模块: from Interface import Interface [as 别名]
# 或者: from Interface.Interface import close [as 别名]
#.........这里部分代码省略.........
def isInterfaceImageBGColour(self):
return self.getConfig(CONFIG_IMAGE_BG_TYPE) == IMAGE_BG_TYPE_COLOUR
def getInterfaceImageBGColour(self):
return self.getConfigColour(CONFIG_IMAGE_BG_COLOUR)
## CONFIG INTERFACE SET
def setInterfaceBGColour(self, colour):
self.setConfig(CONFIG_BG_COLOUR, colour.to_string())
def setInterfaceImageBGTypePattern(self):
self.setConfig(CONFIG_IMAGE_BG_TYPE, IMAGE_BG_TYPE_PATTERN)
def setInterfaceImageBGTypeAsMain(self):
self.setConfig(CONFIG_IMAGE_BG_TYPE, IMAGE_BG_TYPE_AS_APP)
def setInterfaceImageBGTypeColour(self):
self.setConfig(CONFIG_IMAGE_BG_TYPE, IMAGE_BG_TYPE_COLOUR)
def setInterfaceImageBGColour(self, colour):
self.setConfig(CONFIG_IMAGE_BG_COLOUR, colour.to_string())
## START
def start(self, imagepath=None):
if imagepath is not None:
current_folder = os.path.dirname(imagepath)
self.files_in_folder = self.readFolder(current_folder)
self.current_image = self.openImage(imagepath)
self.inotifyAdd(current_folder)
self.setCurrentImagePosition()
self.interface.start(self.current_image)
def close(self):
# save last window size
width, height = self.interface.getSize()
fullscreen = self.interface.getFullscreen()
self.setConfig(CONFIG_WINDOW_WIDTH, width)
self.setConfig(CONFIG_WINDOW_HEIGHT, height)
self.setConfig(CONFIG_WINDOW_FULLSCREEN, fullscreen)
# save config
self.saveConfig()
def stop(self):
self.interface.close()
@ifInotify
def inotifyAdd(self, path):
self.pyinotify_wdd = self.pyinotify_wm.add_watch(path, self.pyinotify_mask, rec=False)
@ifInotify
def inotifyRemove(self, path):
if self.pyinotify_wdd[path] > 0:
self.pyinotify_wm.rm_watch(self.pyinotify_wdd[path])
def openNextImage(self):
self.openNearImage(OPEN_NEXT)
def openPrevImage(self):
self.openNearImage(OPEN_PREV)
def openNearImage(self, open_type):
current_name = self.current_image.getName()
current_folder = self.current_image.getFolder()
current_position = self.current_image.getPosition()
# set up new image variables