Exemple #1
0
 def __init__(self, bot):
     IPlugin.__init__(self, bot)
     
     self.data = {
         'last-bug-created': 0,
         'ignored-names': [
             '/^Not\-[0-9]+/' # Notifico bots
         ]
     }
     
     self.LoadPluginData()
     
     self.url = globalConfig.get('plugins.redmine.url', None)
     if self.url is None:
         logging.error('Redmine: Disabled.') 
         return
     self.ignored = []
     for ignoretok in self.data.get('ignored-names',['/^Not\-[0-9]/']):
         if ignoretok.startwith('/') and ignoretok.endwith('/'):
             self.ignored+=[re.compile(ignoretok[1:-1])]
         else:
             self.ignored+=[re.compile('^'+re.escape(ignoretok)+'$')]
     self.auth = BasicAuth(globalConfig.get('plugins.redmine.apikey', None), str(random.random()))
     self.project_id = globalConfig.get('plugins.redmine.project', None)
     if self.project_id is None: logging.warning('Redmine: Not going to check for bug updates.')
     self.bug_info_format = globalConfig.get('plugins.redmine.bug-info-format', 'Redmine #{ID} - {AUTHOR} - {STATUS} - {SUBJECT}{CRLF}{URL}')
     self.new_bug_format = globalConfig.get('plugins.redmine.new-bug-format', 'NEW ISSUE: {URL} (#{ID}: {SUBJECT})')
     self.resource = Resource(self.url, filters=[self.auth])
     
     self.bug_regex = re.compile(r'#(\d+)\b')
     
     self.lastCheck = 0
Exemple #2
0
    def __init__(self, bot):
        IPlugin.__init__(self, bot)

        self.data = {"last-bug-created": 0, "ignored-names": ["/^Not\-[0-9]+/"]}  # Notifico bots

        self.LoadPluginData()

        self.url = globalConfig.get("plugins.redmine.url", None)
        if self.url is None:
            logging.error("Redmine: Disabled.")
            return
        self.ignored = []
        for ignoretok in self.data.get("ignored-names", ["/^Not\-[0-9]/"]):
            if ignoretok.startwith("/") and ignoretok.endwith("/"):
                self.ignored += [re.compile(ignoretok[1:-1])]
            else:
                self.ignored += [re.compile("^" + re.escape(ignoretok) + "$")]
        self.auth = BasicAuth(globalConfig.get("plugins.redmine.apikey", None), str(random.random()))
        self.project_id = globalConfig.get("plugins.redmine.project", None)
        if self.project_id is None:
            logging.warning("Redmine: Not going to check for bug updates.")
        self.bug_info_format = globalConfig.get(
            "plugins.redmine.bug-info-format", "Redmine #{ID} - {AUTHOR} - {STATUS} - {SUBJECT}{CRLF}{URL}"
        )
        self.new_bug_format = globalConfig.get("plugins.redmine.new-bug-format", "NEW ISSUE: {URL} (#{ID}: {SUBJECT})")
        self.resource = Resource(self.url, filters=[self.auth])

        self.bug_regex = re.compile(r"#(\d+)\b")

        self.lastCheck = 0
Exemple #3
0
    def __init__(self, bot):
        IPlugin.__init__(self, bot)

        self.data = None
        self.config = None
        self.url = None
        self.ignored = []
        self.auth = None
        self.project_id = None
        self.resource = None
        self.lastCheck = 0

        self.tree = None
        self.nextTreeDownload = 0

        self.config = globalConfig.get('plugins.github')
        if self.config is None:
            logging.warn('GitHub: Disabled.')
            return

        self.data = {
            'last-bug-created': 0,
            'ignored-names': [
                '/^Not\-[0-9]+/'  # Notifico bots
            ]
        }

        self.LoadPluginData()

        self.url = globalConfig.get('plugins.github.url', None)
        if self.url is None:
            logging.error('GitHub: Disabled.')
            return
        # http://github.com/user/repo
        repodata = self.url[18:]
        if repodata.startswith('/'):
            repodata = repodata[1:]
        repoChunks = repodata.split('/')
        self.user_id = repoChunks[0]
        self.repo_id = repoChunks[1]

        self.ignored = []
        for ignoretok in self.data.get('ignored-names', ['/^Not\-[0-9]/']):
            if ignoretok.startswith('/') and ignoretok.endswith('/'):
                self.ignored += [re.compile(ignoretok[1:-1])]
            else:
                self.ignored += [re.compile('^' + re.escape(ignoretok) + '$')]

        self.bug_info_format = globalConfig.get(
            'plugins.github.bug-info-format',
            'GitHub #{ID}: \'{SUBJECT}\' - {URL} ({STATUS})')

        #auth_user = globalConfig.get('plugins.github.username', None)
        auth_key = globalConfig.get('plugins.github.apikey', None)
        self.github = github3.login(token=auth_key)
        self.repo = self.github.repository(self.user_id, self.repo_id)
        self.default_branch = globalConfig.get('plugins.github.default_branch',
                                               'master')

        self.getTree()
Exemple #4
0
 def __init__(self, bot):
     IPlugin.__init__(self, bot)
     
     self.data=None
     self.config=None
     self.url=None
     self.ignored=[]
     self.auth=None
     self.project_id=None
     self.resource=None
     self.lastCheck=0
     
     self.tree = None
     self.nextTreeDownload=0
     
     self.config = globalConfig.get('plugins.github')
     if self.config is None:
         logging.warn('GitHub: Disabled.') 
         return
     
     self.data = {
         'last-bug-created': 0,
         'ignored-names': [
             '/^Not\-[0-9]+/' # Notifico bots
         ]
     }
     
     self.LoadPluginData()
     
     self.url = globalConfig.get('plugins.github.url', None)
     if self.url is None:
         logging.error('GitHub: Disabled.') 
         return
     # http://github.com/user/repo
     repodata = self.url[18:]
     if repodata.startswith('/'):
         repodata = repodata[1:]
     repoChunks = repodata.split('/')
     self.user_id = repoChunks[0]
     self.repo_id = repoChunks[1]
     
     self.ignored = []
     for ignoretok in self.data.get('ignored-names',['/^Not\-[0-9]/']):
         if ignoretok.startswith('/') and ignoretok.endswith('/'):
             self.ignored+=[re.compile(ignoretok[1:-1])]
         else:
             self.ignored+=[re.compile('^'+re.escape(ignoretok)+'$')]
             
     self.bug_info_format = globalConfig.get('plugins.github.bug-info-format', 'GitHub #{ID}: \'{SUBJECT}\' - {URL} ({STATUS})')
             
     #auth_user = globalConfig.get('plugins.github.username', None)
     auth_key = globalConfig.get('plugins.github.apikey', None)
     self.github = github3.login(token=auth_key)
     self.repo = self.github.repository(self.user_id, self.repo_id)
     self.default_branch = globalConfig.get('plugins.github.default_branch','master')
     
     self.getTree()
Exemple #5
0
 def __init__(self, bot):
     IPlugin.__init__(self, bot)
     
     self.data = None
     self.config = None
     self.url = 'http://tgstation13.org/wiki/'
     
     self.config = globalConfig.get('plugins.mediawiki')
     if self.config is None:
         logging.warn('MediaWiki: Disabled.') 
         return
     
     if 'url' in self.config:
         self.url = self.config['url']
Exemple #6
0
    def __init__(self, bot):
        IPlugin.__init__(self, bot)

        self.data = None
        self.config = None
        self.url = 'http://tgstation13.org/wiki/'

        self.config = globalConfig.get('plugins.mediawiki')
        if self.config is None:
            logging.warn('MediaWiki: Disabled.')
            return

        if 'url' in self.config:
            self.url = self.config['url']
Exemple #7
0
 def __init__(self, bot):
     IPlugin.__init__(self, bot)
     
     self.RegisterCommand('shaddap', self.OnShaddap, help='Bot will stop processing nudges.')
     self.RegisterCommand('speak', self.OnSpeak, help='Bot will start processing nudges.')
     
     self.dropNudges = False
     
     self.config = globalConfig.get('plugins.nudge')
     if self.config is None:
         logging.warning('plugin.nudge not present in config.  Aborting load.')
         return
     
     thread.start_new_thread(self.nudge_listener, ())
Exemple #8
0
 def __init__(self, bot):
     IPlugin.__init__(self,bot)
  
     self.url = globalConfig.get('plugins.redmine.url',None)
     if self.url is None:
         logging.error('Redmine: Disabled.') 
         return
     self.auth = BasicAuth(globalConfig.get('plugins.redmine.apikey',None), str(random.random()))
     self.bug_msg_format = globalConfig.get('plugins.redmine.response-format','Redmine #{ID} - {AUTHOR} - {STATUS} - {SUBJECT}{CRLF}{URL}')
     self.resource = Resource(self.url, filters=[self.auth])
     
     self.bug_regex = re.compile(r'#(\d+)\b')
     
     self.bugs_being_fetched=[]
Exemple #9
0
 def __init__(self, bot):
     IPlugin.__init__(self, bot)
     
     # Recipient => Messages ({from,message})
     self.data = {}
     self.LoadPluginData()
     
     # {from,to,message}
     self.lastMessages = []
     
     self.RegisterCommand('tell', self.OnTell, help='Leave a message for someone.')
     self.RegisterCommand('received', self.OnReceived, help='Bot will mark messages sent to you as read.')
     self.RegisterCommand('messages', self.OnMessages, help='Rattle off the messages sent to you.')
     self.RegisterCommand('belay', self.OnBelay, help='Remove last message you sent.')
Exemple #10
0
 def __init__(self, bot):
     IPlugin.__init__(self, bot)
     
     self.data=None
     self.config=None
     self.url=None
     self.ignored=[]
     self.auth=None
     self.project_id=None
     self.resource=None
     self.lastCheck=0
     
     self.config = globalConfig.get('plugins.redmine')
     if self.config is None:
         logging.error('Redmine: Disabled.') 
         return
     
     self.data = {
         'last-bug-created': 0,
         'ignored-names': [
             '/^Not\-[0-9]+/' # Notifico bots
         ]
     }
     
     self.LoadPluginData()
     
     self.url = globalConfig.get('plugins.redmine.url', None)
     if self.url is None:
         logging.error('Redmine: Disabled.') 
         
         return
     self.ignored = []
     for ignoretok in self.data.get('ignored-names',['/^Not\-[0-9]/']):
         if ignoretok.startwith('/') and ignoretok.endwith('/'):
             self.ignored+=[re.compile(ignoretok[1:-1])]
         else:
             self.ignored+=[re.compile('^'+re.escape(ignoretok)+'$')]
     self.auth = BasicAuth(globalConfig.get('plugins.redmine.apikey', None), str(random.random()))
     self.project_id = globalConfig.get('plugins.redmine.project', None)
     if self.project_id is None: logging.warning('Redmine: Not going to check for bug updates.')
     self.bug_info_format = globalConfig.get('plugins.redmine.bug-info-format', 'Redmine #{ID} - {AUTHOR} - {STATUS} - {SUBJECT}{CRLF}{URL}')
     self.new_bug_format = globalConfig.get('plugins.redmine.new-bug-format', 'NEW ISSUE: {URL} (#{ID}: {SUBJECT})')
     self.resource = Resource(self.url, filters=[self.auth])
     
     self.bug_regex = re.compile(r'#(\d+)\b')
     
     self.lastCheck = 0
Exemple #11
0
    def __init__(self, bot):
        IPlugin.__init__(self, bot)

        self.RegisterCommand('shaddap',
                             self.OnShaddap,
                             help='Bot will stop processing nudges.')
        self.RegisterCommand('speak',
                             self.OnSpeak,
                             help='Bot will start processing nudges.')

        self.dropNudges = False

        self.config = globalConfig.get('plugins.nudge')
        if self.config is None:
            logging.warning(
                'plugin.nudge not present in config.  Aborting load.')
            return

        thread.start_new_thread(self.nudge_listener, ())
Exemple #12
0
 def __init__(self, bot):
     IPlugin.__init__(self, bot)
     
     self.data = {
         'last-bug-created': 0
     }
     
     self.LoadPluginData()
     
     self.url = globalConfig.get('plugins.redmine.url', None)
     if self.url is None:
         logging.error('Redmine: Disabled.') 
         return
     self.auth = BasicAuth(globalConfig.get('plugins.redmine.apikey', None), str(random.random()))
     self.project_id = globalConfig.get('plugins.redmine.project', None)
     if self.project_id is None: logging.warning('Redmine: Not going to check for bug updates.')
     self.bug_info_format = globalConfig.get('plugins.redmine.bug-info-format', 'Redmine #{ID} - {AUTHOR} - {STATUS} - {SUBJECT}{CRLF}{URL}')
     self.new_bug_format = globalConfig.get('plugins.redmine.new-bug-format', 'NEW ISSUE: {URL} (#{ID}: {SUBJECT})')
     self.resource = Resource(self.url, filters=[self.auth])
     
     self.bug_regex = re.compile(r'#(\d+)\b')
     
     self.lastCheck = 0
Exemple #13
0
    def __init__(self, bot):
        IPlugin.__init__(self, bot)

        # Recipient => Messages ({from,message})
        self.data = {}
        self.LoadPluginData()

        # {from,to,message}
        self.lastMessages = []

        self.RegisterCommand('tell',
                             self.OnTell,
                             help='Leave a message for someone.')
        self.RegisterCommand(
            'received',
            self.OnReceived,
            help='Bot will mark messages sent to you as read.')
        self.RegisterCommand('messages',
                             self.OnMessages,
                             help='Rattle off the messages sent to you.')
        self.RegisterCommand('belay',
                             self.OnBelay,
                             help='Remove last message you sent.')
Exemple #14
0
    def __init__(self, bot):
        IPlugin.__init__(self, bot)

        self.data = {"last-bug-created": 0}

        self.LoadPluginData()

        self.url = globalConfig.get("plugins.redmine.url", None)
        if self.url is None:
            logging.error("Redmine: Disabled.")
            return
        self.auth = BasicAuth(globalConfig.get("plugins.redmine.apikey", None), str(random.random()))
        self.project_id = globalConfig.get("plugins.redmine.project", None)
        if self.project_id is None:
            logging.warning("Redmine: Not going to check for bug updates.")
        self.bug_info_format = globalConfig.get(
            "plugins.redmine.bug-info-format", "Redmine #{ID} - {AUTHOR} - {STATUS} - {SUBJECT}{CRLF}{URL}"
        )
        self.new_bug_format = globalConfig.get("plugins.redmine.new-bug-format", "NEW ISSUE: {URL} (#{ID}: {SUBJECT})")
        self.resource = Resource(self.url, filters=[self.auth])

        self.bug_regex = re.compile(r"#(\d+)\b")

        self.lastCheck = 0