Ejemplo n.º 1
0
 def encyclopedia_link_attr_generator(match):
     matched_str = match.group(0)
     assert matched_str
     # detecting here WHICH keyword triggered the match would be possible, but expensive... let's postpone that
     link = game_view_url("pychronia_game.views.view_encyclopedia", datamanager=datamanager)
     link += "?search=%s" % urllib.quote_plus(matched_str.encode("utf8"), safe=b"")
     return dict(href=link)
Ejemplo n.º 2
0
 def email_link_attr_generator(match):
     matched_str = match.group(0)
     link = game_view_url("pychronia_game.views.compose_message",
                          datamanager=datamanager,
                          neutral_link=True)
     link += "?recipient=%s" % urllib.parse.quote_plus(
         matched_str.encode("utf8"), safe=b"")
     return dict(href=link)
Ejemplo n.º 3
0
 def encyclopedia_link_attr_generator(match):
     matched_str = match.group(0)
     assert matched_str
     # detecting here WHICH keyword triggered the match would be possible, but expensive... let's postpone that
     link = game_view_url("pychronia_game.views.view_encyclopedia",
                          datamanager=datamanager,
                          neutral_link=True)
     link += "?search=%s" % urllib.parse.quote_plus(
         matched_str.encode("utf8"), safe=b"")
     return dict(href=link)
Ejemplo n.º 4
0
 def site_link_attr_generator(match):
     matched_str = match.group("view")
     if "." not in matched_str:
         matched_str = "pychronia_game.views." + matched_str
     try:
         link = game_view_url(matched_str, datamanager=datamanager)
         return dict(href=link)
     except Exception:
         logging.warning("Error in generate_site_links for match %r", matched_str, exc_info=True)
         return None # abort link creation
Ejemplo n.º 5
0
 def site_link_attr_generator(match):
     matched_str = match.group("view")
     if "." not in matched_str:
         matched_str = "pychronia_game.views." + matched_str
     try:
         link = game_view_url(matched_str,
                              datamanager=datamanager,
                              neutral_link=True)
         return dict(href=link)
     except Exception:
         logging.warning("Error in generate_site_links for match %r",
                         matched_str,
                         exc_info=True)
         return None  # abort link creation
Ejemplo n.º 6
0
 def email_link_attr_generator(match):
     matched_str = match.group(0)
     link = game_view_url("pychronia_game.views.compose_message", datamanager=datamanager)
     link += "?recipient=%s" % urllib.quote_plus(matched_str.encode("utf8"), safe=b"")
     return dict(href=link)