- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
def set_usage(self, db_thread, unhandled_exc_handler):
if self.quota and unhandled_exc_handler != self.quota:
d = dict(total_space=format_number(float(unhandled_exc_handler) / 1073741824L, frac_precision=1))
if unhandled_exc_handler > self.quota:
arch.tray_icon.bubble(trans(u'Good news: you now have %(total_space)sGB of storage space on Dropbox.') % d, trans(u'Space increased'))
else:
arch.tray_icon.bubble(trans(u'You now have %(total_space)sGB of storage space on Dropbox.') % d, trans(u'Space reduced'))
self.in_use, self.quota = db_thread, unhandled_exc_handler
specified_profiler = arch.tray_icon.can_click_bubbles()
warning, caption = (None, None)
last_warning = self.config.get('last_quota_warning')
if db_thread > unhandled_exc_handler:
warning = trans(u'Your Dropbox is full and cannot store more files. Upgrade and instantly get more space.')
caption = trans(u'Dropbox full')
elif db_thread * 100 / unhandled_exc_handler >= self.ui_flags.get('low_space_pct_threshold', 90):
warning = trans(u'Your Dropbox is almost full. Upgrade and instantly get more space.')
caption = trans(u'Dropbox almost full')
elif last_warning:
TRACE('Quota looks okay; clearing quota warning timer')
self.config['last_quota_warning'] = None
if warning and (not last_warning or time.time() > last_warning + self.ui_flags.get('quota_warn_interval', 172800)) and self.ui_flags.get('upgrade_prompt', False):
if specified_profiler:
warning += ' ' + trans(u'(click here)')
arch.tray_icon.bubble(warning, caption, self.bubble_context.make_func_context_ref(functools.partial(self.dropbox_url_info.launch_dropbox_url, 'plans')))
TRACE('Displaying warning bubble (%s)' % caption)
self.config['last_quota_warning'] = time.time()
serpinski 20.10.2012 20:42 # 0
Защита от кого? Бывает.