def __run__(self, time): info = self.get_build_info() issues = [] curr = self.getReportedIssues() for i in info: if safe_read_dictionary(i, 'pull_request') is None: if str(i['id']) not in curr: urls = re.findall( 'http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+', i['body']) img = '' bodyText = i['body'] if len(urls) > 0: img = urls[0] bodyText = bodyText.replace(img, '') Timeline.add_item_from_bot( i['user']['login'] + ' reported an issue', i['title'] + '. ' + bodyText, img, Icons.Github, IconBackgrounds.Yellow, ) issues.append(i['id']) self.writeReportedIssues(issues) print(self.getReportedIssues())
def __run__(self, time): info = self.get_build_info() issues = [] curr = self.getReportedIssues() for i in info: if safe_read_dictionary(i, 'pull_request') is None: if str(i['id']) not in curr: urls = re.findall('http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+', i['body']) img = '' bodyText = i['body'] if len(urls) > 0: img = urls[0] bodyText = bodyText.replace(img, '') Timeline.add_item_from_bot(i['user']['login'] + ' reported an issue', i['title'] + '. ' + bodyText, img, Icons.Github, IconBackgrounds.Yellow,) issues.append(i['id']) self.writeReportedIssues(issues) print(self.getReportedIssues())
def getReportedIssues(cls): i = safe_read_dictionary(sync_read_status_file(), 'issues') if i is None: i = '' return i.split()
def get_auth(self): d = sync_read_status_file() return [ safe_read_dictionary(d, 'github_username'), safe_read_dictionary(d, 'github_password') ]
def test_safe_read_dictionary(self): d = {} v = safe_read_dictionary(d, 'unknown_value') self.assertIsNone(v)
def get_auth(self): d = sync_read_status_file() return [safe_read_dictionary(d, "vso_username"), safe_read_dictionary(d, "vso_password")]