def run(self):
        while 1:
            if self.stopped():
                stopRecording()
                time.sleep(2)
                continue

            self.recording(self.workingMins, updateWorkingTimeStatus)

            if self.stopped():
                stopRecording()
                time.sleep(2)
                continue

            if Notify.is_ready():
                sublime.run_command(
                    "sub_notify", {
                        "title": "",
                        "msg": "Hey, you are working too hard, take a rest."
                    })
                rest = True
            else:
                rest = sublime.ok_cancel_dialog(
                    'Hey, you are working too hard, take a rest.', 'OK')
            # increase work session count
            self.workingSessionCount += 1

            if rest:
                restingMins = self.restingMins
                if self.longBreak(self.workingSessionCount):
                    restingMins = self.longBreakMins
                    self.workingSessionCount = 0
                self.recording(restingMins, updateRestingTimeStatus)
                if self.stopped():
                    stopRecording()
                    time.sleep(2)
                    continue
                if Notify.is_ready():
                    sublime.run_command("sub_notify", {
                        "title": "",
                        "msg": "Come on, let's continue."
                    })
                    work = True
                else:
                    work = sublime.ok_cancel_dialog("Come on, let's continue.",
                                                    'OK')
                if not work:
                    self.stop()
            time.sleep(2)
def notify(msg):
    """Notify with SubNotify if possible and enabled."""

    if load_settings().get("use_sub_notify", False) and Notify.is_ready():
        sublime.run_command("sub_notify", {"title": "EasyDiff", "msg": msg})
    else:
        sublime.status_message(msg)
Exemple #3
0
def notify(msg):
    """Notify with SubNotify if possible and enabled."""

    if load_settings().get("use_sub_notify", False) and Notify.is_ready():
        sublime.run_command("sub_notify", {"title": "EasyDiff", "msg": msg})
    else:
        sublime.status_message(msg)
Exemple #4
0
def notify(msg):
    """Notify msg."""

    settings = sublime.load_settings("reg_replace.sublime-settings")
    if settings.get("use_sub_notify", False) and Notify.is_ready():
        sublime.run_command("sub_notify", {"title": "RegReplace", "msg": msg})
    else:
        sublime.status_message(msg)
def error(msg):
    """Error message."""

    settings = sublime.load_settings("raw_line_edit.sublime-settings")
    if settings.get("use_sub_notify", False) and Notify.is_ready():
        sublime.run_command("sub_notify", {"title": "RawLineEdit", "msg": msg, "level": "error"})
    else:
        sublime.error_message("RawLineEdit:\n%s" % msg)
def notify(msg):
    """Notify message."""

    settings = sublime.load_settings("raw_line_edit.sublime-settings")
    if settings.get("use_sub_notify", False) and Notify.is_ready():
        sublime.run_command("sub_notify", {"title": "RawLineEdit", "msg": msg})
    else:
        sublime.status_message(msg)
Exemple #7
0
def error(msg):
    """Error message."""

    settings = sublime.load_settings("favorite_files.sublime-settings")
    if settings.get("use_sub_notify", False) and Notify.is_ready():
        sublime.run_command("sub_notify", {"title": "FavoriteFiles", "msg": msg, "level": "error"})
    else:
        sublime.error_message("FavoriteFiles:\n%s" % msg)
Exemple #8
0
def error(msg):
    """Error msg."""

    settings = sublime.load_settings("reg_replace.sublime-settings")
    if settings.get("use_sub_notify", False) and Notify.is_ready():
        sublime.run_command("sub_notify", {"title": "RegReplace", "msg": msg, "level": "error"})
    else:
        sublime.error_message("RegReplace:\n%s" % msg)
Exemple #9
0
def notify(msg):
    """Notify message."""

    settings = sublime.load_settings("raw_line_edit.sublime-settings")
    if settings.get("use_sub_notify", False) and Notify.is_ready():
        sublime.run_command("sub_notify", {"title": "RawLineEdit", "msg": msg})
    else:
        sublime.status_message(msg)
Exemple #10
0
def error(msg):
    """Error message."""

    settings = sublime.load_settings("ExportHtml.sublime-settings")
    if settings.get("use_sub_notify", False) and Notify.is_ready():
        sublime.run_command("sub_notify", {"title": "ExportHtml", "msg": msg, "level": "error"})
    else:
        sublime.error_message("ExportHtml:\n%s" % msg)
Exemple #11
0
def error(msg):
    """Error message."""

    settings = sublime.load_settings("ExportHtml.sublime-settings")
    if settings.get("use_sub_notify", False) and Notify.is_ready():
        sublime.run_command("sub_notify", {"title": "ExportHtml", "msg": msg, "level": "error"})
    else:
        sublime.error_message("ExportHtml:\n%s" % msg)
Exemple #12
0
def error(msg):
    """Error message."""

    settings = sublime.load_settings("pymdown.sublime-settings")
    if settings.get("use_sub_notify", False) and Notify.is_ready():
        sublime.run_command("sub_notify", {"title": "PyMdown", "msg": msg, "level": "error"})
    else:
        err_dialog(msg)
Exemple #13
0
def notify(msg):
    """Notify message."""

    settings = sublime.load_settings("ExportHtml.sublime-settings")
    if settings.get("use_sub_notify", False) and Notify.is_ready():
        sublime.run_command("sub_notify", {"title": "ExportHtml", "msg": msg})
    else:
        sublime.status_message(msg)
Exemple #14
0
def notify(msg):
    """Notify message."""

    settings = sublime.load_settings("hex_viewer.sublime-settings")
    if settings.get("use_sub_notify", False) and Notify.is_ready():
        sublime.run_command("sub_notify", {"title": "HexViewer", "msg": msg})
    else:
        sublime.status_message(msg)
Exemple #15
0
def notify(msg):
    """Notification message."""

    settings = sublime.load_settings("pymdown.sublime-settings")
    if settings.get("use_sub_notify", False) and Notify.is_ready():
        sublime.run_command("sub_notify", {"title": "PyMdown", "msg": msg})
    else:
        status_notify(msg)
Exemple #16
0
def error(msg):
    """Error message."""

    settings = sublime.load_settings("raw_line_edit.sublime-settings")
    if settings.get("use_sub_notify", False) and Notify.is_ready():
        sublime.run_command("sub_notify", {"title": "RawLineEdit", "msg": msg, "level": "error"})
    else:
        sublime.error_message("RawLineEdit:\n%s" % msg)
Exemple #17
0
def error(msg):
    """Error msg."""

    settings = sublime.load_settings("reg_replace.sublime-settings")
    if settings.get("use_sub_notify", False) and Notify.is_ready():
        sublime.run_command("sub_notify", {"title": "RegReplace", "msg": msg, "level": "error"})
    else:
        sublime.error_message("RegReplace:\n%s" % msg)
Exemple #18
0
def notify(msg):
    """Notify msg."""

    settings = sublime.load_settings("reg_replace.sublime-settings")
    if settings.get("use_sub_notify", False) and Notify.is_ready():
        sublime.run_command("sub_notify", {"title": "RegReplace", "msg": msg})
    else:
        sublime.status_message(msg)
Exemple #19
0
def notify(msg):
    settings = sublime.load_settings("favorite_files.sublime-settings")
    if settings.get("use_sub_notify", False) and Notify.is_ready():
        sublime.run_command("sub_notify", {
            "title": "FavoriteFiles",
            "msg": msg
        })
    else:
        sublime.status_message(msg)
Exemple #20
0
def error(msg):
    settings = sublime.load_settings("favorite_files.sublime-settings")
    if settings.get("use_sub_notify", False) and Notify.is_ready():
        sublime.run_command("sub_notify", {
            "title": "FavoriteFiles",
            "msg": msg,
            "level": "error"
        })
    else:
        sublime.error_message("FavoriteFiles:\n%s" % msg)
Exemple #21
0
def error(msg):
    settings = sublime.load_settings("hex_viewer.sublime-settings")
    if settings.get("use_sub_notify", False) and Notify.is_ready():
        sublime.run_command("sub_notify", {
            "title": "HexViewer",
            "msg": msg,
            "level": "error"
        })
    else:
        sublime.error_message("HexViewer:\n%s" % msg)
    def run(self):
        while 1:
            if self.stopped():
                stopRecording()
                time.sleep(2)
                continue

            self.recording(self.workingMins, updateWorkingTimeStatus)

            if self.stopped():
                stopRecording()
                time.sleep(2)
                continue

            if Notify.is_ready():
                sublime.run_command("sub_notify", {"title": "", "msg": "Hey, you are working too hard, take a rest."})
                rest = True
            else:
                rest = sublime.ok_cancel_dialog('Hey, you are working too hard, take a rest.', 'OK')
            # increase work session count
            self.workingSessionCount += 1

            if rest:
                restingMins = self.restingMins
                if self.longBreak(self.workingSessionCount):
                    restingMins = self.longBreakMins
                    self.workingSessionCount = 0
                self.recording(restingMins, updateRestingTimeStatus)
                if self.stopped():
                    stopRecording()
                    time.sleep(2)
                    continue
                if Notify.is_ready():
                    sublime.run_command("sub_notify", {"title": "", "msg": "Come on, let's continue."})
                    work = True
                else:
                    work = sublime.ok_cancel_dialog("Come on, let's continue.", 'OK')
                if not work:
                    self.stop()
            time.sleep(2)
Exemple #23
0
def notify(msg):
    settings = sublime.load_settings("favorite_files.sublime-settings")
    if settings.get("use_sub_notify", False) and Notify.is_ready():
        sublime.run_command("sub_notify", {"title": "FavoriteFiles", "msg": msg})
    else:
        sublime.status_message(msg)
Exemple #24
0
def notify(msg):
    if load_settings().get("use_sub_notify", False) and Notify.is_ready():
        sublime.run_command("sub_notify", {"title": "EasyDiff", "msg": msg})
    else:
        sublime.status_message(msg)