Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Intial Import

  • Loading branch information...
commit 61aace109cef3147b54d95bca4a57a005e59ecdd 0 parents
@davglass davglass authored
3  .gitignore
@@ -0,0 +1,3 @@
+*.egg-info
+build
+dist
29 LICENSE
@@ -0,0 +1,29 @@
+Software License Agreement (BSD License)
+
+Copyright (c) 2008, Dav Glass <davglass@gmail.com>.
+All rights reserved.
+
+Redistribution and use of this software in source and binary forms, with or without modification, are
+permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above
+ copyright notice, this list of conditions and the
+ following disclaimer.
+
+* Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the
+ following disclaimer in the documentation and/or other
+ materials provided with the distribution.
+
+* The name of Dav Glass may not be used to endorse or promote products
+ derived from this software without specific prior
+ written permission of Dav Glass.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1  README
@@ -0,0 +1 @@
+More coming soon..
1  dashboard/__init__.py
@@ -0,0 +1 @@
+from dashboard import Dashboard
77 dashboard/dashboard.py
@@ -0,0 +1,77 @@
+from trac.core import *
+from pkg_resources import resource_filename
+from trac.config import Option, IntOption, ListOption, BoolOption
+from trac.web.api import IRequestHandler, Href
+from trac.util.translation import _
+from trac.web.chrome import add_stylesheet, add_script, INavigationContributor, ITemplateProvider
+import datetime
+from trac.web.chrome import Chrome
+from trac.util.datefmt import utc, to_timestamp
+from genshi.template import TemplateLoader
+from genshi.filters.transform import Transformer
+from trac.web.api import ITemplateStreamFilter
+from trac.perm import IPermissionRequestor
+
+
+
+
+class DashBoard(Component):
+ implements(IRequestHandler, ITemplateProvider, IPermissionRequestor)
+
+ permission = ListOption('dashboard', 'permission', '')
+
+
+ def __init__(self):
+ self.db = self.env.get_db_cnx()
+ self.perm = self.config.get('dashboard', 'permission', '').upper()
+
+ if not self.perm:
+ self.perm = 'DASHBOARD_VIEW'
+
+ self.env.log.debug("Using Permission: %s" % self.perm)
+
+
+ def get_permission_actions(self):
+ yield self.perm
+
+
+ # IRequestHandler methods
+ def match_request(self, req):
+ serve = False
+ self.env.log.debug("Match Request")
+
+
+ uri = req.path_info.lstrip('/').split('/')
+ if uri[0] == 'dashboard':
+ serve = True
+
+ self.env.log.debug("Handle Request: %s" % serve)
+ self.baseURL = req.href('dashboard', '/')
+ self.baseQueryURL = req.href('query', '/')
+ if not self.perm in req.perm:
+ self.env.log.debug("NO Permission to view")
+ return False
+
+ return serve
+
+
+ def process_request(self, req):
+ data = {}
+
+ add_script(req, "dashboard/dashboard.js")
+ add_stylesheet(req, "dashboard/dashboard.css")
+ return 'dashboard.html', data, None
+
+
+ def get_htdocs_dirs(self):
+ """Return the absolute path of a directory containing additional
+ static resources (such as images, style sheets, etc).
+ """
+ return [('dashboard', resource_filename(__name__, 'htdocs'))]
+
+ def get_templates_dirs(self):
+ """Return the absolute path of the directory containing the provided
+ genshi templates.
+ """
+ rtn = [resource_filename(__name__, 'templates')]
+ return rtn
9 dashboard/htdocs/dashboard.css
@@ -0,0 +1,9 @@
+/*
+ * Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+ * Code licensed under the BSD License:
+ * http://developer.yahoo.net/yui/license.txt
+ * version: 2.6.0
+ * */
+#ft{clear:both;}#doc,#doc2,#doc3,#doc4,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7{margin:auto;text-align:left;width:57.69em;*width:56.25em;min-width:750px;}#doc2{width:73.076em;*width:71.25em;}#doc3{margin:auto 10px;width:auto;}#doc4{width:74.923em;*width:73.05em;}.yui-b{position:relative;}.yui-b{_position:static;}#yui-main .yui-b{position:static;}#yui-main,.yui-g .yui-u .yui-g{width:100%;}{width:100%;}.yui-t1 #yui-main,.yui-t2 #yui-main,.yui-t3 #yui-main{float:right;margin-left:-25em;}.yui-t4 #yui-main,.yui-t5 #yui-main,.yui-t6 #yui-main{float:left;margin-right:-25em;}.yui-t1 .yui-b{float:left;width:12.30769em;*width:12.00em;}.yui-t1 #yui-main .yui-b{margin-left:13.30769em;*margin-left:13.05em;}.yui-t2 .yui-b{float:left;width:13.8461em;*width:13.50em;}.yui-t2 #yui-main .yui-b{margin-left:14.8461em;*margin-left:14.55em;}.yui-t3 .yui-b{float:left;width:23.0769em;*width:22.50em;}.yui-t3 #yui-main .yui-b{margin-left:24.0769em;*margin-left:23.62em;}.yui-t4 .yui-b{float:right;width:13.8456em;*width:13.50em;}.yui-t4 #yui-main .yui-b{margin-right:14.8456em;*margin-right:14.55em;}.yui-t5 .yui-b{float:right;width:18.4615em;*width:18.00em;}.yui-t5 #yui-main .yui-b{margin-right:19.4615em;*margin-right:19.125em;}.yui-t6 .yui-b{float:right;width:23.0769em;*width:22.50em;}.yui-t6 #yui-main .yui-b{margin-right:24.0769em;*margin-right:23.62em;}.yui-t7 #yui-main .yui-b{display:block;margin:0 0 1em 0;}#yui-main .yui-b{float:none;width:auto;}.yui-gb .yui-u,.yui-g .yui-gb .yui-u,.yui-gb .yui-g,.yui-gb .yui-gb,.yui-gb .yui-gc,.yui-gb .yui-gd,.yui-gb .yui-ge,.yui-gb .yui-gf,.yui-gc .yui-u,.yui-gc .yui-g,.yui-gd .yui-u{float:left;}.yui-g .yui-u,.yui-g .yui-g,.yui-g .yui-gb,.yui-g .yui-gc,.yui-g .yui-gd,.yui-g .yui-ge,.yui-g .yui-gf,.yui-gc .yui-u,.yui-gd .yui-g,.yui-g .yui-gc .yui-u,.yui-ge .yui-u,.yui-ge .yui-g,.yui-gf .yui-g,.yui-gf .yui-u{float:right;}.yui-g div.first,.yui-gb div.first,.yui-gc div.first,.yui-gd div.first,.yui-ge div.first,.yui-gf div.first,.yui-g .yui-gc div.first,.yui-g .yui-ge div.first,.yui-gc div.first div.first{float:left;}.yui-g .yui-u,.yui-g .yui-g,.yui-g .yui-gb,.yui-g .yui-gc,.yui-g .yui-gd,.yui-g .yui-ge,.yui-g .yui-gf{width:49.1%;}.yui-gb .yui-u,.yui-g .yui-gb .yui-u,.yui-gb .yui-g,.yui-gb .yui-gb,.yui-gb .yui-gc,.yui-gb .yui-gd,.yui-gb .yui-ge,.yui-gb .yui-gf,.yui-gc .yui-u,.yui-gc .yui-g,.yui-gd .yui-u{width:32%;margin-left:1.99%;}.yui-gb .yui-u{*margin-left:1.9%;*width:31.9%;}.yui-gc div.first,.yui-gd .yui-u{width:66%;}.yui-gd div.first{width:32%;}.yui-ge div.first,.yui-gf .yui-u{width:74.2%;}.yui-ge .yui-u,.yui-gf div.first{width:24%;}.yui-g .yui-gb div.first,.yui-gb div.first,.yui-gc div.first,.yui-gd div.first{margin-left:0;}.yui-g .yui-g .yui-u,.yui-gb .yui-g .yui-u,.yui-gc .yui-g .yui-u,.yui-gd .yui-g .yui-u,.yui-ge .yui-g .yui-u,.yui-gf .yui-g .yui-u{width:49%;*width:48.1%;*margin-left:0;}.yui-g .yui-g .yui-u{width:48.1%;}.yui-g .yui-gb div.first,.yui-gb .yui-gb div.first{*margin-right:0;*width:32%;_width:31.7%;}.yui-g .yui-gc div.first,.yui-gd .yui-g{width:66%;}.yui-gb .yui-g div.first{*margin-right:4%;_margin-right:1.3%;}.yui-gb .yui-gc div.first,.yui-gb .yui-gd div.first{*margin-right:0;}.yui-gb .yui-gb .yui-u,.yui-gb .yui-gc .yui-u{*margin-left:1.8%;_margin-left:4%;}.yui-g .yui-gb .yui-u{_margin-left:1.0%;}.yui-gb .yui-gd .yui-u{*width:66%;_width:61.2%;}.yui-gb .yui-gd div.first{*width:31%;_width:29.5%;}.yui-g .yui-gc .yui-u,.yui-gb .yui-gc .yui-u{width:32%;_float:right;margin-right:0;_margin-left:0;}.yui-gb .yui-gc div.first{width:66%;*float:left;*margin-left:0;}.yui-gb .yui-ge .yui-u,.yui-gb .yui-gf .yui-u{margin:0;}.yui-gb .yui-gb .yui-u{_margin-left:.7%;}.yui-gb .yui-g div.first,.yui-gb .yui-gb div.first{*margin-left:0;}.yui-gc .yui-g .yui-u,.yui-gd .yui-g .yui-u{*width:48.1%;*margin-left:0;} .yui-gb .yui-gd div.first{width:32%;}.yui-g .yui-gd div.first{_width:29.9%;}.yui-ge .yui-g{width:24%;}.yui-gf .yui-g{width:74.2%;}.yui-gb .yui-ge div.yui-u,.yui-gb .yui-gf div.yui-u{float:right;}.yui-gb .yui-ge div.first,.yui-gb .yui-gf div.first{float:left;}.yui-gb .yui-ge .yui-u,.yui-gb .yui-gf div.first{*width:24%;_width:20%;}.yui-gb .yui-ge div.first,.yui-gb .yui-gf .yui-u{*width:73.5%;_width:65.5%;}.yui-ge div.first .yui-gd .yui-u{width:65%;}.yui-ge div.first .yui-gd div.first{width:32%;}#bd:after,.yui-g:after,.yui-gb:after,.yui-gc:after,.yui-gd:after,.yui-ge:after,.yui-gf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}#bd,.yui-g,.yui-gb,.yui-gc,.yui-gd,.yui-ge,.yui-gf{zoom:1;}
+
+
0  dashboard/htdocs/dashboard.js
No changes.
22 dashboard/templates/dashboard.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:py="http://genshi.edgewall.org/"
+ xmlns:xi="http://www.w3.org/2001/XInclude">
+ <xi:include href="layout.html" />
+ <xi:include href="macros.html" />
+
+<head>
+ <title>Developer Dashboard</title>
+ <script type="text/javascript" py:choose="">
+ $(document).ready(function() {
+ $("div.description").find("h1,h2,h3,h4,h5,h6").addAnchor("Link to this section");
+ });
+ </script>
+</head>
+<body>
+<h1>Developer Dashboard</h1>
+
+</body>
+</html>
3  dev.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+sudo python setup.py install && sudo /etc/init.d/apache2 force-reload
+
28 setup.py
@@ -0,0 +1,28 @@
+from setuptools import find_packages, setup
+
+# name can be any name. This name will be used to create .egg file.
+# name that is used in packages is the one that is used in the trac.ini file.
+# use package name as entry_points
+
+setup(
+ name='Trac-Dashboard',
+ version='0.1',
+ author='Dav Glass',
+ author_email='davglass@gmail.com',
+ description = "Creates a developer dashboard.",
+ license = """BSD""",
+ url = "http://github.com/davglass/trac-dashboard/tree/master",
+ packages = find_packages(exclude=['*.tests*']),
+ package_data={'dashboard': ['templates/*.html', 'htdocs/*']},
+
+ install_requires = [
+ '',
+ ],
+ entry_points = {
+ 'trac.plugins': [
+ 'dashboard = dashboard',
+
+ ]
+ }
+
+)
Please sign in to comment.
Something went wrong with that request. Please try again.