X-Git-Url: https://git.yukkurigames.com/?p=python-bulletml.git;a=blobdiff_plain;f=bulletml%2Fparser.py;h=b39437ac8dd951d3c20def3b6523c2b68f12f1ed;hp=bf850a7aae753d5f7b52592b113965043ed0a402;hb=dd06ecce6efd9815f6ff09f2a985738dd699288d;hpb=ef50d69288ee60ac2a8fae2ffe5860e80299fd72 diff --git a/bulletml/parser.py b/bulletml/parser.py index bf850a7..b39437a 100644 --- a/bulletml/parser.py +++ b/bulletml/parser.py @@ -5,6 +5,8 @@ http://www.asahi-net.or.jp/~cs8k-cyu/bulletml/index_e.html from __future__ import division +import math + from xml.etree.ElementTree import ElementTree try: @@ -61,7 +63,7 @@ class Direction(object): return cls(element.get("type", default), NumberDef(element.text)) def __call__(self, params, rank): - return (self.value(params, rank), self.type) + return (math.radians(self.value(params, rank)), self.type) def __repr__(self): return "%s(%r, type=%r)" % ( @@ -185,6 +187,7 @@ class Repeat(object): @classmethod def FromElement(cls, doc, element): + """Construct using an ElementTree-style element.""" for subelem in element.getchildren(): tag = realtag(subelem) if tag == "times":