Permalink
Browse files

Add cabaret an online pygal chart generator in progress

  • Loading branch information...
1 parent 39427d4 commit 1425c4f9fb0e3f819142c838316b8a7ae195751f @paradoxxxzero paradoxxxzero committed Sep 14, 2012
Showing with 50,372 additions and 0 deletions.
  1. +54 −0 demo/cabaret.py
  2. +49 −0 demo/cabaret/__init__.py
  3. +37 −0 demo/cabaret/static/components/bootstrap/.gitignore
  4. +85 −0 demo/cabaret/static/components/bootstrap/.issue-guidelines.js
  5. +3 −0 demo/cabaret/static/components/bootstrap/.travis.yml
  6. +176 −0 demo/cabaret/static/components/bootstrap/LICENSE
  7. +108 −0 demo/cabaret/static/components/bootstrap/Makefile
  8. +139 −0 demo/cabaret/static/components/bootstrap/README.md
  9. +34 −0 demo/cabaret/static/components/bootstrap/component.json
  10. +1,058 −0 demo/cabaret/static/components/bootstrap/docs/assets/css/bootstrap-responsive.css
  11. +5,774 −0 demo/cabaret/static/components/bootstrap/docs/assets/css/bootstrap.css
  12. +1,001 −0 demo/cabaret/static/components/bootstrap/docs/assets/css/docs.css
  13. BIN demo/cabaret/static/components/bootstrap/docs/assets/ico/apple-touch-icon-114-precomposed.png
  14. BIN demo/cabaret/static/components/bootstrap/docs/assets/ico/apple-touch-icon-144-precomposed.png
  15. BIN demo/cabaret/static/components/bootstrap/docs/assets/ico/apple-touch-icon-57-precomposed.png
  16. BIN demo/cabaret/static/components/bootstrap/docs/assets/ico/apple-touch-icon-72-precomposed.png
  17. BIN demo/cabaret/static/components/bootstrap/docs/assets/ico/favicon.ico
  18. BIN demo/cabaret/static/components/bootstrap/docs/assets/img/bootstrap-mdo-sfmoma-01.jpg
  19. BIN demo/cabaret/static/components/bootstrap/docs/assets/img/bootstrap-mdo-sfmoma-02.jpg
  20. BIN demo/cabaret/static/components/bootstrap/docs/assets/img/bootstrap-mdo-sfmoma-03.jpg
  21. BIN demo/cabaret/static/components/bootstrap/docs/assets/img/bs-docs-bootstrap-features.png
  22. BIN demo/cabaret/static/components/bootstrap/docs/assets/img/bs-docs-masthead-pattern.png
  23. BIN demo/cabaret/static/components/bootstrap/docs/assets/img/bs-docs-responsive-illustrations.png
  24. BIN demo/cabaret/static/components/bootstrap/docs/assets/img/bs-docs-twitter-github.png
  25. BIN demo/cabaret/static/components/bootstrap/docs/assets/img/example-sites/fleetio.png
  26. BIN demo/cabaret/static/components/bootstrap/docs/assets/img/example-sites/jshint.png
  27. BIN demo/cabaret/static/components/bootstrap/docs/assets/img/example-sites/kippt.png
  28. BIN demo/cabaret/static/components/bootstrap/docs/assets/img/example-sites/soundready.png
  29. BIN demo/cabaret/static/components/bootstrap/docs/assets/img/examples/bootstrap-example-fluid.jpg
  30. BIN demo/cabaret/static/components/bootstrap/docs/assets/img/examples/bootstrap-example-hero.jpg
  31. BIN demo/cabaret/static/components/bootstrap/docs/assets/img/examples/bootstrap-example-starter.jpg
  32. BIN demo/cabaret/static/components/bootstrap/docs/assets/img/glyphicons-halflings-white.png
  33. BIN demo/cabaret/static/components/bootstrap/docs/assets/img/glyphicons-halflings.png
  34. BIN demo/cabaret/static/components/bootstrap/docs/assets/img/grid-baseline-20px.png
  35. BIN demo/cabaret/static/components/bootstrap/docs/assets/img/less-logo-large.png
  36. BIN demo/cabaret/static/components/bootstrap/docs/assets/img/responsive-illustrations.png
  37. +106 −0 demo/cabaret/static/components/bootstrap/docs/assets/js/README.md
  38. +154 −0 demo/cabaret/static/components/bootstrap/docs/assets/js/application.js
  39. +104 −0 demo/cabaret/static/components/bootstrap/docs/assets/js/bootstrap-affix.js
  40. +90 −0 demo/cabaret/static/components/bootstrap/docs/assets/js/bootstrap-alert.js
  41. +96 −0 demo/cabaret/static/components/bootstrap/docs/assets/js/bootstrap-button.js
  42. +176 −0 demo/cabaret/static/components/bootstrap/docs/assets/js/bootstrap-carousel.js
  43. +158 −0 demo/cabaret/static/components/bootstrap/docs/assets/js/bootstrap-collapse.js
  44. +150 −0 demo/cabaret/static/components/bootstrap/docs/assets/js/bootstrap-dropdown.js
  45. +239 −0 demo/cabaret/static/components/bootstrap/docs/assets/js/bootstrap-modal.js
  46. +103 −0 demo/cabaret/static/components/bootstrap/docs/assets/js/bootstrap-popover.js
  47. +151 −0 demo/cabaret/static/components/bootstrap/docs/assets/js/bootstrap-scrollspy.js
  48. +135 −0 demo/cabaret/static/components/bootstrap/docs/assets/js/bootstrap-tab.js
  49. +275 −0 demo/cabaret/static/components/bootstrap/docs/assets/js/bootstrap-tooltip.js
  50. +60 −0 demo/cabaret/static/components/bootstrap/docs/assets/js/bootstrap-transition.js
  51. +300 −0 demo/cabaret/static/components/bootstrap/docs/assets/js/bootstrap-typeahead.js
  52. +2,027 −0 demo/cabaret/static/components/bootstrap/docs/assets/js/bootstrap.js
  53. +2 −0 demo/cabaret/static/components/bootstrap/docs/assets/js/bootstrap.min.js
  54. +30 −0 demo/cabaret/static/components/bootstrap/docs/assets/js/google-code-prettify/prettify.css
  55. +28 −0 demo/cabaret/static/components/bootstrap/docs/assets/js/google-code-prettify/prettify.js
  56. +4 −0 demo/cabaret/static/components/bootstrap/docs/assets/js/jquery.js
  57. +1,980 −0 demo/cabaret/static/components/bootstrap/docs/base-css.html
  58. +44 −0 demo/cabaret/static/components/bootstrap/docs/build/index.js
  59. +6 −0 demo/cabaret/static/components/bootstrap/docs/build/package.json
  60. +2,338 −0 demo/cabaret/static/components/bootstrap/docs/components.html
  61. +480 −0 demo/cabaret/static/components/bootstrap/docs/customize.html
  62. +154 −0 demo/cabaret/static/components/bootstrap/docs/examples/fluid.html
  63. +126 −0 demo/cabaret/static/components/bootstrap/docs/examples/hero.html
  64. +79 −0 demo/cabaret/static/components/bootstrap/docs/examples/starter-template.html
  65. +286 −0 demo/cabaret/static/components/bootstrap/docs/extend.html
  66. +335 −0 demo/cabaret/static/components/bootstrap/docs/getting-started.html
  67. +206 −0 demo/cabaret/static/components/bootstrap/docs/index.html
  68. +1,731 −0 demo/cabaret/static/components/bootstrap/docs/javascript.html
  69. +584 −0 demo/cabaret/static/components/bootstrap/docs/scaffolding.html
  70. +147 −0 demo/cabaret/static/components/bootstrap/docs/templates/layout.mustache
  71. +1,871 −0 demo/cabaret/static/components/bootstrap/docs/templates/pages/base-css.mustache
  72. +2,221 −0 demo/cabaret/static/components/bootstrap/docs/templates/pages/components.mustache
  73. +363 −0 demo/cabaret/static/components/bootstrap/docs/templates/pages/customize.mustache
  74. +169 −0 demo/cabaret/static/components/bootstrap/docs/templates/pages/extend.mustache
  75. +218 −0 demo/cabaret/static/components/bootstrap/docs/templates/pages/getting-started.mustache
  76. +89 −0 demo/cabaret/static/components/bootstrap/docs/templates/pages/index.mustache
  77. +1,615 −0 demo/cabaret/static/components/bootstrap/docs/templates/pages/javascript.mustache
  78. +471 −0 demo/cabaret/static/components/bootstrap/docs/templates/pages/scaffolding.mustache
  79. BIN demo/cabaret/static/components/bootstrap/img/glyphicons-halflings-white.png
  80. BIN demo/cabaret/static/components/bootstrap/img/glyphicons-halflings.png
  81. +12 −0 demo/cabaret/static/components/bootstrap/js/.jshintrc
  82. +104 −0 demo/cabaret/static/components/bootstrap/js/bootstrap-affix.js
  83. +90 −0 demo/cabaret/static/components/bootstrap/js/bootstrap-alert.js
  84. +96 −0 demo/cabaret/static/components/bootstrap/js/bootstrap-button.js
  85. +176 −0 demo/cabaret/static/components/bootstrap/js/bootstrap-carousel.js
  86. +158 −0 demo/cabaret/static/components/bootstrap/js/bootstrap-collapse.js
  87. +150 −0 demo/cabaret/static/components/bootstrap/js/bootstrap-dropdown.js
  88. +239 −0 demo/cabaret/static/components/bootstrap/js/bootstrap-modal.js
  89. +103 −0 demo/cabaret/static/components/bootstrap/js/bootstrap-popover.js
  90. +151 −0 demo/cabaret/static/components/bootstrap/js/bootstrap-scrollspy.js
  91. +135 −0 demo/cabaret/static/components/bootstrap/js/bootstrap-tab.js
  92. +275 −0 demo/cabaret/static/components/bootstrap/js/bootstrap-tooltip.js
  93. +60 −0 demo/cabaret/static/components/bootstrap/js/bootstrap-transition.js
  94. +300 −0 demo/cabaret/static/components/bootstrap/js/bootstrap-typeahead.js
  95. +56 −0 demo/cabaret/static/components/bootstrap/js/tests/index.html
  96. +63 −0 demo/cabaret/static/components/bootstrap/js/tests/phantom.js
  97. +14 −0 demo/cabaret/static/components/bootstrap/js/tests/server.js
  98. +19 −0 demo/cabaret/static/components/bootstrap/js/tests/unit/bootstrap-affix.js
  99. +56 −0 demo/cabaret/static/components/bootstrap/js/tests/unit/bootstrap-alert.js
  100. +96 −0 demo/cabaret/static/components/bootstrap/js/tests/unit/bootstrap-button.js
  101. +42 −0 demo/cabaret/static/components/bootstrap/js/tests/unit/bootstrap-carousel.js
  102. +88 −0 demo/cabaret/static/components/bootstrap/js/tests/unit/bootstrap-collapse.js
  103. +105 −0 demo/cabaret/static/components/bootstrap/js/tests/unit/bootstrap-dropdown.js
  104. +114 −0 demo/cabaret/static/components/bootstrap/js/tests/unit/bootstrap-modal.js
  105. +21 −0 demo/cabaret/static/components/bootstrap/js/tests/unit/bootstrap-phantom.js
  106. +107 −0 demo/cabaret/static/components/bootstrap/js/tests/unit/bootstrap-popover.js
  107. +31 −0 demo/cabaret/static/components/bootstrap/js/tests/unit/bootstrap-scrollspy.js
  108. +61 −0 demo/cabaret/static/components/bootstrap/js/tests/unit/bootstrap-tab.js
  109. +144 −0 demo/cabaret/static/components/bootstrap/js/tests/unit/bootstrap-tooltip.js
  110. +13 −0 demo/cabaret/static/components/bootstrap/js/tests/unit/bootstrap-transition.js
  111. +204 −0 demo/cabaret/static/components/bootstrap/js/tests/unit/bootstrap-typeahead.js
  112. +4 −0 demo/cabaret/static/components/bootstrap/js/tests/vendor/jquery.js
  113. +232 −0 demo/cabaret/static/components/bootstrap/js/tests/vendor/qunit.css
  114. +1,510 −0 demo/cabaret/static/components/bootstrap/js/tests/vendor/qunit.js
  115. +34 −0 demo/cabaret/static/components/bootstrap/less/accordion.less
  116. +65 −0 demo/cabaret/static/components/bootstrap/less/alerts.less
  117. +62 −0 demo/cabaret/static/components/bootstrap/less/bootstrap.less
  118. +24 −0 demo/cabaret/static/components/bootstrap/less/breadcrumbs.less
  119. +245 −0 demo/cabaret/static/components/bootstrap/less/button-groups.less
  120. +231 −0 demo/cabaret/static/components/bootstrap/less/buttons.less
  121. +131 −0 demo/cabaret/static/components/bootstrap/less/carousel.less
  122. +31 −0 demo/cabaret/static/components/bootstrap/less/close.less
  123. +58 −0 demo/cabaret/static/components/bootstrap/less/code.less
  124. +22 −0 demo/cabaret/static/components/bootstrap/less/component-animations.less
  125. +210 −0 demo/cabaret/static/components/bootstrap/less/dropdowns.less
  126. +650 −0 demo/cabaret/static/components/bootstrap/less/forms.less
  127. +21 −0 demo/cabaret/static/components/bootstrap/less/grid.less
  128. +24 −0 demo/cabaret/static/components/bootstrap/less/hero-unit.less
  129. +72 −0 demo/cabaret/static/components/bootstrap/less/labels-badges.less
  130. +16 −0 demo/cabaret/static/components/bootstrap/less/layouts.less
  131. +681 −0 demo/cabaret/static/components/bootstrap/less/mixins.less
  132. +98 −0 demo/cabaret/static/components/bootstrap/less/modals.less
  133. +475 −0 demo/cabaret/static/components/bootstrap/less/navbar.less
  134. +384 −0 demo/cabaret/static/components/bootstrap/less/navs.less
  135. +40 −0 demo/cabaret/static/components/bootstrap/less/pager.less
  136. +64 −0 demo/cabaret/static/components/bootstrap/less/pagination.less
  137. +117 −0 demo/cabaret/static/components/bootstrap/less/popovers.less
  138. +122 −0 demo/cabaret/static/components/bootstrap/less/progress-bars.less
  139. +137 −0 demo/cabaret/static/components/bootstrap/less/reset.less
  140. +28 −0 demo/cabaret/static/components/bootstrap/less/responsive-1200px-min.less
  141. +174 −0 demo/cabaret/static/components/bootstrap/less/responsive-767px-max.less
  142. +19 −0 demo/cabaret/static/components/bootstrap/less/responsive-768px-979px.less
  143. +177 −0 demo/cabaret/static/components/bootstrap/less/responsive-navbar.less
  144. +43 −0 demo/cabaret/static/components/bootstrap/less/responsive-utilities.less
  145. +48 −0 demo/cabaret/static/components/bootstrap/less/responsive.less
  146. +52 −0 demo/cabaret/static/components/bootstrap/less/scaffolding.less
  147. +193 −0 demo/cabaret/static/components/bootstrap/less/sprites.less
  148. +245 −0 demo/cabaret/static/components/bootstrap/less/tables.less
  149. +139 −0 demo/cabaret/static/components/bootstrap/less/tests/css-tests.css
  150. +1,296 −0 demo/cabaret/static/components/bootstrap/less/tests/css-tests.html
  151. +179 −0 demo/cabaret/static/components/bootstrap/less/tests/forms.html
  152. +108 −0 demo/cabaret/static/components/bootstrap/less/tests/navbar.html
  153. +52 −0 demo/cabaret/static/components/bootstrap/less/thumbnails.less
  154. +70 −0 demo/cabaret/static/components/bootstrap/less/tooltip.less
  155. +221 −0 demo/cabaret/static/components/bootstrap/less/type.less
  156. +30 −0 demo/cabaret/static/components/bootstrap/less/utilities.less
  157. +279 −0 demo/cabaret/static/components/bootstrap/less/variables.less
  158. +29 −0 demo/cabaret/static/components/bootstrap/less/wells.less
  159. +25 −0 demo/cabaret/static/components/bootstrap/package.json
  160. +13 −0 demo/cabaret/static/components/jquery/component.json
  161. +9,301 −0 demo/cabaret/static/components/jquery/jquery.js
  162. +19 −0 demo/cabaret/static/css.css
  163. +71 −0 demo/cabaret/static/js.js
  164. +44 −0 demo/cabaret/templates/_layout.jinja2
  165. +45 −0 demo/cabaret/templates/index.jinja2
  166. +10 −0 demo/cabaret/templates/svgs.jinja2
View
@@ -0,0 +1,54 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+# This file is part of pygal
+#
+# A python svg graph plotting library
+# Copyright © 2012 Kozea
+#
+# This library is free software: you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
+#
+# This library is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with pygal. If not, see <http://www.gnu.org/licenses/>.
+from cabaret import create_app
+import logging
+app = create_app()
+
+try:
+ from log_colorizer import make_colored_stream_handler
+ handler = make_colored_stream_handler()
+ app.logger.handlers = []
+ app.logger.addHandler(handler)
+ import werkzeug
+ werkzeug._internal._log('debug', '<-- I am with stupid')
+ logging.getLogger('werkzeug').handlers = []
+ logging.getLogger('werkzeug').addHandler(handler)
+
+ handler.setLevel(logging.DEBUG)
+ app.logger.setLevel(logging.DEBUG)
+ logging.getLogger('werkzeug').setLevel(logging.DEBUG)
+except:
+ pass
+
+
+try:
+ import wsreload
+except ImportError:
+ app.logger.debug('wsreload not found')
+else:
+ url = "http://cabaret.l:12221/*"
+
+ def log(httpserver):
+ app.logger.debug('WSReloaded after server restart')
+ wsreload.monkey_patch_http_server({'url': url}, callback=log)
+ app.logger.debug('HTTPServer monkey patched for url %s' % url)
+
+
+app.run(debug=True, threaded=True, host='0.0.0.0', port=12221)
@@ -0,0 +1,49 @@
+# -*- coding: utf-8 -*-
+# This file is part of pygal
+#
+# A python svg graph plotting library
+# Copyright © 2012 Kozea
+#
+# This library is free software: you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
+#
+# This library is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with pygal. If not, see <http://www.gnu.org/licenses/>.
+from flask import Flask, render_template, request
+from pygal import CHARTS_BY_NAME
+from pygal.graph import CHARTS_NAMES
+from pygal.config import Config
+from pygal.style import styles
+from json import loads
+
+
+def create_app():
+ """Creates the pygal test web app"""
+
+ app = Flask(__name__)
+
+ @app.route("/")
+ def index():
+ configs = Config()._items
+ return render_template(
+ 'index.jinja2', charts_names=CHARTS_NAMES, configs=dict(configs),
+ styles_names=styles.keys())
+
+ @app.route("/svg", methods=('POST',))
+ def svg():
+ values = request.values
+ chart = CHARTS_BY_NAME[values['type']](
+ disable_xml_declaration=True,
+ style=styles[values['style']], **loads(values['opts']))
+ for title, vals in loads(values['vals']).items():
+ chart.add(title, vals)
+ return chart.render_response()
+
+ return app
@@ -0,0 +1,37 @@
+# Numerous always-ignore extensions
+*.diff
+*.err
+*.orig
+*.log
+*.rej
+*.swo
+*.swp
+*.zip
+*.vi
+*~
+*.sass-cache
+
+# OS or Editor folders
+.DS_Store
+._*
+Thumbs.db
+.cache
+.project
+.settings
+.tmproj
+*.esproj
+nbproject
+*.sublime-project
+*.sublime-workspace
+
+# Komodo
+*.komodoproject
+.komodotools
+
+# Folders to ignore
+.hg
+.svn
+.CVS
+.idea
+node_modules
+dist
@@ -0,0 +1,85 @@
+/* ==========================================================
+ * issue-guidelines.js
+ * http://twitter.github.com/bootstrap/javascript.html#alerts
+ * ==========================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================================================== */
+
+var assert = require('assert')
+
+module.exports = {
+
+ 'pull-requests': {
+
+ 'should always be made against -wip branches': function (pull) {
+ assert.ok(/\-wip$/.test(pull.base.ref))
+ },
+
+ 'should always be made from feature branches': function (pull) {
+ assert.notEqual(pull.head.ref, 'master')
+ },
+
+ 'should always include a unit test if changing js files': function (pull) {
+ var hasJS = false
+ var hasTests = false
+
+ pull.files.forEach(function (file) {
+ if (/^js\/[^./]+.js/.test(file.filename)) hasJS = true
+ if (/^js\/tests\/unit\/[^.]+.js/.test(file.filename)) hasTests = true
+ })
+
+ assert.ok(!hasJS || hasJS && hasTests)
+ },
+
+ 'after': function (pull) {
+ if (pull.reporter.stats.failures) {
+ pull.reportFailures(pull.close.bind(pull))
+ }
+ }
+
+ },
+
+ 'issues': {
+
+ 'before': function (issue) {
+ var plus = {}
+ var labels = issue.labels.map(function (label) { return label.name });
+
+ if (~labels.indexOf('popular')) return
+
+ issue.comments.forEach(function (comment) {
+ if (/\+1/.test(comment.body)) plus[comment.user.login] = true
+ })
+
+ if (Object.keys(plus).length > 5) {
+ issue.tag('popular')
+ issue.comment('Tagging this issue as popular, please stop commenting on this issue with +1. thanks!')
+ }
+ },
+
+ 'should include a jsfiddle/jsbin illustrating the problem if tagged with js but not a feature': function (issue) {
+ var labels = issue.labels.map(function (label) { return label.name });
+ if (~labels.indexOf('js') && !~labels.indexOf('feature')) assert.ok(/(jsfiddle|jsbin)/.test(issue.body))
+ },
+
+ 'after': function (issue) {
+ if (issue.reporter.stats.failures) {
+ issue.reportFailures(issue.close.bind(issue))
+ }
+ }
+
+ }
+
+}
@@ -0,0 +1,3 @@
+language: node_js
+node_js:
+ - 0.6
Oops, something went wrong.

0 comments on commit 1425c4f

Please sign in to comment.