jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/773820 )

Change subject: [doc] remove phabricator links with setup.py
......................................................................

[doc] remove phabricator links with setup.py

Change-Id: Id06069838903f80ebcc8d2e95435ea7ca4360f7b
---
M setup.py
1 file changed, 4 insertions(+), 2 deletions(-)

Approvals:
  Xqt: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/setup.py b/setup.py
index ae07b29..25715ac 100755
--- a/setup.py
+++ b/setup.py
@@ -34,6 +34,7 @@
 #
 # ## KEEP PYTHON 2 SUPPORT FOR THIS SCRIPT ## #
 import os
+import re
 import sys


@@ -216,6 +217,7 @@
     Combine included restructured text files which must be done before
     uploading because the source isn't available after creating the package.
     """
+    pattern = r'\:phab\:`(T\d+)`', r'\1'
     desc = []
     with open(filename) as f:
         for line in f:
@@ -223,11 +225,11 @@
                 include = os.path.relpath(line.rsplit('::')[1].strip())
                 if os.path.exists(include):
                     with open(include) as g:
-                        desc.append(g.read())
+                        desc.append(re.sub(*pattern, g.read()))
                 else:
                     print('Cannot include {}; file not found'.format(include))
             else:
-                desc.append(line)
+                desc.append(re.sub(*pattern, line))
     return ''.join(desc)



--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/773820
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Id06069838903f80ebcc8d2e95435ea7ca4360f7b
Gerrit-Change-Number: 773820
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to