Skip to content

Commit

Permalink
Update plugin to version 1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
n-elie authored Aug 14, 2024
1 parent 3b76b62 commit 0784233
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions msdial.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
"""MetGem plugin to download databases from MS-DIAL website"""

__version__ = '1.4'
__version__ = '1.5'
__description__ = "MetGem plugin to download databases from MS-DIAL website"
__author__ = "Nicolas Elie"
__email__ = "[email protected]"
__copyright__ = "Copyright 2019-2022, CNRS/ICSN"
__copyright__ = "Copyright 2019-2024, CNRS/ICSN"
__license__ = "GPLv3"

from urllib.parse import urlparse

def get_first_xpath_result(element, xpath):
result = element.xpath(xpath)
Expand All @@ -19,8 +20,8 @@ def get_first_xpath_result(element, xpath):
class MSDial(DbSource):

name = "MS-DIAL"
page = "http://prime.psc.riken.jp/compms/msdial/main.html"
items_base_url = "http://prime.psc.riken.jp/compms/msdial/"
page = "https://systemsomicslab.github.io/compms/msdial/main.html"
items_base_url = "https://systemsomicslab.github.io/compms/msdial/"

def get_items(self, tree):
items = {}
Expand All @@ -33,7 +34,7 @@ def get_items(self, tree):

if a.tag == 'a':
href = a.attrib.get('href')
if not href or not href.endswith('.msp'):
if not href or not urlparse(href).path.endswith('.msp'):
continue

title = get_first_xpath_result(div, "div[@class='labelMspName']")
Expand Down Expand Up @@ -88,7 +89,7 @@ def get_items(self, tree):

if a.tag == 'a':
href = a.attrib.get('href')
if not href or not href.endswith('.msp'):
if not href or not urlparse(href).path.endswith('.msp'):
continue

lipidblast_hrefs.append(href)
Expand Down

0 comments on commit 0784233

Please sign in to comment.