Add status command line arg

This commit is contained in:
Gobinath 2018-01-28 20:16:02 -05:00
parent 5d454c9020
commit 866bea6b30
33 changed files with 312 additions and 64 deletions

4
.gitignore vendored
View File

@ -97,4 +97,6 @@ ENV/
.ropeproject
# Visual Studio Code settings
.vscode/
.vscode/
*.safeeyes.po~

View File

@ -56,6 +56,7 @@ class SafeEyes(object):
self.plugins_manager = None
self.settings_dialog_active = False
self.rpc_server = None
self._status = ''
# Initialize the Safe Eyes Context
self.context['version'] = SAFE_EYES_VERSION
@ -65,7 +66,8 @@ class SafeEyes(object):
self.context['api']['show_settings'] = lambda: Utility.execute_main_thread(self.show_settings)
self.context['api']['show_about'] = lambda: Utility.execute_main_thread(self.show_about)
self.context['api']['enable_safeeyes'] = lambda next_break_time=-1: Utility.execute_main_thread(self.enable_safeeyes, next_break_time)
self.context['api']['disable_safeeyes'] = lambda: Utility.execute_main_thread(self.disable_safeeyes)
self.context['api']['disable_safeeyes'] = lambda status: Utility.execute_main_thread(self.disable_safeeyes, status)
self.context['api']['status'] = self.status
self.context['api']['quit'] = lambda: Utility.execute_main_thread(self.quit)
if self.config.get('persist_state'):
self.context['session'] = Utility.open_session()
@ -209,7 +211,7 @@ class SafeEyes(object):
self.safe_eyes_core.start(scheduled_next_break_time)
self.plugins_manager.start()
def disable_safeeyes(self):
def disable_safeeyes(self, status=None):
"""
Listen to tray icon disable action and send the signal to core.
"""
@ -217,6 +219,9 @@ class SafeEyes(object):
self.active = False
self.plugins_manager.stop()
self.safe_eyes_core.stop()
if status is None:
status = _('Disabled until restart')
self._status = status
def start_break(self, break_obj):
"""
@ -242,6 +247,7 @@ class SafeEyes(object):
Update the next break to plugins and save the session.
"""
self.plugins_manager.update_next_break(break_obj, break_time)
self._status = _('Next break at %s') % (Utility.format_time(break_time))
if self.config.get('persist_state'):
Utility.write_json(Utility.SESSION_FILE_PATH, self.context['session'])
@ -259,6 +265,12 @@ class SafeEyes(object):
"""
self.safe_eyes_core.take_break()
def status(self):
"""
Return the status of Safe Eyes.
"""
return self._status
def persist_session(self):
"""
Save the session object to the session file.

View File

@ -103,6 +103,7 @@ def main():
group.add_argument('-s', '--settings', help=_('show the settings dialog'), action='store_true')
group.add_argument('-t', '--take-break', help=_('Take a break now').lower(), action='store_true')
parser.add_argument('--debug', help=_('start safeeyes in debug mode'), action='store_true')
parser.add_argument('--status', help=_('print the status of running safeeyes instance and exit'), action='store_true')
parser.add_argument('--version', action='version', version='%(prog)s ' + SAFE_EYES_VERSION)
args = parser.parse_args()
@ -123,18 +124,24 @@ def main():
rpc_client.show_settings()
elif args.take_break:
rpc_client.take_break()
elif args.status:
print(rpc_client.status())
elif args.quit:
rpc_client.quit()
else:
# Default behavior is opening settings
rpc_client.show_settings()
sys.exit(0)
elif not args.quit:
logging.info("Starting Safe Eyes")
safeeyes = SafeEyes(system_locale, config)
safeeyes.start()
Timer(1.0, lambda: __evaluate_arguments(args, safeeyes)).start()
Gtk.main()
else:
if args.status:
print(_('Safe Eyes is not running'))
sys.exit(0)
elif not args.quit:
logging.info("Starting Safe Eyes")
safeeyes = SafeEyes(system_locale, config)
safeeyes.start()
Timer(1.0, lambda: __evaluate_arguments(args, safeeyes)).start()
Gtk.main()
if __name__ == '__main__':

View File

@ -7,14 +7,14 @@ msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: bg\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.7.1\n"
"Last-Translator: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: bg\n"
# Short break
msgid "Tightly close your eyes"
@ -76,6 +76,14 @@ msgstr ""
msgid "start safeeyes in debug mode"
msgstr ""
# Commandline arg description
msgid "print the status of running safeeyes instance and exit"
msgstr ""
# Status message
msgid "Safe Eyes is not running"
msgstr ""
# About dialog
msgid "Close"
msgstr ""

View File

@ -77,6 +77,14 @@ msgstr ""
msgid "start safeeyes in debug mode"
msgstr ""
# Commandline arg description
msgid "print the status of running safeeyes instance and exit"
msgstr ""
# Status message
msgid "Safe Eyes is not running"
msgstr ""
# About dialog
msgid "Close"
msgstr "Tanca"

View File

@ -8,8 +8,8 @@ msgstr ""
"POT-Creation-Date: \n"
"PO-Revision-Date: 2017-11-10 06:45+0000\n"
"Last-Translator: Pavel Borecki <pavel.borecki@gmail.com>\n"
"Language-Team: Czech <https://hosted.weblate.org/projects/safe-"
"eyes/translations/cs/>\n"
"Language-Team: Czech <https://hosted.weblate.org/projects/safe-eyes/"
"translations/cs/>\n"
"Language: cs\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -77,6 +77,14 @@ msgstr "zobrazit nastavovací dialog"
msgid "start safeeyes in debug mode"
msgstr "spustit safeeyes v režimu pro ladění"
# Commandline arg description
msgid "print the status of running safeeyes instance and exit"
msgstr ""
# Status message
msgid "Safe Eyes is not running"
msgstr ""
# About dialog
msgid "Close"
msgstr "Zavřít"

View File

@ -8,8 +8,8 @@ msgstr ""
"POT-Creation-Date: \n"
"PO-Revision-Date: 2018-01-16 23:40+0000\n"
"Last-Translator: Sebastian Pipping <sebastian@pipping.org>\n"
"Language-Team: German <https://hosted.weblate.org/projects/safe-"
"eyes/translations/de/>\n"
"Language-Team: German <https://hosted.weblate.org/projects/safe-eyes/"
"translations/de/>\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -77,6 +77,14 @@ msgstr "Einstellungen anzeigen"
msgid "start safeeyes in debug mode"
msgstr "Im Debug-Modus starten"
# Commandline arg description
msgid "print the status of running safeeyes instance and exit"
msgstr ""
# Status message
msgid "Safe Eyes is not running"
msgstr ""
# About dialog
msgid "Close"
msgstr "Schließen"

View File

@ -78,6 +78,14 @@ msgstr "show the settings dialog"
msgid "start safeeyes in debug mode"
msgstr "start safeeyes in debug mode"
# Commandline arg description
msgid "print the status of running safeeyes instance and exit"
msgstr "print the status of running safeeyes instance and exit"
# Status message
msgid "Safe Eyes is not running"
msgstr "Safe Eyes is not running"
# About dialog
msgid "Close"
msgstr "Close"

View File

@ -77,6 +77,14 @@ msgstr "muestra dialogo de configuraciones"
msgid "start safeeyes in debug mode"
msgstr "iniciar safeeyes en modo de depuración"
# Commandline arg description
msgid "print the status of running safeeyes instance and exit"
msgstr ""
# Status message
msgid "Safe Eyes is not running"
msgstr ""
# About dialog
msgid "Close"
msgstr "Cerrar"

View File

@ -8,8 +8,8 @@ msgstr ""
"POT-Creation-Date: \n"
"PO-Revision-Date: 2017-11-20 20:46+0000\n"
"Last-Translator: Kristjan Räts <kristjanrats@gmail.com>\n"
"Language-Team: Estonian <https://hosted.weblate.org/projects/safe-"
"eyes/translations/et/>\n"
"Language-Team: Estonian <https://hosted.weblate.org/projects/safe-eyes/"
"translations/et/>\n"
"Language: et\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -77,6 +77,14 @@ msgstr "kuva seadete aken"
msgid "start safeeyes in debug mode"
msgstr "käivita veatuvastuse režiimis"
# Commandline arg description
msgid "print the status of running safeeyes instance and exit"
msgstr ""
# Status message
msgid "Safe Eyes is not running"
msgstr ""
# About dialog
msgid "Close"
msgstr "Sulge"
@ -302,8 +310,7 @@ msgstr "Kohandatud ekraanisäästja käsk"
# plugin/screensaver
msgid "Minimum seconds to skip without screensaver"
msgstr ""
"Kui mitme sekundi jooksul saab ekraanisäästja käivitamist vahele jätta"
msgstr "Kui mitme sekundi jooksul saab ekraanisäästja käivitamist vahele jätta"
# plugin/smartpause
msgid "Smart Pause"
@ -315,8 +322,7 @@ msgstr "Süsteemi jõudeoleku ajal programmi peatamine"
# plugin/smartpause
msgid "Minimum idle time to pause Safe Eyes (in seconds)"
msgstr ""
"Minimaalne süsteemi jõudeoleku aeg programmi peatamiseks (sekundites)"
msgstr "Minimaalne süsteemi jõudeoleku aeg programmi peatamiseks (sekundites)"
# plugin/smartpause
msgid "Interpret idle time equivalent to upcoming break duration as a break"

View File

@ -8,8 +8,8 @@ msgstr ""
"POT-Creation-Date: \n"
"PO-Revision-Date: 2017-11-03 06:48+0000\n"
"Last-Translator: Misagh <misaghlb@gmail.com>\n"
"Language-Team: Persian <https://hosted.weblate.org/projects/safe-"
"eyes/translations/fa/>\n"
"Language-Team: Persian <https://hosted.weblate.org/projects/safe-eyes/"
"translations/fa/>\n"
"Language: fa\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -77,6 +77,14 @@ msgstr "نشان دادن پنجره تنظیمات"
msgid "start safeeyes in debug mode"
msgstr "اجرا کردن safeeyes در حالت دیباگ"
# Commandline arg description
msgid "print the status of running safeeyes instance and exit"
msgstr ""
# Status message
msgid "Safe Eyes is not running"
msgstr ""
# About dialog
msgid "Close"
msgstr "بستن"

View File

@ -8,8 +8,8 @@ msgstr ""
"POT-Creation-Date: \n"
"PO-Revision-Date: 2017-11-05 11:46+0000\n"
"Last-Translator: French Coordinator <french.coordinator@rbox.me>\n"
"Language-Team: French <https://hosted.weblate.org/projects/safe-"
"eyes/translations/fr/>\n"
"Language-Team: French <https://hosted.weblate.org/projects/safe-eyes/"
"translations/fr/>\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -77,6 +77,14 @@ msgstr "afficher la boîte de dialogue des paramètres"
msgid "start safeeyes in debug mode"
msgstr "démarrer safeeyes en mode de débogage"
# Commandline arg description
msgid "print the status of running safeeyes instance and exit"
msgstr ""
# Status message
msgid "Safe Eyes is not running"
msgstr ""
# About dialog
msgid "Close"
msgstr "Fermer"

View File

@ -76,6 +76,14 @@ msgstr ""
msgid "start safeeyes in debug mode"
msgstr ""
# Commandline arg description
msgid "print the status of running safeeyes instance and exit"
msgstr ""
# Status message
msgid "Safe Eyes is not running"
msgstr ""
# About dialog
msgid "Close"
msgstr ""

View File

@ -77,6 +77,14 @@ msgstr "mutasd a beállítások dialógust"
msgid "start safeeyes in debug mode"
msgstr "Indítsd a SafeEyes-t debug módban"
# Commandline arg description
msgid "print the status of running safeeyes instance and exit"
msgstr ""
# Status message
msgid "Safe Eyes is not running"
msgstr ""
# About dialog
msgid "Close"
msgstr "Bezárás"

View File

@ -76,6 +76,14 @@ msgstr ""
msgid "start safeeyes in debug mode"
msgstr ""
# Commandline arg description
msgid "print the status of running safeeyes instance and exit"
msgstr ""
# Status message
msgid "Safe Eyes is not running"
msgstr ""
# About dialog
msgid "Close"
msgstr ""

View File

@ -8,8 +8,8 @@ msgstr ""
"POT-Creation-Date: \n"
"PO-Revision-Date: 2017-10-18 08:44+0000\n"
"Last-Translator: Guglielmo Wilmup <wilmup67@gmail.com>\n"
"Language-Team: Italian <https://hosted.weblate.org/projects/safe-"
"eyes/translations/it/>\n"
"Language-Team: Italian <https://hosted.weblate.org/projects/safe-eyes/"
"translations/it/>\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -77,6 +77,14 @@ msgstr "mostra la finestra delle preferenze"
msgid "start safeeyes in debug mode"
msgstr "avvia Safe Eyes in modalità debug"
# Commandline arg description
msgid "print the status of running safeeyes instance and exit"
msgstr ""
# Status message
msgid "Safe Eyes is not running"
msgstr ""
# About dialog
msgid "Close"
msgstr "Esci"

View File

@ -77,6 +77,14 @@ msgstr ""
msgid "start safeeyes in debug mode"
msgstr ""
# Commandline arg description
msgid "print the status of running safeeyes instance and exit"
msgstr ""
# Status message
msgid "Safe Eyes is not running"
msgstr ""
# About dialog
msgid "Close"
msgstr ""

View File

@ -58,7 +58,6 @@ msgid "show the about dialog"
msgstr "vis \"Om\"-dialogvinduet"
# Commandline arg description
#, fuzzy
msgid "disable the currently running safeeyes instance"
msgstr "skru av det kjørende Øyetrygg-programmet"
@ -78,6 +77,14 @@ msgstr "vis innstillingsdialogvinduet"
msgid "start safeeyes in debug mode"
msgstr "start Øyetrygg i feilrettingsmodus"
# Commandline arg description
msgid "print the status of running safeeyes instance and exit"
msgstr ""
# Status message
msgid "Safe Eyes is not running"
msgstr ""
# About dialog
msgid "Close"
msgstr "Luk"
@ -112,7 +119,6 @@ msgid "Time to prepare for a break (in seconds)"
msgstr "Tid til forberedelse av pause (i sekunder)"
# Settings dialog
#, fuzzy
msgid "Keyboard shortcuts disabled period (in seconds)"
msgstr "Tastatursnarveier avskrudd i periode (i sekunder)"
@ -129,7 +135,6 @@ msgid "Allow postponing breaks"
msgstr "Tillat utsettelse av pauser"
# Settings dialog
#, fuzzy
msgid "Persist the internal state"
msgstr "Fortsett i inngangstilstand"
@ -254,7 +259,6 @@ msgid "Skip the break if the active window is in fullscreen mode"
msgstr "Hopp over pause hvis det aktive vinduet er i fullskjermsmodus"
# plugin/donotdisturb
#, fuzzy
msgid "Do not interrupt these windows anytime"
msgstr "Ikke forstyrr disse vinduene noensinne"
@ -315,7 +319,6 @@ msgid "Pause Safe Eyes if the system is idle"
msgstr "Sett Øyetrygg på pause hvis systemet er ledig"
# plugin/smartpause
#, fuzzy
msgid "Minimum idle time to pause Safe Eyes (in seconds)"
msgstr "Minimal lediggang å pause Øyetrygg etter (i sekunder)"

View File

@ -8,8 +8,8 @@ msgstr ""
"POT-Creation-Date: \n"
"PO-Revision-Date: 2018-01-04 11:46+0000\n"
"Last-Translator: Heimen Stoffels <vistausss@outlook.com>\n"
"Language-Team: Dutch <https://hosted.weblate.org/projects/safe-"
"eyes/translations/nl/>\n"
"Language-Team: Dutch <https://hosted.weblate.org/projects/safe-eyes/"
"translations/nl/>\n"
"Language: nl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -77,6 +77,14 @@ msgstr "het instellingen-dialoogvenster weergeven"
msgid "start safeeyes in debug mode"
msgstr "safeeyes opstart in foutopsporingsmodus"
# Commandline arg description
msgid "print the status of running safeeyes instance and exit"
msgstr ""
# Status message
msgid "Safe Eyes is not running"
msgstr ""
# About dialog
msgid "Close"
msgstr "Sluiten"

View File

@ -8,8 +8,8 @@ msgstr ""
"POT-Creation-Date: \n"
"PO-Revision-Date: 2017-12-06 19:48+0000\n"
"Last-Translator: Wojciech <bolo92+weblate@gmail.com>\n"
"Language-Team: Polish <https://hosted.weblate.org/projects/safe-"
"eyes/translations/pl/>\n"
"Language-Team: Polish <https://hosted.weblate.org/projects/safe-eyes/"
"translations/pl/>\n"
"Language: pl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -78,6 +78,14 @@ msgstr "pokaż okno dialogowe ustawień"
msgid "start safeeyes in debug mode"
msgstr "uruchom safeeyes w trybie debugowania"
# Commandline arg description
msgid "print the status of running safeeyes instance and exit"
msgstr ""
# Status message
msgid "Safe Eyes is not running"
msgstr ""
# About dialog
msgid "Close"
msgstr "Zamknij"

View File

@ -8,8 +8,8 @@ msgstr ""
"POT-Creation-Date: \n"
"PO-Revision-Date: 2017-10-28 07:15+0000\n"
"Last-Translator: Romulo do Vale <dovale.am@gmail.com>\n"
"Language-Team: Portuguese <https://hosted.weblate.org/projects/safe-"
"eyes/translations/pt/>\n"
"Language-Team: Portuguese <https://hosted.weblate.org/projects/safe-eyes/"
"translations/pt/>\n"
"Language: pt\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -77,6 +77,14 @@ msgstr "mostrar a janela de configuração"
msgid "start safeeyes in debug mode"
msgstr "iniciar o safeeyes em modo de debug"
# Commandline arg description
msgid "print the status of running safeeyes instance and exit"
msgstr ""
# Status message
msgid "Safe Eyes is not running"
msgstr ""
# About dialog
msgid "Close"
msgstr "Fechar"
@ -219,7 +227,6 @@ msgid "Please install the command-line tool '%s'"
msgstr "Por favor instale a ferramenta de linha de comando '%s'"
# Settings dialog
#, fuzzy
msgid "Please add the resource %(resource)s to %(config_resource)s directory"
msgstr ""
"Por favor, adicione o recurso %(resource)s para %(config_resources)s pasta"

View File

@ -8,14 +8,14 @@ msgstr ""
"POT-Creation-Date: \n"
"PO-Revision-Date: 2017-11-21 17:41+0000\n"
"Last-Translator: Duncan <duncan@fromru.com>\n"
"Language-Team: Russian <https://hosted.weblate.org/projects/safe-"
"eyes/translations/ru/>\n"
"Language-Team: Russian <https://hosted.weblate.org/projects/safe-eyes/"
"translations/ru/>\n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<="
"4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"X-Generator: Weblate 2.18-dev\n"
# Short break
@ -78,6 +78,14 @@ msgstr "Настройки"
msgid "start safeeyes in debug mode"
msgstr "Запустить Safe Eyes в режиме отладки"
# Commandline arg description
msgid "print the status of running safeeyes instance and exit"
msgstr ""
# Status message
msgid "Safe Eyes is not running"
msgstr ""
# About dialog
msgid "Close"
msgstr "Закрыть"

View File

@ -65,6 +65,14 @@ msgstr ""
msgid "start safeeyes in debug mode"
msgstr ""
# Commandline arg description
msgid "print the status of running safeeyes instance and exit"
msgstr ""
# Status message
msgid "Safe Eyes is not running"
msgstr ""
# About dialog
msgid "Close"
msgstr ""

View File

@ -8,8 +8,8 @@ msgstr ""
"POT-Creation-Date: \n"
"PO-Revision-Date: 2017-10-13 17:55+0000\n"
"Last-Translator: Radek Sprta <mail@radeksprta.eu>\n"
"Language-Team: Slovak <https://hosted.weblate.org/projects/safe-"
"eyes/translations/sk/>\n"
"Language-Team: Slovak <https://hosted.weblate.org/projects/safe-eyes/"
"translations/sk/>\n"
"Language: sk\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -77,6 +77,14 @@ msgstr "zobraziť dialog nastavenie"
msgid "start safeeyes in debug mode"
msgstr "spustiť safeeyes v móde pre ladenie"
# Commandline arg description
msgid "print the status of running safeeyes instance and exit"
msgstr ""
# Status message
msgid "Safe Eyes is not running"
msgstr ""
# About dialog
msgid "Close"
msgstr "Zavrieť"

View File

@ -7,14 +7,14 @@ msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: sv\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.7.1\n"
"Last-Translator: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: sv\n"
# Short break
msgid "Tightly close your eyes"
@ -76,6 +76,14 @@ msgstr ""
msgid "start safeeyes in debug mode"
msgstr ""
# Commandline arg description
msgid "print the status of running safeeyes instance and exit"
msgstr ""
# Status message
msgid "Safe Eyes is not running"
msgstr ""
# About dialog
msgid "Close"
msgstr ""

View File

@ -78,6 +78,14 @@ msgstr "அமைப்புகள் சாளரத்தை காண்ப
msgid "start safeeyes in debug mode"
msgstr "வழு நீக்கும் முறையில் Safe Eyes ஐ ஆரம்பிக்குக"
# Commandline arg description
msgid "print the status of running safeeyes instance and exit"
msgstr "இயங்கும் Safe Eyes நிலையை காண்பித்து வெளியேறுக"
# Status message
msgid "Safe Eyes is not running"
msgstr "Safe Eyes தற்போது இயங்கவில்லை"
# About dialog
msgid "Close"
msgstr "மூடு"

View File

@ -8,8 +8,8 @@ msgstr ""
"POT-Creation-Date: \n"
"PO-Revision-Date: 2017-10-17 21:48+0000\n"
"Last-Translator: Musa Serdar ARSLAN <msarslan@gmail.com>\n"
"Language-Team: Turkish <https://hosted.weblate.org/projects/safe-"
"eyes/translations/tr/>\n"
"Language-Team: Turkish <https://hosted.weblate.org/projects/safe-eyes/"
"translations/tr/>\n"
"Language: tr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -77,6 +77,14 @@ msgstr "ayarlar penceresini göster"
msgid "start safeeyes in debug mode"
msgstr "safeeyes'ı hata ayıklama kipinde başlat"
# Commandline arg description
msgid "print the status of running safeeyes instance and exit"
msgstr ""
# Status message
msgid "Safe Eyes is not running"
msgstr ""
# About dialog
msgid "Close"
msgstr "Kapat"

View File

@ -8,14 +8,14 @@ msgstr ""
"POT-Creation-Date: \n"
"PO-Revision-Date: 2018-01-24 12:34+0000\n"
"Last-Translator: Марс Ямбар <mjambarmeta@gmail.com>\n"
"Language-Team: Ukrainian <https://hosted.weblate.org/projects/safe-"
"eyes/translations/uk/>\n"
"Language-Team: Ukrainian <https://hosted.weblate.org/projects/safe-eyes/"
"translations/uk/>\n"
"Language: uk\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<="
"4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"X-Generator: Weblate 2.19-dev\n"
# Short break
@ -78,6 +78,14 @@ msgstr ""
msgid "start safeeyes in debug mode"
msgstr ""
# Commandline arg description
msgid "print the status of running safeeyes instance and exit"
msgstr ""
# Status message
msgid "Safe Eyes is not running"
msgstr ""
# About dialog
msgid "Close"
msgstr ""

View File

@ -8,8 +8,8 @@ msgstr ""
"POT-Creation-Date: \n"
"PO-Revision-Date: 2017-10-28 07:14+0000\n"
"Last-Translator: giappi <giappaig@gmail.com>\n"
"Language-Team: Vietnamese <https://hosted.weblate.org/projects/safe-"
"eyes/translations/vi/>\n"
"Language-Team: Vietnamese <https://hosted.weblate.org/projects/safe-eyes/"
"translations/vi/>\n"
"Language: vi\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -77,6 +77,14 @@ msgstr "Hiện hộp thoại cài đặt"
msgid "start safeeyes in debug mode"
msgstr "Chạy Safe Eyes trong chế độ gỡ rối"
# Commandline arg description
msgid "print the status of running safeeyes instance and exit"
msgstr ""
# Status message
msgid "Safe Eyes is not running"
msgstr ""
# About dialog
msgid "Close"
msgstr "Đóng"
@ -251,7 +259,8 @@ msgstr "Không Làm Phiền"
# plugin/donotdisturb
msgid "Skip the break if the active window is in fullscreen mode"
msgstr "Bỏ qua lần nghỉ nếu như cửa sổ hiện tại đang trong chế độ toàn màn hình"
msgstr ""
"Bỏ qua lần nghỉ nếu như cửa sổ hiện tại đang trong chế độ toàn màn hình"
# plugin/donotdisturb
msgid "Do not interrupt these windows anytime"

View File

@ -8,8 +8,8 @@ msgstr ""
"POT-Creation-Date: \n"
"PO-Revision-Date: 2017-11-15 08:59+0000\n"
"Last-Translator: 庞伟浩 <pangzaiyu77@gmail.com>\n"
"Language-Team: Chinese (Simplified) <https://hosted.weblate.org/projects"
"/safe-eyes/translations/zh_Hans/>\n"
"Language-Team: Chinese (Simplified) <https://hosted.weblate.org/projects/"
"safe-eyes/translations/zh_Hans/>\n"
"Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -77,6 +77,14 @@ msgstr "显示“设置”对话框"
msgid "start safeeyes in debug mode"
msgstr "以调试模式运行Safeeyes"
# Commandline arg description
msgid "print the status of running safeeyes instance and exit"
msgstr ""
# Status message
msgid "Safe Eyes is not running"
msgstr ""
# About dialog
msgid "Close"
msgstr "关闭"

View File

@ -7,14 +7,14 @@ msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: zh_TW\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.7.1\n"
"Last-Translator: \n"
"Plural-Forms: nplurals=1; plural=0;\n"
"Language: zh_TW\n"
# Short break
msgid "Tightly close your eyes"
@ -76,6 +76,14 @@ msgstr ""
msgid "start safeeyes in debug mode"
msgstr ""
# Commandline arg description
msgid "print the status of running safeeyes instance and exit"
msgstr ""
# Status message
msgid "Safe Eyes is not running"
msgstr ""
# About dialog
msgid "Close"
msgstr ""

View File

@ -289,16 +289,19 @@ class TrayIcon(object):
# active = self.item_enable.get_active()
if self.active and len(args) > 1:
self.disable_ui()
self.on_disable()
time_to_wait = args[1]
if time_to_wait <= 0:
info = _('Disabled until restart')
self.on_disable(info)
self.wakeup_time = None
self.item_info.set_label(_('Disabled until restart'))
self.item_info.set_label(info)
else:
self.wakeup_time = datetime.datetime.now() + datetime.timedelta(minutes=time_to_wait)
info = _('Disabled until %s') % Utility.format_time(self.wakeup_time)
self.on_disable(info)
self.item_info.set_label(info)
Utility.start_thread(self.__schedule_resume, time_minutes=time_to_wait)
self.item_info.set_label(_('Disabled until %s') % Utility.format_time(self.wakeup_time))
def lock_menu(self):
"""

View File

@ -39,6 +39,7 @@ class RPCServer(object):
self.__server.register_function(context['api']['enable_safeeyes'], 'enable_safeeyes')
self.__server.register_function(context['api']['disable_safeeyes'], 'disable_safeeyes')
self.__server.register_function(context['api']['take_break'], 'take_break')
self.__server.register_function(context['api']['status'], 'status')
self.__server.register_function(context['api']['quit'], 'quit')
def start(self):
@ -91,7 +92,7 @@ class RPCClient(object):
"""
Disable Safe Eyes.
"""
self.proxy.disable_safeeyes()
self.proxy.disable_safeeyes(None)
def take_break(self):
"""
@ -99,6 +100,12 @@ class RPCClient(object):
"""
self.proxy.take_break()
def status(self):
"""
Return the status of Safe Eyes
"""
return self.proxy.status()
def quit(self):
"""
Quit Safe Eyes.