]> de.git.xonotic.org Git - xonotic/xonstat.git/blobdiff - xonstat/util.py
Add headers and rearrange so things look clean.
[xonotic/xonstat.git] / xonstat / util.py
index 4f4581b55ad04a5db4e656070cf7766006832fb0..4ed6aeea18640cfebb88e3aaf984853472bf5629 100644 (file)
@@ -1,6 +1,7 @@
 import sys
 import logging
 import pyramid.httpexceptions
+import pyramid.url
 import re
 from colorsys import rgb_to_hls, hls_to_rgb
 from cgi import escape as html_escape
@@ -13,6 +14,17 @@ from xonstat.d0_blind_id import d0_blind_id_verify
 log = logging.getLogger(__name__)
 
 
+# Map of old weapons codes to new ones
+weapon_map = {
+  "grenadelauncher": "mortar", 
+  "laser": "blaster", 
+  "minstanex": "vaporizer", 
+  "nex": "vortex", 
+  "rocketlauncher": "devastator", 
+  "uzi": "machinegun", 
+}
+
+
 # Map of special chars to ascii from Darkplace's console.c.
 _qfont_ascii_table = [
  '\0', '#',  '#',  '#',  '#',  '.',  '#',  '#',
@@ -55,7 +67,7 @@ _qfont_unicode_glyphs = [
    u'\u005F',       u'\u2747',       u'\u2020',       u'\u00B7',
    u'\U0001F52B',   u'\u0020',       u'\u0020',       u'\u25A0',
    u'\u2022',       u'\u2192',       u'\u2748',       u'\u2748',
-   u'\u005B',       u'\u005D',       u'\U0001F47D',   u'\U0001F60F',
+   u'\u005B',       u'\u005D',       u'\U0001F47D',   u'\U0001F603',
    u'\U0001F61E',   u'\U0001F635',   u'\U0001F615',   u'\U0001F60A',
    u'\u00AB',       u'\u00BB',       u'\u2022',       u'\u203E',
    u'\u2748',       u'\u25AC',       u'\u25AC',       u'\u25AC',
@@ -87,7 +99,7 @@ _qfont_unicode_glyphs = [
    u'\u00A1',       u'\u004F',       u'\u0055',       u'\u0049',
    u'\u0043',       u'\u00A9',       u'\u00AE',       u'\u25A0',
    u'\u00BF',       u'\u25B6',       u'\u2748',       u'\u2748',
-   u'\u2772',       u'\u2773',       u'\U0001F47D',   u'\U0001F60F',
+   u'\u2772',       u'\u2773',       u'\U0001F47D',   u'\U0001F603',
    u'\U0001F61E',   u'\U0001F635',   u'\U0001F615',   u'\U0001F60A',
    u'\u00AB',       u'\u00BB',       u'\u2747',       u'\u0078',
    u'\u2748',       u'\u2014',       u'\u2014',       u'\u2014',
@@ -217,7 +229,7 @@ def limit_printable_characters(qstr, limit):
 
 
 def page_url(page):
-    return current_route_url(request, page=page, _query=request.GET)
+    return pyramid.url.current_route_url(request, page=page, _query=request.GET)
 
 
 def pretty_date(time=False):