Adam Gomaa avatar Adam Gomaa committed df84c6f Draft

kill dash stuff, moved to libakg. Rest will follow.

Comments (0)

Files changed (8)

propaneweb/__init__.py

 from faf import app as faf_app
 from libakg.z import app as zapp
 from libakg.logview import app as logview_app
+from libakg.dash import App as DashApp
 from libakg.memo import app as memo_app
 from libakg.memo2 import app as memo2_app
+from libakg.memo3 import app as memo3_app
 from libakg.webdirstat import app as wdir_app
 from notedir import app as notedir_app
 from timeline import app as timeline_app
 
 dj_app = WSGIHandler()
 
+from propaneweb import _dash
+
 app = DispatcherMiddleware(dj_app, {
         "/faf": faf_app,
         "/logview": logview_app,
         "/memo": memo_app,
         "/memo2": memo2_app,
+        "/memo3": memo3_app,
         "/music": music_app,
         "/notes": notedir_app,
         "/writing": writing_app,
         "/vcms": vcms_app,
         "/wdir": wdir_app,
         "/z": zapp,
+        "/fitdash": DashApp(dash=_dash.fitdash()),
+        "/dash": DashApp(dash=_dash.mydash()),
 })
 
 from .private import wrap_app

propaneweb/settings.py

     'django.contrib.messages',
     'django.contrib.admin',
     'django.contrib.admindocs',
-    'focuslog',
 )
 
 SESSION_COOKIE_NAME = "propaneweb_session"

propaneweb/templates/base.html

 <!DOCTYPE html>
 <html>
 <head>
+{% block head %}
   <title>{% block head_title %}propaneweb{% endblock %}</title>
   {% block head_css %}{% endblock %}
 <style type="text/css">{% block inline_css %}
 {% endblock %}</style>
   {% block head_js %}{% endblock %}
 
-</head>
+{% endblock %}</head>
 <body>
 {% block body %}{% endblock %}
 {% block end_js %}{% endblock %}

propaneweb/templates/dash.css

-body{background-color:#000;color:#fff;}
-.favicon-bookmarks{margin:0px;clear:both;}
-.favicon-bookmarks a{
-    display: block;
-    width: 60px;
-    height: 60px;
-    margin: 5px;
-    float: left;
-    border: solid #888 1px;
-    text-align: center;
-    line-height: 60px;
-    font-size: 30px;
-    color: #fff;
-    text-decoration: none;
-    overflow:hidden;
-}
-.favicon-bookmarks a:hover
-{
-    background-color: #333;
-}
-.favicon-bookmarks a img{
-    vertical-align: middle;
-    max-width: 60px;
-}

propaneweb/templates/dash.html

-{% extends "base.html" %}
-
-{% block end_js %}{{ super() }}
-{% endblock %}
-
-{% block inline_js %}{{ super() }}
-{% endblock %}
-
-{% block inline_css %}{{ super() }}
-{{ static("dash.css") }}
-{% endblock %}
-
-
-{% block body %}
-<div class="favicon-bookmarks">
-{# google #}<A HREF="https://www.google.com/"><img src="/2012-03-06/google-icon.png"></A>
-<a href="https://duckduckgo.com/">D</A>
-{# wikipedia #}<A HREF="http://en.wikipedia.org/"><img src="/2012-03-06/wikipedia-icon.png"></A>
-{# trello #}{#<A HREF="https://trello.com/"><img src="/2012-03-06/trello-icon.png"></A>}#}
-{# read.amazon.com #}<A HREF="https://read.amazon.com/"><img src="/2012-03-06/kindle-icon.png"></A>
-
-{# stackoverflow #}<A HREF="http://stackoverflow.com/"><img src="/2012-03-06/stackoverflow-icon.png"></A>
-
-{# adam.gomaa.us #}<A HREF="http://adam.gomaa.us/"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABc0lEQVQ4jY2Sr6vCUBTHv5PLEAWDQw0aDGJbMFhEjIKaNa37F1k0LFxsFhdsKoLJYDArFmFFxOTWvi+8t73nvD73gQuXw+F7vueHRpL4oVKpAACOxyOiaJqmvQQBJILPZrMBSei6ju12q8pVogUOhsMhSqUSdF3H6XTCeDyO5QAk6XkeDcPg+Xzm5XKhYRj0PI9R3rbgOA5M00S5XEaxWEStVsN8PlcWUwZ7vR5t2w4rSSnZ7XZfHKiA67oUQhDA0xNC0HXdjwKJyWSCwWAAkk/PsixMp9PQ6X6/R6fTQSaTQTKZRL1eh5QSqFarXCwWL8qr1YqmaZIkD4cDC4UCbdvm7Xbj4/Hger1mu90m4vTZ7/c5Go3UM4gjkMvl3s4jPKT/EELA930IIYKj+r0DTUFUIJvN4nq9/l09grqJaLKKZrMJx3HipIYVntjtdszn85RS8n6/0/d9LpfL4GY+C5Dfa221Wkyn00ylUmw0GpzNZvwCWwTHXsMQPtEAAAAASUVORK5CYII="></A>
-
-{# ycnews #}<A HREF="http://news.ycombinator.com/"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAkUlEQVQ4jWP8n8bwn4ECwESJZhoZMPM/A8PM/wzfVXSxihM04NemEgYGBgYGZnU3hJh3MYocXgPYtvZCaKNwhBiUDZNDBiwYIgwMDD8XRTCwx62A28wmYwoRw6KWEWc01p5iYJAxhbCfnGZgaDbDqgxnLPw6txIrm3gXMDAgQj2dEaeSwZiQSAT4w4AeLqDYAACDty1YU1Le0AAAAABJRU5ErkJggg=="></A>
-{# reddit #}<A HREF="http://www.reddit.com/"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACaklEQVQ4jaWT3UsTYBSHH7e5Zpu5+cVGH6ZTE8QYQSIqyzIpJWgRYYYGoViZyPRCCyK6STOIoMg/ICLICd4EgVLYh0hJojE3sylZ2YxNNtzaZDrfLkaz/LiofnAuDuf3Ppz3PeeNsXmF4D8kA/DMB//psCYpLgLYSFKpjGDAz70bbSSlatHvyWby/SiSJT/arH2Un6wBQLIZIBxe5t3QAPEJao6ajmG32lnxzdF19zYjr/uivnUAmSyWrUoFAFMTVo4cr0K7I4/65quo0/Korm3g8ImaVf9awJzzK44P47i/Oxnoe8K2xFT8gSA5uXs5da4JmVzBcmgx6o951P9GPH38AE2KjphYBT/cM2Trd7M9NZkEtQaXy4Xj8xc+zXwjeWc2YmkRj8tJeeVZDPvzodHcKqYdk8JYXCg6O9qFL+AXKysr68IX8IvOjnZhLC4U045J0WhuFTavENKDpWXXhwZfUnn6DLV1dch7LGA0QnER7EqDwVdgMCDX6ym6cBG1JhGLxUKcchuGohIkupwCbPYJTCZT5FIqFWSkg1IZyZXKSK5SAWAymbDZJ9DlFETqNq8QTeaWDdveLJrMLWJwKiBsXiEkWxSCWbePsZHh6Mt2W3qwWq0sLCxgtVrptvREa2Mjw8y6fb+NUUDV+RbarrVxufkSJaVl6DPS6e3tJRwOI5VKqaioAGDgWT8379yn/krn6hhtXiE880HcLicPu26REh9L2aEDZGZmIpfLCYVCOBwO+p+/wOVborqhleQUHRD5C1HAL01/nGB89C0e1xzLoUVkcgWaFC25hnwysnL+WLooYO02/o1+AscvMnKl2CfkAAAAAElFTkSuQmCC"></A>
-{# google plus #}<A HREF="https://plus.google.com/?hl=en"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACkElEQVQ4jZWSS0hUcRTGf/87d8bRmUzHMkmRjMzKV0SWZU+hqFYStRCEKHquKjBoURERBRpEkEgLo0UYFEEGIRq9s9cma0wdo1SCHqRM2ogz3rn/02JqUJTAA9/ig3O+8/iOerQy67DAIaVUHtMIEQkoqFcPVmR25xQuyXO5E6ZTz1g4Qq+/M2A6Umfl+XYewFtajmNm6qTEwcZ6Bq/XAWB4vCy49YqebQUopxMblWeWXL1L5FeQ27srUO4kVh89SWbJat7fuErbhdPM8ySQ43EBYGsBQIvA2Bi2CIZjRgova08xf/g72T8+03ZsH6PBQYoq97BpWRHZiSa21nHEhP5yEUwB5lgjOBWgIFdZ9D9pZVFFJTorB7vvI0X3AxPWym/pAmBhaBgTIDEjk8i3/niCw4oAEPzSj0trLhXPBSDBm8zBtu44/xkKY1rhMOnbd9H/7jViWZjJKWRt2ELf80eMdvtxmAZlqYkx65JiTv3jn5SN+azhMtuOn8F7rYWRrnaSl6/la0c7T6r3sshFfG8AGXcDgKgWVE1uimSXbSR/awX5O6qIRsI0lhexwLAw1ERLoyK8CoZZ44tN0PNrBMPnNPB+eE3nlVq01hhOF0tLShDRE65va40SYVVKQpxHRTCiWvAqyErz8a3jLVrbLK5pIKNyP7at/4uoFtSnh82SWbqeaOg3wS+9JM3OwDMrPfaFj5sJnD2CWNaU79w1NIo5FBqhqbyY8OAAbgPE7WHjifMs3lqBb91msvdW01t3bkoBWwSHq625qtgx5pvndpDuNEjDxt96D+2dSUZ+MTrRw4871xGRCRi1NQMRy2/ONeXi51DkoFKqcLz6m6abpBUs5eOLpwSGw5O6i4gfqP8DLH1Hq3SXndMAAAAASUVORK5CYII="></A>
-{# lesswrong #}<A HREF="http://lesswrong.com/"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAB+klEQVQ4jdWRXUhTYQCG3/PtLGc5nWuzcXI4MBkJBiNJkMYKNeiHfogIpJsKupDsYlTX3XRlXVgXQRRE0bowyFAi6GeoQ7PEWbYfKmUytrNpZ7uwbWef5/tOVwvqqt3Vc/nC+/DCC/z3CNFodCCvKJ2VwNa0ddrtbr/3twJisVge6LouLC0vnWVsw2Q2WwLVLCCSJBXt22xBzjlsTY63kiQVqxGIAKDrhDNNgyAIv8qLmWfnk+uzB3XosNW6w13N566/Sgzd7nNdGZxLP/JnC5HuWqM1QwCAMQZKKQghrCLocJy4v1ZKt8RzkydddT1Pvubf+95lnl4MZ18fXw7VDC8oU4edDXtHCACAc9ByGYyx3+Y5zL2BlMownw8de5EavfCtpON5cmSw1efoLcKaaGvsnhABgDMGVVVBKd1UKSuKUp/ZUKbjhTv8R+pNf6qUdtlNHbPB7Md9GY2gy3okAIyBAACl1KiqKrKy3F4RLMzPXSX58nbTlt0zwe8rnTsafeOHnKduJbXNJLga9/rsfQ8BQAiHw/0zU5OXZVn2cMa5QRRVTdOMBoPBcMnvdz5emzh97fPdGy/3D+8RVwqfzshDibb65viY72YPAAixWOwApdT85z0C52yXxzOay+UaQusR79EW7zgAfFiNeOoEU2GnvfVLNXf/w/wE+ZPetkHBR7wAAAAASUVORK5CYII="></A>
-{# khan academy #}<A HREF="http://www.khanacademy.org/"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAANCAYAAACgu+4kAAABhklEQVQokZWPTUhUYRiFn/Pd68+kZMwqCdqWuiuLBgkhAoObRLt20ThQtEtaRJsGWhQFbcOoCNyNtahgVi5czUQi1K4giCAQCkJCNNL5TgsZEL0jdHbvz/Oe84oOmnl1fDAUeoaEx2WOgQ6C+yRWDd8VvRQDC9oJPnlzYiRJkutIl4SKnQwAbH9L20W1NtJ9eN/+Ww66LejZC2xL4lMK8KhWKgz0MYeU7Yq0h2KkllarhAP9PAZl/8FivBHYXAiHRk+OgS7nL7Fs+Jkb36qXzy9+DSGkV3PQH0TfibE1Cc49APEe4IApbQNt8+JPXD3awnNBYVZoOMfgbTl79x4gCIpbKB9bLZ+ZyhpXuuk/mwQtShrahdprcYPprQ8hNf5s06hkzWmA5/XSQ9DN/NhgdK1yofGlXae//66fu3Hxw8qz16NH6OqaAY13gqN5UMkas9t7AnhaPzUWCPNAb66rvQbcncqa93fOEoDTE8Vfhd50SdKA7RRhYB1rWfK8NylXJpsv847/A7RYjVoH+KjEAAAAAElFTkSuQmCC"></A>
-<a href="http://ddg.gg/?q=weather 28211">Wx</a>
-<a href="http://www.fitocracy.com/">FT</a>
-{# newsblur #}<A HREF="http://newsblur.com/">NB</A>
-</div>
-
-<div class="favicon-bookmarks">
-{# jenkins #}<a href="http://3sdv.com:8080/">J</a>
-<a href="https://mail.google.com/">3s</A>
-<a href="https://3smobile.flowdock.com/flows/main#/influx/all"><img src="/2012-03-06/flowdock-icon.png"></a>
-<a href="https://www.pivotaltracker.com/projects/227033"><img src="/2012-03-06/pivotal-icon.png"></a>
-{# 3smobile github #}<a href="https://github.com/3smobile/farmforce">GH</a>
-{# branches #}<a href="https://github.com/3smobile/farmforce/network/members">GHb</a>
-{# pull requests #}<a href="https://github.com/3smobile/farmforce/pulls">PR</a>
-{# my pull requests #}<a href="https://github.com/3smobile/farmforce/pulls/AdamG">mPR</a>
-<a href="http://test.3smobile.3sdv.com/">Tm</a>
-<a href="http://testpg.3smobile.3sdv.com/">Tp</a>
-<a href="http://sandbox.3smobile.3sdv.com/">Ts</a>
-<a href="http://test.adamg.3sdv.com/">Ta</a>
-<a href="http://3sdv.com:4444/console">Se</a>
-</div>
-
-<div class="favicon-bookmarks">
-<A HREF="/notes/">N</A>
-<A HREF="http://localhost:9001/">S</A>
-<A HREF="/music/">mu</A>
-<A HREF="/memo2/">m2</A>
-<A HREF="/logview/">lg</A>
-<A HREF="dwb:settings">dwb</A>
-<a href="/wdir/">wdr</a>
-</div>
-
-{% endblock body %}

propaneweb/templates/index.html

 
 {% block body %}
 Welcome to propaneweb, {{ request.user }}!
+<br>
+Here's where you actually want to be:
+<br><a href="http://{{ request.get_host() }}:8000/">http://{{ request.get_host() }}:8000/</a>
 {% endblock body %}

propaneweb/urls.py

-from django.conf.urls.defaults import *
+from django.conf.urls.defaults import patterns, url, include
 
-from django.conf import settings
 
 
-# Uncomment the next two lines to enable the admin:
-from django.contrib import admin
-admin.autodiscover()
-
 urlpatterns = patterns(
     'propaneweb.views',
     url(r'^accounts/login/', 'login'),
     url(r'^$', 'index', {}),
     url(r'^do/bbping', 'do_bbping', {}),
     url(r'^meta', 'meta', {}),
-    url(r'^dash/(.*)$', 'dash', {}),
 )

propaneweb/views.py

 import propaneweb.shortcuts as ps
 
-@ps.login_required
 def index(request):
     return ps.render(request, "index.html")
 
-@ps.login_required
-def dash(request, path=''):
-    def _static(fname):
-        from jinja2 import Markup
-        return Markup(open(ps.util.package_path("templates/{0}".format(fname))).read())
-
-    return ps.render(request, "dash.html", {"static": _static})
-
-
 def login(request):
     "Handle login form & POST"
     from django.contrib.auth import authenticate, login as auth_login
 
     return ps.render(request, "login.html")
 
-
-def do_bbping(request):
-    "Callback for BitBucket's POST service to push CS code."
-    if request.method == "POST":
-        # script that does the heavy lifting, can't have this process
-        # hang while that happens
-        ps.util._subprocess_helper(["ag-bb-ping.sh"])
-        return ps.HttpResponseRedirect(request.get_full_path())
-    return ps.HttpResponse("go away, this isn't for humans")
-
-
 def meta(request):
     "Show some meta info for debugging"
     rows = []
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.