示例#1
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)
示例#2
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)
示例#3
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)
示例#4
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)
示例#5
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)
示例#6
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)
示例#7
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)
示例#8
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)
def notify(msg):
    """Notify message."""

    settings = sublime.load_settings("FavoriteFiles.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)
示例#10
0
def error(msg):
    """Error 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,
            "level": "error"
        })
    else:
        sublime.error_message("HexViewer:\n%s" % msg)
示例#11
0
def error(msg):
    """Error message."""

    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)
示例#12
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)
示例#13
0
    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)
示例#14
0
def 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)
示例#15
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)
示例#16
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)
示例#17
0
def notify(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})
    else:
        sublime.status_message(msg)