summaryrefslogtreecommitdiff
path: root/tools/wtperf_stats/3rdparty/nvd3/translator.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/wtperf_stats/3rdparty/nvd3/translator.py')
-rw-r--r--tools/wtperf_stats/3rdparty/nvd3/translator.py71
1 files changed, 0 insertions, 71 deletions
diff --git a/tools/wtperf_stats/3rdparty/nvd3/translator.py b/tools/wtperf_stats/3rdparty/nvd3/translator.py
deleted file mode 100644
index ffde2c2a1ce..00000000000
--- a/tools/wtperf_stats/3rdparty/nvd3/translator.py
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: UTF-8 -*-
-
-
-class Tag(object):
- """Tag class"""
-
- def __init__(self, content=None):
- self.content = content
- self.attrs = ' '.join(['%s="%s"' % (attr, value)
- for attr, value in self.attrs])
-
- def __str__(self):
- return '<%s%s>\n %s\n</%s>' % (self.name,
- ' ' + self.attrs if self.attrs else '',
- self.content,
- self.name)
-
-
-class ScriptTag(Tag):
- name = 'script'
- attrs = (('type', 'text/javascript'),)
-
-
-class AnonymousFunction(object):
- def __init__(self, arguments, content):
- self.arguments = arguments
- self.content = content
-
- def __str__(self):
- return 'function(%s) { %s }' % (self.arguments, self.content)
-
-
-class Function(object):
-
- def __init__(self, name):
- self.name = name
- self._calls = []
-
- def __str__(self):
- operations = [self.name]
- operations.extend(str(call) for call in self._calls)
- return '%s' % ('.'.join(operations),)
-
- def __getattr__(self, attr):
- self._calls.append(attr)
- return self
-
- def __call__(self, *args):
- if not args:
- self._calls[-1] = self._calls[-1] + '()'
- else:
- arguments = ','.join([str(arg) for arg in args])
- self._calls[-1] = self._calls[-1] + '(%s)' % (arguments,)
- return self
-
-
-class Assignment(object):
-
- def __init__(self, key, value, scoped=True):
- self.key = key
- self.value = value
- self.scoped = scoped
-
- def __str__(self):
- return '%s%s = %s;' % ('var ' if self.scoped else '', self.key, self.value)
-
-
-def indent(func):
- # TODO: Add indents to function str
- return str(func)