Skip to content
This repository has been archived by the owner on Mar 22, 2018. It is now read-only.

Commit

Permalink
Merge pull request #262 from RoDuth/add-ALA-links
Browse files Browse the repository at this point in the history
(temporarily) accepting ALA links into master.
we should really keep this in a configuration section - #153
  • Loading branch information
Mario Frasca committed Jan 6, 2016
2 parents 45b0f0c + 2885d3a commit eaab50e
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
4 changes: 4 additions & 0 deletions bauble/plugins/plants/family.py
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,9 @@ def __init__(self):
self.grin_button = web.GRINButton()
buttons.append(self.grin_button)

self.ala_button = web.ALAButton()
buttons.append(self.ala_button)

for b in buttons:
b.set_alignment(0, -1)
self.vbox.pack_start(b)
Expand All @@ -894,6 +897,7 @@ def update(self, row):
self.itis_button.set_string(row)
self.ipni_button.set_keywords(family=row)
self.grin_button.set_string(row)
self.ala_button.set_string(row)


class FamilyInfoBox(InfoBox):
Expand Down
4 changes: 4 additions & 0 deletions bauble/plugins/plants/genus.py
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,9 @@ def __init__(self):
self.tropicos_button = web.TropicosButton()
buttons.append(self.tropicos_button)

self.ala_button = web.ALAButton()
buttons.append(self.ala_button)

for b in buttons:
b.set_alignment(0, -1)
self.vbox.pack_start(b)
Expand All @@ -891,6 +894,7 @@ def update(self, row):
self.bgci_button.set_keywords(genus=row.genus, species='')
self.tpl_button.set_keywords(genus=row.genus, species='')
self.tropicos_button.set_keywords(genus=row.genus, species='')
self.ala_button.set_string(row)


class GeneralGenusExpander(InfoExpander):
Expand Down
4 changes: 4 additions & 0 deletions bauble/plugins/plants/species.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,9 @@ def __init__(self):
self.tropicos_button = web.TropicosButton()
buttons.append(self.tropicos_button)

self.ala_button = web.ALAButton()
buttons.append(self.ala_button)

for b in buttons:
b.set_alignment(0, -1)
self.vbox.pack_start(b, expand=False, fill=False)
Expand All @@ -430,6 +433,7 @@ def update(self, row):
self.bgci_button.set_keywords(genus=row.genus, species=row.sp)
self.tpl_button.set_keywords(genus=row.genus, species=row.sp)
self.tropicos_button.set_keywords(genus=row.genus, species=row.sp)
self.ala_button.set_string(row)


class SpeciesInfoBox(InfoBox):
Expand Down
12 changes: 11 additions & 1 deletion bauble/utils/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class WikipediaButton(KeywordsLinkButton):
_base_uri = "http://en.wikipedia.org/wiki/%(genus)s_%(species)s"
_space = '+'

def __init__(self, title=_("Search the Wikipedia"), tooltip=_(
def __init__(self, title=_("Search Wikipedia"), tooltip=_(
"open the wikipedia page about this species")):
super(WikipediaButton, self).__init__(title, tooltip)

Expand Down Expand Up @@ -170,3 +170,13 @@ class GRINButton(StringLinkButton):
def __init__(self, title=_("Search NPGS/GRIN"),
tooltip=_('Search National Plant Germplasm System')):
super(GRINButton, self).__init__(title, tooltip)


class ALAButton(StringLinkButton):

_base_uri = "http://bie.ala.org.au/search?q=%s"
_space = '+'

def __init__(self, title=_("Search ALA"), tooltip=_(
"Search the Atlas of Living Australia")):
super(ALAButton, self).__init__(title, tooltip)

0 comments on commit eaab50e

Please sign in to comment.