コード例 #1
0
ファイル: helpers.py プロジェクト: ChrysalisTeam/pychronia
 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)
コード例 #2
0
ファイル: helpers.py プロジェクト: akram-max/pychronia
 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)
コード例 #3
0
ファイル: helpers.py プロジェクト: akram-max/pychronia
 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)
コード例 #4
0
ファイル: helpers.py プロジェクト: ChrysalisTeam/pychronia
 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
コード例 #5
0
ファイル: helpers.py プロジェクト: akram-max/pychronia
 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
コード例 #6
0
ファイル: helpers.py プロジェクト: ChrysalisTeam/pychronia
 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)