mirror of
https://github.com/archlinux-jerry/buildbot
synced 2024-11-22 04:50:41 +08:00
buildbot: notify update
This commit is contained in:
parent
0e376f337b
commit
fa5d4a20ab
2 changed files with 6 additions and 4 deletions
|
@ -42,7 +42,7 @@ if __name__ == '__main__':
|
|||
configure_logger(logger)
|
||||
def print_log():
|
||||
import os
|
||||
os.system(f'tail -f {CONSOLE_LOGFILE}')
|
||||
os.system(f'tail -n 43 -f \"{CONSOLE_LOGFILE}\"')
|
||||
try:
|
||||
actions = {
|
||||
'info': 'show buildbot info',
|
||||
|
|
8
utils.py
8
utils.py
|
@ -211,7 +211,7 @@ def get_arch_from_pkgbuild(fpath):
|
|||
with open(fpath, 'r') as f:
|
||||
for line in f.read().split('\n'):
|
||||
if line.startswith('arch='):
|
||||
matches = re.findall('[()\s\'\"]([\w]+)[()\s\'\"]', line)
|
||||
matches = re.findall(r'[()\s\'\"]([\w]+)[()\s\'\"]', line)
|
||||
if not matches:
|
||||
raise TypeError('Unexpected PKGBUILD format')
|
||||
matches = [arch for arch in matches if arch in ARCHS]
|
||||
|
@ -274,13 +274,15 @@ def configure_logger(logger, format='%(asctime)s - %(name)-18s - %(levelname)s -
|
|||
|
||||
class ExceptionFormatter(logging.Formatter):
|
||||
def __init__(self, *args, notify=False, **kwargs):
|
||||
self.notify = notify
|
||||
self.__notify = notify
|
||||
self.__lastnt = ""
|
||||
super().__init__(*args, **kwargs)
|
||||
def format(self, record):
|
||||
if record.levelno == 49:
|
||||
record.msg = 'Exception caught.\nPrinting stack traceback\n' + record.msg
|
||||
fmtr = super().format(record)
|
||||
if self.notify:
|
||||
if self.__notify and not (self.__lastnt == fmtr):
|
||||
self.lastnt = fmtr
|
||||
send(fmtr)
|
||||
return fmtr
|
||||
|
||||
|
|
Loading…
Reference in a new issue