def getPngFileFromClipboard(copyToResourceStore=False): u"""Returns the (temp) file path to png file representing the clipboard bitmap or None otherwise. If copyToResourceStore = true, then the tmp image file is copied to the resource store. """ #$NON-NLS-1$ filepath = None bmp = getBitmapFromClipboard() if bmp: try: osutil = getOSUtil() tempDir = osutil.getSystemTempDirectory() name = generateFilename(u"zrclip", u".png") #$NON-NLS-1$ #$NON-NLS-2$ filepath = os.path.abspath( os.path.join(tempDir, name) ) bmp.SaveFile(filepath, wx.BITMAP_TYPE_PNG) except Exception, e: filepath = None getLoggerService().exception(e)
def getPngFileFromClipboard(copyToResourceStore=False): u"""Returns the (temp) file path to png file representing the clipboard bitmap or None otherwise. If copyToResourceStore = true, then the tmp image file is copied to the resource store. """ #$NON-NLS-1$ filepath = None bmp = getBitmapFromClipboard() if bmp: try: osutil = getOSUtil() tempDir = osutil.getSystemTempDirectory() name = generateFilename(u"zrclip", u".png") #$NON-NLS-1$ #$NON-NLS-2$ filepath = os.path.abspath(os.path.join(tempDir, name)) bmp.SaveFile(filepath, wx.BITMAP_TYPE_PNG) except Exception, e: filepath = None getLoggerService().exception(e)
def _createDestFile(self): name = generateFilename(u"zrtn", u"_tn.jpg") #$NON-NLS-1$ #$NON-NLS-2$ return os.path.join(self.thumbnailDir, name) #$NON-NLS-1$