Permalink
Browse files

First commit

  • Loading branch information...
0 parents commit bbac12faf3241b5232fa8b1fcc3cd0722c7ec006 @zachwill committed Mar 12, 2012
Showing with 24,355 additions and 0 deletions.
  1. +1 −0 Procfile
  2. +14 −0 README.md
  3. +42 −0 app.py
  4. +7 −0 note.xml
  5. +31 −0 requirements.txt
  6. +643 −0 static/css/bootstrap-responsive.css
  7. +3,682 −0 static/css/bootstrap.css
  8. +772 −0 static/css/docs.css
  9. +28 −0 static/css/less/accordion.less
  10. +70 −0 static/css/less/alerts.less
  11. +62 −0 static/css/less/bootstrap.less
  12. +22 −0 static/css/less/breadcrumbs.less
  13. +148 −0 static/css/less/button-groups.less
  14. +183 −0 static/css/less/buttons.less
  15. +121 −0 static/css/less/carousel.less
  16. +18 −0 static/css/less/close.less
  17. +57 −0 static/css/less/code.less
  18. +18 −0 static/css/less/component-animations.less
  19. +130 −0 static/css/less/dropdowns.less
  20. +522 −0 static/css/less/forms.less
  21. +8 −0 static/css/less/grid.less
  22. +20 −0 static/css/less/hero-unit.less
  23. +32 −0 static/css/less/labels.less
  24. +17 −0 static/css/less/layouts.less
  25. +590 −0 static/css/less/mixins.less
  26. +83 −0 static/css/less/modals.less
  27. +299 −0 static/css/less/navbar.less
  28. +353 −0 static/css/less/navs.less
  29. +30 −0 static/css/less/pager.less
  30. +55 −0 static/css/less/pagination.less
  31. +49 −0 static/css/less/popovers.less
  32. +95 −0 static/css/less/progress-bars.less
  33. +126 −0 static/css/less/reset.less
  34. +327 −0 static/css/less/responsive.less
  35. +29 −0 static/css/less/scaffolding.less
  36. +158 −0 static/css/less/sprites.less
  37. +150 −0 static/css/less/tables.less
  38. +35 −0 static/css/less/thumbnails.less
  39. +35 −0 static/css/less/tooltip.less
  40. +218 −0 static/css/less/type.less
  41. +23 −0 static/css/less/utilities.less
  42. +107 −0 static/css/less/variables.less
  43. +17 −0 static/css/less/wells.less
  44. +13 −0 static/css/main.less
  45. BIN static/favicon.ico
  46. BIN static/img/glyphicons-halflings-white.png
  47. BIN static/img/glyphicons-halflings.png
  48. BIN static/img/octocat.png
  49. +106 −0 static/js/README.md
  50. +10 −0 static/js/application.js
  51. +94 −0 static/js/bootstrap-alert.js
  52. +100 −0 static/js/bootstrap-button.js
  53. +157 −0 static/js/bootstrap-carousel.js
  54. +136 −0 static/js/bootstrap-collapse.js
  55. +92 −0 static/js/bootstrap-dropdown.js
  56. +210 −0 static/js/bootstrap-modal.js
  57. +95 −0 static/js/bootstrap-popover.js
  58. +125 −0 static/js/bootstrap-scrollspy.js
  59. +130 −0 static/js/bootstrap-tab.js
  60. +270 −0 static/js/bootstrap-tooltip.js
  61. +51 −0 static/js/bootstrap-transition.js
  62. +271 −0 static/js/bootstrap-typeahead.js
  63. +4 −0 static/js/jquery.js
  64. +16 −0 static/js/less.js
  65. +1,265 −0 static/js/modernizr.js
  66. +49 −0 static/js/tests/index.html
  67. +41 −0 static/js/tests/unit/bootstrap-alert.js
  68. +77 −0 static/js/tests/unit/bootstrap-button.js
  69. +25 −0 static/js/tests/unit/bootstrap-collapse.js
  70. +53 −0 static/js/tests/unit/bootstrap-dropdown.js
  71. +85 −0 static/js/tests/unit/bootstrap-modal.js
  72. +93 −0 static/js/tests/unit/bootstrap-popover.js
  73. +31 −0 static/js/tests/unit/bootstrap-scrollspy.js
  74. +45 −0 static/js/tests/unit/bootstrap-tab.js
  75. +62 −0 static/js/tests/unit/bootstrap-tooltip.js
  76. +13 −0 static/js/tests/unit/bootstrap-transition.js
  77. +128 −0 static/js/tests/unit/bootstrap-typeahead.js
  78. +9,252 −0 static/js/tests/vendor/jquery.js
  79. +232 −0 static/js/tests/vendor/qunit.css
  80. +1,510 −0 static/js/tests/vendor/qunit.js
  81. +4 −0 static/robots.txt
  82. +74 −0 templates/base.html
  83. 0 templates/footer.html
  84. 0 templates/header.html
  85. +9 −0 templates/home.html
@@ -0,0 +1 @@
+web: gunicorn -w 4 -b 0.0.0.0:$PORT -k gevent app:app
@@ -0,0 +1,14 @@
+relaxml -- gut edition
+======================
+
+A [`gut`
+implementation](http://maxogden.com/#blog/gut-hosted-open-data-filets)
+of the [`relaxml` Python library](https://github.com/zachwill/relaxml).
+
+You can start up the server from the command line:
+
+ python app.py
+
+And to test it out:
+
+ curl -X POST http://localhost:5000 -H "X-callback: http://www.postbin.org/yc0zqh" --data-binary @note.xml
42 app.py
@@ -0,0 +1,42 @@
+"""
+Flask Documentation: http://flask.pocoo.org/docs/
+Jinja2 Documentation: http://jinja.pocoo.org/2/documentation/
+Werkzeug Documentation: http://werkzeug.pocoo.org/documentation/
+
+This file creates your application.
+"""
+
+from flask import Flask, render_template, request
+
+import requests as req
+from relaxml import xml
+from simplejson import dumps
+
+
+app = Flask(__name__)
+
+
+@app.route('/', methods=['GET', 'POST'])
+def home():
+ """Render website's home page."""
+ if request.method == 'POST':
+ files = request.form.items()
+ try:
+ # Not sure why Flask is splitting them apart?
+ data = '='.join(files[0])
+ except:
+ return 'No file received.'
+ try:
+ content = xml(data)
+ except Exception as error:
+ content = {"error": str(error)}
+ json = dumps(content)
+ if 'X-callback' in request.headers:
+ callback = request.headers['X-callback']
+ req.post(callback, data=json)
+ return json
+ return render_template('home.html')
+
+
+if __name__ == '__main__':
+ app.run(debug=True)
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<note>
+ <to>server</to>
+ <from>me</from>
+ <heading>Convert this XML</heading>
+ <body>And I'd prefer it done really fast.</body>
+</note>
@@ -0,0 +1,31 @@
+# ----------------------
+# Flask
+# ----------------------
+flask
+
+
+# ----------------------
+# XML
+# ----------------------
+lxml
+relaxml
+simplejson
+
+
+# ----------------------
+# HTTP
+# ----------------------
+requests
+
+
+# ----------------------
+# Testing
+# ----------------------
+mock
+
+
+# ----------------------
+# Production Server
+# ----------------------
+gevent
+gunicorn
Oops, something went wrong.

0 comments on commit bbac12f

Please sign in to comment.