def export(self, slide):\r
"""\r
Export a relatively low-resolution image of a slide using PowerPoint's built-in export \r
- function. The cache destination is set in the config.\r
+ function. The cache destination is set in the config. The slide is not exported if it has \r
+ a non-stale cached file.\r
"""\r
destination = config.prefs["Main"]["cache"] + "\\" + self.presentation.Name + "\\" + str(slide) + "." + config.prefs["Main"]["cache_format"].lower()\r
logger.debug("Exporting slide {} of {}".format(slide, self.presentation.Name))\r
os.makedirs(os.path.dirname(destination), exist_ok=True)\r
- if not os.path.exists(destination) or time.time() - os.path.getmtime(destination) > config.prefs.getint("Main", "cache_timeout"):\r
+ if not os.path.exists(destination) or (config.prefs.getint("Main", "cache_timeout") > 0 and \r
+ time.time() - os.path.getmtime(destination) > config.prefs.getint("Main", "cache_timeout")):\r
if slide <= self.slide_total():\r
attempts = 0\r
while attempts < 3:\r
if config.prefs["Main"]["logging"] == "debug":\r
log_level = logging.DEBUG\r
elif config.prefs["Main"]["logging"] == "info":\r
- log_level = logging.CRITICAL\r
+ log_level = logging.INFO\r
else:\r
log_level = logging.WARNING\r
- log_level = logging.DEBUG\r
\r
log_formatter = logging.Formatter("%(asctime)s [%(threadName)-12.12s] [%(levelname)-7.7s] %(message)s")\r
logger = logging.getLogger("ppt-control")\r
icon = MyIcon(PKG_NAME)\r
icon.icon = Image.open(os.path.dirname(os.path.realpath(__file__)) + r'''\static\icons\ppt.ico''')\r
icon.title = "{} {}".format(PKG_NAME, PKG_VERSION)\r
- #refresh_menu(icon)\r
icon.visible = True\r
icon.run(setup=start_server)\r
\r