aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/newos4-feedback-apply.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/newos4-feedback-apply.py b/scripts/newos4-feedback-apply.py
index 38188fb..ed1a34c 100755
--- a/scripts/newos4-feedback-apply.py
+++ b/scripts/newos4-feedback-apply.py
@@ -125,7 +125,8 @@ def report_title(rid):
try:
with open(os.path.join(REPORTS, rid + '.json'), encoding='utf-8') as f:
d = json.load(f)
- return str(d.get('title') or d.get('message') or rid)[:160]
+ t = str(d.get('title') or d.get('message') or rid)[:160]
+ return t[6:] if t.startswith('Auto: ') else t # the 'Auto: ' prefix is redundant in a directive
except Exception:
return rid
@@ -133,8 +134,9 @@ def report_title(rid):
def apply_report(name, decision, note):
if decision != 'approve':
return 'recorded (no action)'
- text = '%s — %s' % (report_title(name), name)
- if note:
+ title = report_title(name)
+ text = '%s — %s' % (title, name)
+ if note and note.strip() != title.strip(): # the note often repeats the title
text = '%s — %s' % (text, note)
r = subprocess.run([sys.executable, STEER, 'add', text, '--priority', 'high'],
capture_output=True, text=True, timeout=60)