summaryrefslogtreecommitdiff
path: root/css.py
diff options
context:
space:
mode:
authorYves Fischer <yvesf-git@xapek.org>2015-11-22 00:25:56 +0100
committerYves Fischer <yvesf-git@xapek.org>2015-11-22 00:25:56 +0100
commit6080b38fb2b6b3c1017bdd34bb7552bc7e26a4a0 (patch)
tree07b69c3c6a665ef290591e184ca0d2ba3b73fe01 /css.py
parent49ac3c20cb77b90493ce79b4e31cf0f58cba0116 (diff)
downloadwatchnews-6080b38fb2b6b3c1017bdd34bb7552bc7e26a4a0.tar.gz
watchnews-6080b38fb2b6b3c1017bdd34bb7552bc7e26a4a0.zip
project restructure
make it a proper python package
Diffstat (limited to 'css.py')
-rw-r--r--css.py29
1 files changed, 0 insertions, 29 deletions
diff --git a/css.py b/css.py
deleted file mode 100644
index b32a274..0000000
--- a/css.py
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/python3
-import re
-
-
-class Rule:
-
- def __init__(self, *path, **properties):
- self.path = path
- self.properties = properties
-
- def _f(self, prop):
- key, value = prop
- key = re.sub("([A-Z])", "-\\1", key).lower()
- return " {}: {};".format(key, value)
-
- def __format__(self):
- result = " ".join(self.path)
- result += " {\n"
- result += "\n".join(map(self._f, self.properties.items()))
- result += "\n}\n"
- return result
-
-
-def string(*rules):
- return "\n".join(map(lambda r: r.__format__(), rules))
-
-if __name__ == "__main__":
- print("CSS Demo")
- print(Rule(".foo", "#blah", backgroundColor="red").__format__())