Skip to content

Commit

Permalink
branch_changer: distinguish terminal output
Browse files Browse the repository at this point in the history
maintainer-scripts/ChangeLog:

	* branch_changer.py: Generate URL only when emitting
	to terminal.
  • Loading branch information
marxin committed Apr 9, 2021
1 parent a0bb9b3 commit 7d7481e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion maintainer-scripts/branch_changer.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import argparse
import json
import re
import sys

import requests

Expand Down Expand Up @@ -83,7 +84,10 @@ def parse_known_to_fail(self):
def name(self):
bugid = self.data['id']
url = f'https://gcc.gnu.org/bugzilla/show_bug.cgi?id={bugid}'
return f'\u001b]8;;{url}\u001b\\PR{bugid}\u001b]8;;\u001b\\ ({self.data["summary"]})'
if sys.stdout.isatty():
return f'\u001b]8;;{url}\u001b\\PR{bugid}\u001b]8;;\u001b\\ ({self.data["summary"]})'
else:
return f'PR{bugid} ({self.data["summary"]})'

def remove_release(self, release):
self.versions = list(filter(lambda x: x != release, self.versions))
Expand Down

0 comments on commit 7d7481e

Please sign in to comment.