From 60b9cd535cd0c8cacdfe178463f9b8d280479e0f Mon Sep 17 00:00:00 2001 From: Andrew Gerrand Date: Fri, 18 Jan 2013 13:47:01 +1100 Subject: [PATCH] misc/dashboard/godashboard: delete This code is obsolete and unmaintained. R=bradfitz CC=golang-dev https://golang.org/cl/7135056 --- misc/dashboard/godashboard/app.yaml | 15 -- misc/dashboard/godashboard/const.py | 7 - misc/dashboard/godashboard/index.yaml | 51 ------ misc/dashboard/godashboard/project-edit.html | 45 ------ misc/dashboard/godashboard/project-notify.txt | 9 -- misc/dashboard/godashboard/project.html | 74 --------- misc/dashboard/godashboard/project.py | 151 ------------------ misc/dashboard/godashboard/static/favicon.ico | Bin 785 -> 0 bytes misc/dashboard/godashboard/static/style.css | 136 ---------------- misc/dashboard/godashboard/toutf8.py | 14 -- 10 files changed, 502 deletions(-) delete mode 100644 misc/dashboard/godashboard/app.yaml delete mode 100644 misc/dashboard/godashboard/const.py delete mode 100644 misc/dashboard/godashboard/index.yaml delete mode 100644 misc/dashboard/godashboard/project-edit.html delete mode 100644 misc/dashboard/godashboard/project-notify.txt delete mode 100644 misc/dashboard/godashboard/project.html delete mode 100644 misc/dashboard/godashboard/project.py delete mode 100644 misc/dashboard/godashboard/static/favicon.ico delete mode 100644 misc/dashboard/godashboard/static/style.css delete mode 100644 misc/dashboard/godashboard/toutf8.py diff --git a/misc/dashboard/godashboard/app.yaml b/misc/dashboard/godashboard/app.yaml deleted file mode 100644 index ae28924975..0000000000 --- a/misc/dashboard/godashboard/app.yaml +++ /dev/null @@ -1,15 +0,0 @@ -application: godashboard -version: 9 -runtime: python -api_version: 1 - -handlers: -- url: /favicon\.ico - static_files: static/favicon.ico - upload: static/favicon\.ico - -- url: /static - static_dir: static - -- url: /(|project(|/login|/edit)) - script: project.py diff --git a/misc/dashboard/godashboard/const.py b/misc/dashboard/godashboard/const.py deleted file mode 100644 index d92d32aa97..0000000000 --- a/misc/dashboard/godashboard/const.py +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright 2011 The Go Authors. All rights reserved. -# Use of this source code is governed by a BSD-style -# license that can be found in the LICENSE file. - -mail_from = "Go Dashboard " -mail_submit_to = "adg@golang.org" -mail_submit_subject = "New Project Submitted" diff --git a/misc/dashboard/godashboard/index.yaml b/misc/dashboard/godashboard/index.yaml deleted file mode 100644 index f39299d5dc..0000000000 --- a/misc/dashboard/godashboard/index.yaml +++ /dev/null @@ -1,51 +0,0 @@ -indexes: - -- kind: BenchmarkResult - ancestor: yes - properties: - - name: builder - - name: __key__ - direction: desc - -- kind: BenchmarkResult - ancestor: yes - properties: - - name: __key__ - direction: desc - -- kind: BenchmarkResults - properties: - - name: builder - - name: benchmark - -- kind: Commit - properties: - - name: __key__ - direction: desc - -- kind: Commit - ancestor: yes - properties: - - name: __key__ - direction: desc - -- kind: Project - properties: - - name: approved - - name: category - - name: name - -- kind: Project - properties: - - name: category - - name: name - -# AUTOGENERATED - -# This index.yaml is automatically updated whenever the dev_appserver -# detects that a new type of query is run. If you want to manage the -# index.yaml file manually, remove the above marker line (the line -# saying "# AUTOGENERATED"). If you want to manage some indexes -# manually, move them above the marker line. The index.yaml file is -# automatically uploaded to the admin console when you next deploy -# your application using appcfg.py. diff --git a/misc/dashboard/godashboard/project-edit.html b/misc/dashboard/godashboard/project-edit.html deleted file mode 100644 index 8ca5b22a31..0000000000 --- a/misc/dashboard/godashboard/project-edit.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - -
-Name:
-
-Description:
-
-Category:
-
-Tags: (comma-separated)
-
-Web URL:
-
-Approved:
-
- - -
- - - diff --git a/misc/dashboard/godashboard/project-notify.txt b/misc/dashboard/godashboard/project-notify.txt deleted file mode 100644 index f55bf6421b..0000000000 --- a/misc/dashboard/godashboard/project-notify.txt +++ /dev/null @@ -1,9 +0,0 @@ -A new project has been submitted: - -Name: {{project.name}} -Description: {{project.descr}} -URL: {{project.web_url}} - -To edit/approve/delete: -http://godashboard.appspot.com/project/edit?name={{project.name|toutf8|urlencode}} - diff --git a/misc/dashboard/godashboard/project.html b/misc/dashboard/godashboard/project.html deleted file mode 100644 index 2d2429461c..0000000000 --- a/misc/dashboard/godashboard/project.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - Go Projects - - - - - -

Go Projects

- -

- These are external projects and not endorsed or supported by the Go project. -

- -

Projects

- -
-

Submit a Project

-

- Using this form you can submit a project to be included in the list. -

-
- - - {% endif %} -
Name: -
Description: -
URL: -
  - {% if submitMsg %} -
{{ submitMsg }}
-
-
- -

- Filter by tag: - {% if tag %} - all - {% else %} - all - {% endif %} - {% for t in tags %} - {% ifequal t tag %} - {{t}} - {% else %} - {{t}} - {% endifequal %} - {% endfor %} -

- - {% for r in projects %} - {% ifchanged r.category %} - {% if not forloop.first %} - - {% endif %} -

{{r.category}}

- - {% endif %} - {% endfor %} - - - - diff --git a/misc/dashboard/godashboard/project.py b/misc/dashboard/godashboard/project.py deleted file mode 100644 index b13599d5ea..0000000000 --- a/misc/dashboard/godashboard/project.py +++ /dev/null @@ -1,151 +0,0 @@ -# Copyright 2010 The Go Authors. All rights reserved. -# Use of this source code is governed by a BSD-style -# license that can be found in the LICENSE file. - -from google.appengine.api import mail -from google.appengine.api import memcache -from google.appengine.api import users -from google.appengine.ext import db -from google.appengine.ext import webapp -from google.appengine.ext.webapp import template -from google.appengine.ext.webapp.util import run_wsgi_app -import os -import sets - -# local imports -import toutf8 -import const - -template.register_template_library('toutf8') - -class Project(db.Model): - name = db.StringProperty(indexed=True) - descr = db.StringProperty() - web_url = db.StringProperty() - category = db.StringProperty(indexed=True) - tags = db.ListProperty(str) - approved = db.BooleanProperty(indexed=True) - -CacheTimeout = 3600 - -class ProjectPage(webapp.RequestHandler): - - def get(self): - admin = users.is_current_user_admin() - if self.request.path == "/project/login": - self.redirect(users.create_login_url("/project")) - elif self.request.path == "/project/edit" and admin: - self.edit() - else: - self.list() - - def post(self): - if self.request.path == "/project/edit": - self.edit(True) - else: - data = dict(map(lambda x: (x, self.request.get(x)), ["name","descr","web_url"])) - if reduce(lambda x, y: x or not y, data.values(), False): - data["submitMsg"] = "You must complete all the fields." - self.list(data) - return - p = Project.get_by_key_name("proj-"+data["name"]) - if p is not None: - data["submitMsg"] = "A project by this name already exists." - self.list(data) - return - p = Project(key_name="proj-"+data["name"], **data) - p.put() - - path = os.path.join(os.path.dirname(__file__), 'project-notify.txt') - mail.send_mail( - sender=const.mail_from, - to=const.mail_submit_to, - subject=const.mail_submit_subject, - body=template.render(path, {'project': p})) - - self.list({"submitMsg": "Your project has been submitted."}) - - def list(self, additional_data={}): - cache_key = 'view-project-data' - tag = self.request.get('tag', None) - if tag: - cache_key += '-'+tag - data = memcache.get(cache_key) - admin = users.is_current_user_admin() - if admin or not data: - projects = Project.all().order('category').order('name') - if not admin: - projects = projects.filter('approved =', True) - projects = list(projects) - - tags = sets.Set() - for p in projects: - for t in p.tags: - tags.add(t) - - if tag: - projects = filter(lambda x: tag in x.tags, projects) - - data = {} - data['tag'] = tag - data['tags'] = tags - data['projects'] = projects - data['admin']= admin - if not admin: - memcache.set(cache_key, data, time=CacheTimeout) - - for k, v in additional_data.items(): - data[k] = v - - self.response.headers['Content-Type'] = 'text/html; charset=utf-8' - path = os.path.join(os.path.dirname(__file__), 'project.html') - self.response.out.write(template.render(path, data)) - - def edit(self, save=False): - if save: - name = self.request.get("orig_name") - else: - name = self.request.get("name") - - p = Project.get_by_key_name("proj-"+name) - if not p: - self.response.out.write("Couldn't find that Project.") - return - - if save: - if self.request.get("do") == "Delete": - p.delete() - else: - for f in ['name', 'descr', 'web_url', 'category']: - setattr(p, f, self.request.get(f, None)) - p.approved = self.request.get("approved") == "1" - p.tags = filter(lambda x: x, self.request.get("tags", "").split(",")) - p.put() - memcache.delete('view-project-data') - self.redirect('/project') - return - - # get all project categories and tags - cats, tags = sets.Set(), sets.Set() - for r in Project.all(): - cats.add(r.category) - for t in r.tags: - tags.add(t) - - self.response.headers['Content-Type'] = 'text/html; charset=utf-8' - path = os.path.join(os.path.dirname(__file__), 'project-edit.html') - self.response.out.write(template.render(path, { - "taglist": tags, "catlist": cats, "p": p, "tags": ",".join(p.tags) })) - - def redirect(self, url): - self.response.set_status(302) - self.response.headers.add_header("Location", url) - -def main(): - app = webapp.WSGIApplication([ - ('/.*', ProjectPage), - ], debug=True) - run_wsgi_app(app) - -if __name__ == '__main__': - main() diff --git a/misc/dashboard/godashboard/static/favicon.ico b/misc/dashboard/godashboard/static/favicon.ico deleted file mode 100644 index 48854ff3b7225c8b4e8aa8a25754e1d0b7c77b6e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 785 zcmV+s1Md8ZP)5r00004XF*Lt007q5 z)K6G40000PbVXQnQ*UN;cVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBU!qe(a@st@4BKo_oJPzw>?HIhVm0L#Ej6 zcCguOm(QI#dLysUSQM1xW#7b?WhI9coK{!icDucq@rulkmX=oZy1mWeXsEqpG#cQz z^?utRB)7Nn2_^KAYm5|#yEXazMjH4t8k!0_NeXY&iE#p@M7{5k^WvsIwt5X66u zgMz_u`%zcjR>QW&SS(65Ye^9(fMuCu1-f+|cW+i$cI({q=d?f-4KkbL8H||JduEK zWEsv^R+I=c^Vc^Q6f|YEz%UF)-b=4uIMaXYiY0$xaS0d}!L(ln-P#;bsW@OrfJ(`M zqjL}(Z9R?iQmBps*cDKe=-Au$LmfdmOt7Tycmj$y<|dN@QaA~tlBZF^f-Lp@sesL# z=v+{~^TgRR$*YtpDuIysfOkp+VMc;zEC#y#TrZp+NA%AD{$()=e}R z3@I8(`tF+qL{{dnWNKppLokAoTC?UfF*Tt`)9K%C@(KhS0IXFLXxD~r|ta@O^5g7&dyB3xG)uXH!$3b5r40` zx_Z)TwPycJf*@p8yGZo8%QIme`{s}EJpZ7(yZbY-h4gwoy>wZv{T5&Vs0a;<1LtDu P00000NkvXXu0mjff_q_+ diff --git a/misc/dashboard/godashboard/static/style.css b/misc/dashboard/godashboard/static/style.css deleted file mode 100644 index ad7038c3d2..0000000000 --- a/misc/dashboard/godashboard/static/style.css +++ /dev/null @@ -1,136 +0,0 @@ -body { - font-family: sans-serif; - margin: 0; - padding: 0; -} -h1, h2, h3, ul.menu, table, p { - padding: 0 0.5em; -} -h1, h2 { - margin: 0; - background: #eee; -} -h1 { - border-bottom: 1px solid #ccc; - font-size: 1em; - padding: 0.5em; - margin-bottom: 0.5em; - text-align: right; -} -h2 { - border-top: 1px solid #ccc; - padding-left: 0.2em; -} -.submit { - float: right; - border: 1px solid #ccc; - width: 350px; - padding-bottom: 1em; - margin: 0.5em; - background: #eee; -} -.submit table { - width: 100%; -} -.submit input[type=text] { - width: 200px; -} -.submit .msg { - text-align: center; - color: red; -} -table.alternate { - white-space: nowrap; - margin: 0.5em 0; -} -table.alternate td, -table.alternate th { - padding: 0.1em 0.25em; - font-size: small; -} -table.alternate tr td:last-child { - padding-right: 0; -} -table.alternate tr:nth-child(2n) { - background-color: #f0f0f0; -} -td.result { - text-align: center; -} -span.hash { - font-family: monospace; - font-size: small; - color: #aaa; -} -td.date { - color: #aaa; -} -td.ok { - text-align: center; - color: #060; - font-weight: bold; -} -td.ok a { - cursor: help; -} -th { - text-align: left; -} -th.builder { - text-align: center; - font-weight: bold; -} -a.fail { - color: #F00; -} -a.fail:visited { - color: #900; -} -ul.menu { - margin: 0; - padding: 0; - list-style-type: none; -} -ul.menu li { - float: left; - display: block; - font-size: 1em; - padding: 0.5em; - background: #EEF; - margin-left: 0.5em; - border-left: 1px solid #999; - border-right: 1px solid #999; -} -div.paginate { - padding: 0.5em; -} -div.paginate a { - padding: 0.5em; - margin-right: 0.5em; - background: #eee; - color: blue; -} -div.paginate a.inactive { - color: #999; -} -td.time { - font-family: monospace; -} -.notice { - padding: 10px; - margin: 10px; - border: 2px solid #FF6; - background: #900; - color: white; - text-align: center; -} -.notice a { - color: #FF6; -} -.unapproved a.name { - color: red; -} -.tag { - font-size: 0.8em; - color: #666; -} diff --git a/misc/dashboard/godashboard/toutf8.py b/misc/dashboard/godashboard/toutf8.py deleted file mode 100644 index 544c681b6a..0000000000 --- a/misc/dashboard/godashboard/toutf8.py +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright 2010 The Go Authors. All rights reserved. -# Use of this source code is governed by a BSD-style -# license that can be found in the LICENSE file. - -# This is a Django custom template filter to work around the -# fact that GAE's urlencode filter doesn't handle unicode strings. - -from google.appengine.ext import webapp - -register = webapp.template.create_template_register() - -@register.filter -def toutf8(value): - return value.encode("utf-8") -- 2.48.1