예제 #1
0
 def exit(self):
     if not self.close_all(): return False
     self.update_config()
     try:
         fs.xremove_dir(self.appdata.app_temp_dir)
     except:
         pass
     config.save(self.appdata.app_config)
     gtk.main_quit()
     return True
예제 #2
0
파일: application.py 프로젝트: Scrik/sk1-wx
	def exit(self):
		if not self.close_all():return False
		self.update_config()
		try:
			fs.xremove_dir(self.appdata.app_temp_dir)
		except:
			pass
		config.save(self.appdata.app_config)
		gtk.main_quit()
		return True
예제 #3
0
    def close(self):
        file = self.doc_file
        self.doc_file = ''
        if not self.model is None:
            self.model.destroy()
        self.model = None

        self.send_ok(_('Document model is destroyed for') + ' %s' % (file))

        if self.doc_dir and os.path.lexists(self.doc_dir):
            try:
                fs.xremove_dir(self.doc_dir)
                self.send_ok(_('Cache is cleared for') + ' %s' % (file))
            except IOError:
                self.send_srror(_('Cache clearing is unsuccessful'))
예제 #4
0
파일: generic.py 프로젝트: Scrik/sk1-wx
	def close(self):
		filename = self.doc_file
		self.doc_file = ''
		if not self.model is None:
			self.model.destroy()
		self.model = None

		self.send_ok(_('Document model is destroyed for') + ' %s' % (filename))

		if self.doc_dir and os.path.lexists(self.doc_dir):
			try:
				fs.xremove_dir(self.doc_dir)
				self.send_ok(_('Cache is cleared for') + ' %s' % (filename))
			except IOError:
				self.send_srror(_('Cache clearing is unsuccessful'))
예제 #5
0
    def close(self):
        filename = self.doc_file
        self.doc_file = ''
        if self.model is not None:
            self.model.destroy()
        self.model = None
        model_name = uc2const.FORMAT_NAMES[self.cid]
        self.send_ok(_('<%s> document model is destroyed for %s') %
                     (model_name, filename))

        if self.doc_dir and fsutils.exists(self.doc_dir):
            try:
                fs.xremove_dir(self.doc_dir)
                self.send_ok(_('Cache is cleared for') + ' %s' % filename)
            except Exception as e:
                msg = _('Cache clearing is unsuccessful')
                self.send_error(msg)
                LOG.warning(msg + ' %s', e)
                LOG.exception(e)
예제 #6
0
    def close(self):
        filename = self.doc_file
        self.doc_file = ''
        if self.model is not None:
            self.model.destroy()
        self.model = None
        filename = filename.encode('utf-8') \
            if isinstance(filename, unicode) else filename
        model_name = uc2const.FORMAT_NAMES[self.cid]
        self.send_ok(
            _('<%s> document model is destroyed for %s') %
            (model_name, filename))

        if self.doc_dir and fsutils.lexists(self.doc_dir):
            try:
                fs.xremove_dir(fsutils.get_sys_path(self.doc_dir))
                self.send_ok(_('Cache is cleared for') + ' %s' % filename)
            except Exception as e:
                msg = _('Cache clearing is unsuccessful')
                self.send_error(msg)
                LOG.warn(msg + ' %s', e)