← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~raoul-snyman/openlp/fix-lp-merge into lp:openlp

 

Raoul Snyman has proposed merging lp:~raoul-snyman/openlp/fix-lp-merge into lp:openlp.

Commit message:
The merge proposal page seems to have changed a bit, fix up the script to match the page

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~raoul-snyman/openlp/fix-lp-merge/+merge/345115

The merge proposal page seems to have changed a bit, fix up the script to match the page
-- 
Your team OpenLP Core is requested to review the proposed merge of lp:~raoul-snyman/openlp/fix-lp-merge into lp:openlp.
=== modified file 'scripts/lp-merge.py'
--- scripts/lp-merge.py	2017-12-29 09:15:48 +0000
+++ scripts/lp-merge.py	2018-05-04 21:32:52 +0000
@@ -94,17 +94,18 @@
         print('Unable to load merge URL: {}'.format(url))
         return None
     soup = BeautifulSoup(page.read(), 'lxml')
-    # Find this span tag that contains the branch url
+    # Find the span tag that contains the branch url
     # <span class="branch-url">
     span_branch_url = soup.find('span', class_='branch-url')
     if not span_branch_url:
         print('Unable to find merge details on URL: {}'.format(url))
         return None
     merge_info['branch_url'] = span_branch_url.contents[0]
-    # Find this tag that describes the branch. We'll use that for commit message
-    # <meta name="description" content="...">
-    meta = soup.find('meta', attrs={"name": "description"})
-    merge_info['commit_message'] = meta.get('content')
+    # Find the p tag that contains the commit message
+    # <div id="commit-message">...<div id="edit-commit_message">...<div class="yui3-editable_text-text"><p>
+    commit_message = soup.find('div', id='commit-message').find('div', id='edit-commit_message')\
+            .find('div', 'yui3-editable_text-text').p
+    merge_info['commit_message'] = commit_message.string
     # Find all tr-tags with this class. Makes it possible to get bug numbers.
     # <tr class="bug-branch-summary"
     bug_rows = soup.find_all('tr', class_='bug-branch-summary')


Follow ups