comparison cagou/core/cagou_main.py @ 188:0abd24ab81b1

core: retrieve downloads_dir on startup
author Goffi <goffi@goffi.org>
date Tue, 22 May 2018 19:25:23 +0200
parents c63922860f80
children a91abcd6d9a5
comparison
equal deleted inserted replaced
187:d11df7793399 188:0abd24ab81b1
350 super(Cagou, self).__init__(bridge_factory=bridge_module.Bridge, xmlui=xmlui, check_options=quick_utils.check_options, connect_bridge=False) 350 super(Cagou, self).__init__(bridge_factory=bridge_module.Bridge, xmlui=xmlui, check_options=quick_utils.check_options, connect_bridge=False)
351 self._import_kv() 351 self._import_kv()
352 self.app = CagouApp() 352 self.app = CagouApp()
353 self.app.host = self 353 self.app.host = self
354 self.media_dir = self.app.media_dir = config.getConfig(main_config, '', 'media_dir') 354 self.media_dir = self.app.media_dir = config.getConfig(main_config, '', 'media_dir')
355 self.downloads_dir = self.app.downloads_dir = config.getConfig(main_config, '', 'downloads_dir')
356 if not os.path.exists(self.downloads_dir):
357 try:
358 os.makedirs(self.downloads_dir)
359 except OSError as e:
360 log.warnings(_(u"Can't create downloads dir: {reason}").format(reason=e))
355 self.app.default_avatar = os.path.join(self.media_dir, "misc/default_avatar.png") 361 self.app.default_avatar = os.path.join(self.media_dir, "misc/default_avatar.png")
356 self.app.icon = os.path.join(self.media_dir, "icons/muchoslava/png/cagou_profil_bleu_96.png") 362 self.app.icon = os.path.join(self.media_dir, "icons/muchoslava/png/cagou_profil_bleu_96.png")
357 self._plg_wids = [] # main widgets plugins 363 self._plg_wids = [] # main widgets plugins
358 self._plg_wids_transfer = [] # transfer widgets plugins 364 self._plg_wids_transfer = [] # transfer widgets plugins
359 self._import_plugins() 365 self._import_plugins()