import subprocess, os, sys
from messages import messages_provider

messages = messages_provider.get()

class NotificationDisplayer:

    def __init__(self):
        iconame = "assets/octocat.png"
        self.icon = os.path.abspath(iconame)

class NotificationDisplayerNotifySend(NotificationDisplayer):

    def __init__(self):
        NotificationDisplayer.__init__(self)
        return

    def display(self, event):
        icon = os.path.abspath(event["author"]["avatar_file"])
        subprocess.Popen(['notify-send', '-i', icon, event["message"]])

class NotificationDisplayerGrowlnotify(NotificationDisplayer):

    def __init__(self):
        NotificationDisplayer.__init__(self)
        return

    def display(self, message):
        # to be implemented
        pass
Beispiel #2
0
import subprocess, os, sys
from messages import messages_provider

messages = messages_provider.get()


class NotificationDisplayer:
    def __init__(self):
        iconame = "assets/octocat.png"
        self.icon = os.path.abspath(iconame)


class NotificationDisplayerNotifySend(NotificationDisplayer):
    def __init__(self):
        NotificationDisplayer.__init__(self)
        return

    def display(self, event):
        icon = os.path.abspath(event["author"]["avatar_file"])
        subprocess.Popen(['notify-send', '-i', icon, event["message"]])


class NotificationDisplayerGrowlnotify(NotificationDisplayer):
    def __init__(self):
        NotificationDisplayer.__init__(self)
        return

    def display(self, message):
        # to be implemented
        pass