Fehler bei Vergabe von Bonuspunkte korrigiert.

Kommentare für Bonuspunkte werden jetzt als Kommentar beim Spieler hinterlassen, nicht als Kommentar in der Hanchan.
FIXED: 3_in_a_row counter wurde nicht zurückgesetzt wenn Bonuspunkte vergeben wurden.
FIXED: Durchschnittliche Platzierung während eines Events wurde nur als Ganzzahl berechnet. Wird nun als Fießkomma berechnet und gesichert.
This commit is contained in:
Christian Berg
2016-01-09 22:55:26 +01:00
parent 088efe2f39
commit b1586efbab
155 changed files with 2571 additions and 2835 deletions

View File

@@ -103,19 +103,16 @@ class Command(BaseCommand):
return css
def remove_unnecessary_semicolons(self, css):
"""Remove unnecessary semicolons."""
return re.sub(r";+\}", "}", css)
def remove_empty_rules(self, css):
"""Remove empty rules."""
return re.sub(r"[^\}\{]+\{\}", "", css)
def normalize_rgb_colors_to_hex(self, css):
"""Convert `rgb(51,102,153)` to `#336699`."""
@@ -133,7 +130,6 @@ class Command(BaseCommand):
return re.sub(r"([\s:])(0)(px|em|%|in|cm|mm|pc|pt|ex)", r"\1\2", css)
def condense_multidimensional_zeros(self, css):
"""Replace `:0 0 0 0;`, `:0 0 0;` etc. with `:0;`."""
@@ -141,18 +137,17 @@ class Command(BaseCommand):
css = css.replace(":0 0 0;", ":0;")
css = css.replace(":0 0;", ":0;")
# Revert `background-position:0;` to the valid `background-position:0 0;`.
# Revert `background-position:0;` to the valid `background-position:0
# 0;`.
css = css.replace("background-position:0;", "background-position:0 0;")
return css
def condense_floating_points(self, css):
"""Replace `0.6` with `.6` where possible."""
return re.sub(r"(:|\s)0+\.(\d+)", r"\1.\2", css)
def condense_hex_colors(self, css):
"""Shorten colors from #AABBCC to #ABC where possible."""
@@ -170,7 +165,6 @@ class Command(BaseCommand):
match = regex.search(css, match.end())
return css
def condense_whitespace(self, css):
"""Condense multiple adjacent whitespace characters into one."""
@@ -196,7 +190,6 @@ class Command(BaseCommand):
lines.append(css[line_start:])
return '\n'.join(lines)
def compress(self, css, wrap=None):
css = self.remove_comments(css)
css = self.condense_whitespace(css)
@@ -223,7 +216,8 @@ class Command(BaseCommand):
CSS_ROOT = os.path.join(settings.STATICFILES_DIRS[0], 'css')
for site in Site.objects.all():
css_input = os.path.join(CSS_ROOT, site.domain)
css_output = '%s/%s.css' % (CSS_ROOT, site.domain.replace('.', '_'))
css_output = '%s/%s.css' % (CSS_ROOT,
site.domain.replace('.', '_'))
print _("Compressing CSS for %s") % site.name
print "Input Dir: %s" % css_input

View File

@@ -23,7 +23,8 @@ class Command(BaseCommand):
CSS_ROOT = os.path.join(settings.STATICFILES_DIRS[0], 'css')
for site in Site.objects.all():
css_input = os.path.join(CSS_ROOT, site.domain)
css_output = '%s/%s.css' % (CSS_ROOT, site.domain.replace('.', '_'))
css_output = '%s/%s.css' % (CSS_ROOT,
site.domain.replace('.', '_'))
print _("Compressing CSS for %s") % site.name
print "Input Dir: %s" % css_input
@@ -44,4 +45,3 @@ class Command(BaseCommand):
with open(css_output, 'w') as css_file:
css_file.write(self.compress(css))
# file.write(css)