socsvn commit: r240484 - in
soc2012/tzabal/server-side/akcrs-website: . akcrs
akcrs.egg-info akcrs/scripts akcrs/static akcrs/templates
tzabal at FreeBSD.org
tzabal at FreeBSD.org
Sat Aug 18 03:47:02 UTC 2012
Author: tzabal
Date: Sat Aug 18 03:46:59 2012
New Revision: 240484
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=240484
Log:
The dynamic website of the system. Built with Pyramid.
Added:
soc2012/tzabal/server-side/akcrs-website/
soc2012/tzabal/server-side/akcrs-website/CHANGES.txt
soc2012/tzabal/server-side/akcrs-website/MANIFEST.in
soc2012/tzabal/server-side/akcrs-website/README.txt
soc2012/tzabal/server-side/akcrs-website/akcrs/
soc2012/tzabal/server-side/akcrs-website/akcrs.egg-info/
soc2012/tzabal/server-side/akcrs-website/akcrs.egg-info/PKG-INFO
soc2012/tzabal/server-side/akcrs-website/akcrs.egg-info/SOURCES.txt
soc2012/tzabal/server-side/akcrs-website/akcrs.egg-info/dependency_links.txt (contents, props changed)
soc2012/tzabal/server-side/akcrs-website/akcrs.egg-info/entry_points.txt
soc2012/tzabal/server-side/akcrs-website/akcrs.egg-info/not-zip-safe (contents, props changed)
soc2012/tzabal/server-side/akcrs-website/akcrs.egg-info/requires.txt
soc2012/tzabal/server-side/akcrs-website/akcrs.egg-info/top_level.txt
soc2012/tzabal/server-side/akcrs-website/akcrs/.directory
soc2012/tzabal/server-side/akcrs-website/akcrs/__init__.py
soc2012/tzabal/server-side/akcrs-website/akcrs/models.py
soc2012/tzabal/server-side/akcrs-website/akcrs/scripts/
soc2012/tzabal/server-side/akcrs-website/akcrs/scripts/__init__.py
soc2012/tzabal/server-side/akcrs-website/akcrs/scripts/initializedb.py
soc2012/tzabal/server-side/akcrs-website/akcrs/static/
soc2012/tzabal/server-side/akcrs-website/akcrs/static/favicon.ico (contents, props changed)
soc2012/tzabal/server-side/akcrs-website/akcrs/static/footerbg.png (contents, props changed)
soc2012/tzabal/server-side/akcrs-website/akcrs/static/headerbg.png (contents, props changed)
soc2012/tzabal/server-side/akcrs-website/akcrs/static/ie6.css
soc2012/tzabal/server-side/akcrs-website/akcrs/static/middlebg.png (contents, props changed)
soc2012/tzabal/server-side/akcrs-website/akcrs/static/pylons.css
soc2012/tzabal/server-side/akcrs-website/akcrs/static/pyramid-small.png (contents, props changed)
soc2012/tzabal/server-side/akcrs-website/akcrs/static/pyramid.png (contents, props changed)
soc2012/tzabal/server-side/akcrs-website/akcrs/static/transparent.gif (contents, props changed)
soc2012/tzabal/server-side/akcrs-website/akcrs/templates/
soc2012/tzabal/server-side/akcrs-website/akcrs/templates/base.mako
soc2012/tzabal/server-side/akcrs-website/akcrs/templates/bug.mako
soc2012/tzabal/server-side/akcrs-website/akcrs/templates/bugs.mako
soc2012/tzabal/server-side/akcrs-website/akcrs/templates/edit_report.mako
soc2012/tzabal/server-side/akcrs-website/akcrs/templates/index.mako
soc2012/tzabal/server-side/akcrs-website/akcrs/templates/login.mako
soc2012/tzabal/server-side/akcrs-website/akcrs/templates/report.mako
soc2012/tzabal/server-side/akcrs-website/akcrs/templates/reports.mako
soc2012/tzabal/server-side/akcrs-website/akcrs/tests.py
soc2012/tzabal/server-side/akcrs-website/akcrs/views.py
soc2012/tzabal/server-side/akcrs-website/development.ini
soc2012/tzabal/server-side/akcrs-website/production.ini
soc2012/tzabal/server-side/akcrs-website/setup.cfg
soc2012/tzabal/server-side/akcrs-website/setup.py
Added: soc2012/tzabal/server-side/akcrs-website/CHANGES.txt
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ soc2012/tzabal/server-side/akcrs-website/CHANGES.txt Sat Aug 18 03:46:59 2012 (r240484)
@@ -0,0 +1,4 @@
+0.0
+---
+
+- Initial version
Added: soc2012/tzabal/server-side/akcrs-website/MANIFEST.in
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ soc2012/tzabal/server-side/akcrs-website/MANIFEST.in Sat Aug 18 03:46:59 2012 (r240484)
@@ -0,0 +1,2 @@
+include *.txt *.ini *.cfg *.rst
+recursive-include akcrs *.ico *.png *.css *.gif *.jpg *.pt *.txt *.mak *.mako *.js *.html *.xml
Added: soc2012/tzabal/server-side/akcrs-website/README.txt
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ soc2012/tzabal/server-side/akcrs-website/README.txt Sat Aug 18 03:46:59 2012 (r240484)
@@ -0,0 +1,14 @@
+akcrs README
+==================
+
+Getting Started
+---------------
+
+- cd <directory containing this file>
+
+- $venv/bin/python setup.py develop
+
+- $venv/bin/populate_akcrs development.ini
+
+- $venv/bin/pserve development.ini
+
Added: soc2012/tzabal/server-side/akcrs-website/akcrs.egg-info/PKG-INFO
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ soc2012/tzabal/server-side/akcrs-website/akcrs.egg-info/PKG-INFO Sat Aug 18 03:46:59 2012 (r240484)
@@ -0,0 +1,35 @@
+Metadata-Version: 1.1
+Name: akcrs
+Version: 0.0
+Summary: akcrs
+Home-page: UNKNOWN
+Author: UNKNOWN
+Author-email: UNKNOWN
+License: UNKNOWN
+Description: akcrs README
+ ==================
+
+ Getting Started
+ ---------------
+
+ - cd <directory containing this file>
+
+ - $venv/bin/python setup.py develop
+
+ - $venv/bin/populate_akcrs development.ini
+
+ - $venv/bin/pserve development.ini
+
+
+
+ 0.0
+ ---
+
+ - Initial version
+
+Keywords: web wsgi bfg pylons pyramid
+Platform: UNKNOWN
+Classifier: Programming Language :: Python
+Classifier: Framework :: Pylons
+Classifier: Topic :: Internet :: WWW/HTTP
+Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Application
Added: soc2012/tzabal/server-side/akcrs-website/akcrs.egg-info/SOURCES.txt
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ soc2012/tzabal/server-side/akcrs-website/akcrs.egg-info/SOURCES.txt Sat Aug 18 03:46:59 2012 (r240484)
@@ -0,0 +1,30 @@
+CHANGES.txt
+MANIFEST.in
+README.txt
+development.ini
+production.ini
+setup.cfg
+setup.py
+akcrs/__init__.py
+akcrs/models.py
+akcrs/tests.py
+akcrs/views.py
+akcrs.egg-info/PKG-INFO
+akcrs.egg-info/SOURCES.txt
+akcrs.egg-info/dependency_links.txt
+akcrs.egg-info/entry_points.txt
+akcrs.egg-info/not-zip-safe
+akcrs.egg-info/requires.txt
+akcrs.egg-info/top_level.txt
+akcrs/scripts/__init__.py
+akcrs/scripts/initializedb.py
+akcrs/static/favicon.ico
+akcrs/static/footerbg.png
+akcrs/static/headerbg.png
+akcrs/static/ie6.css
+akcrs/static/middlebg.png
+akcrs/static/pylons.css
+akcrs/static/pyramid-small.png
+akcrs/static/pyramid.png
+akcrs/static/transparent.gif
+akcrs/templates/mytemplate.pt
\ No newline at end of file
Added: soc2012/tzabal/server-side/akcrs-website/akcrs.egg-info/dependency_links.txt
==============================================================================
Binary file. No diff available.
Added: soc2012/tzabal/server-side/akcrs-website/akcrs.egg-info/entry_points.txt
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ soc2012/tzabal/server-side/akcrs-website/akcrs.egg-info/entry_points.txt Sat Aug 18 03:46:59 2012 (r240484)
@@ -0,0 +1,5 @@
+ [paste.app_factory]
+ main = akcrs:main
+ [console_scripts]
+ initialize_akcrs_db = akcrs.scripts.initializedb:main
+
\ No newline at end of file
Added: soc2012/tzabal/server-side/akcrs-website/akcrs.egg-info/not-zip-safe
==============================================================================
Binary file. No diff available.
Added: soc2012/tzabal/server-side/akcrs-website/akcrs.egg-info/requires.txt
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ soc2012/tzabal/server-side/akcrs-website/akcrs.egg-info/requires.txt Sat Aug 18 03:46:59 2012 (r240484)
@@ -0,0 +1,8 @@
+pyramid
+SQLAlchemy
+transaction
+pyramid_tm
+pyramid_debugtoolbar
+zope.sqlalchemy
+waitress
+docutils
\ No newline at end of file
Added: soc2012/tzabal/server-side/akcrs-website/akcrs.egg-info/top_level.txt
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ soc2012/tzabal/server-side/akcrs-website/akcrs.egg-info/top_level.txt Sat Aug 18 03:46:59 2012 (r240484)
@@ -0,0 +1 @@
+akcrs
Added: soc2012/tzabal/server-side/akcrs-website/akcrs/.directory
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ soc2012/tzabal/server-side/akcrs-website/akcrs/.directory Sat Aug 18 03:46:59 2012 (r240484)
@@ -0,0 +1,2 @@
+[Dolphin]
+Timestamp=2012,8,16,18,4,46
Added: soc2012/tzabal/server-side/akcrs-website/akcrs/__init__.py
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ soc2012/tzabal/server-side/akcrs-website/akcrs/__init__.py Sat Aug 18 03:46:59 2012 (r240484)
@@ -0,0 +1,31 @@
+from pyramid.authentication import AuthTktAuthenticationPolicy
+from pyramid.authorization import ACLAuthorizationPolicy
+from pyramid.config import Configurator
+from sqlalchemy import engine_from_config
+
+from .models import DBSession
+
+def main(global_config, **settings):
+ """ This function returns a Pyramid WSGI application."""
+ engine = engine_from_config(settings, 'sqlalchemy.')
+ DBSession.configure(bind=engine)
+ authn_policy = AuthTktAuthenticationPolicy('z3VfW0PhQy7g')
+ authz_policy = ACLAuthorizationPolicy()
+ config = Configurator(settings=settings)
+ # Authentication and Authorization
+ config.set_authentication_policy(authn_policy)
+ config.set_authorization_policy(authz_policy)
+ # Static
+ config.add_static_view('static', 'static', cache_max_age=3600)
+ # Routes
+ config.add_route('index', '/')
+ config.add_route('reports', '/reports')
+ config.add_route('report', '/report/{id}')
+ config.add_route('edit_report', '/report/{id}/edit_report')
+ config.add_route('bugs', '/bugs')
+ config.add_route('bug', '/bug/{id}')
+ config.add_route('login', '/login')
+ config.add_route('logout', '/logout')
+ # Scan
+ config.scan()
+ return config.make_wsgi_app()
\ No newline at end of file
Added: soc2012/tzabal/server-side/akcrs-website/akcrs/models.py
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ soc2012/tzabal/server-side/akcrs-website/akcrs/models.py Sat Aug 18 03:46:59 2012 (r240484)
@@ -0,0 +1,86 @@
+import datetime
+
+from sqlalchemy.dialects.postgresql import ARRAY
+from sqlalchemy.dialects.postgresql import ENUM
+from sqlalchemy.ext.declarative import declarative_base
+from sqlalchemy.orm import relationship
+from sqlalchemy.orm import scoped_session
+from sqlalchemy.orm import sessionmaker
+from sqlalchemy.schema import Column
+from sqlalchemy.schema import ForeignKey
+from sqlalchemy.schema import Sequence
+from sqlalchemy.types import Boolean
+from sqlalchemy.types import CHAR
+from sqlalchemy.types import Integer
+from sqlalchemy.types import String
+from sqlalchemy.types import Text
+from sqlalchemy.types import TIMESTAMP
+from zope.sqlalchemy import ZopeTransactionExtension
+
+
+DBSession = scoped_session(sessionmaker(extension=ZopeTransactionExtension()))
+Base = declarative_base()
+
+
+class User(Base):
+ __tablename__ = 'users'
+
+ id = Column(Integer, Sequence('users_id_seq'), primary_key=True)
+ email = Column(String(254), nullable=False)
+ password = Column(CHAR(64), nullable=False)
+ is_developer = Column(Boolean, default='false')
+
+ reports = relationship('Report')
+
+
+class Bug(Base):
+ __tablename__ = 'bugs'
+
+ id = Column(Integer, Sequence('bugs_id_seq'), primary_key=True)
+ state = Column(ENUM('NOSTATE', 'Open', 'Analyzed', 'Feedback', 'Closed', 'Suspended', name='bugstate'), nullable=False)
+ reported = Column(Integer, nullable=False)
+
+ reports = relationship('Report')
+
+
+class Report(Base):
+ __tablename__ = 'reports'
+
+ id = Column(Integer, Sequence('reports_id_seq'), primary_key=True)
+ bug_id = Column(Integer, ForeignKey('bugs.id'), nullable=False)
+ user_id = Column(Integer, ForeignKey('users.id'), nullable=False)
+ received_datetime = Column(TIMESTAMP, default=datetime.datetime.now)
+ confirmation_code = Column(CHAR(length=16), nullable=False)
+ confirmed = Column(Boolean, default='false')
+ crashtype = Column(Text)
+ crashdate = Column(Text)
+ hostname = Column(Text)
+ ostype = Column(Text)
+ osrelease = Column(Text)
+ version = Column(Text)
+ machine = Column(Text)
+ panic = Column(Text)
+ backtrace = Column(Text)
+ top_significant_func = Column(Text)
+ rem_significant_funcs = Column(ARRAY(Text))
+ ps_axl = Column(Text)
+ vmstat_s = Column(Text)
+ vmstat_m = Column(Text)
+ vmstat_z = Column(Text)
+ vmstat_i = Column(Text)
+ pstat_t = Column(Text)
+ pstat_s = Column(Text)
+ iostat = Column(Text)
+ ipcs_a = Column(Text)
+ ipcs_t = Column(Text)
+ nfsstat = Column(Text)
+ netstat_s = Column(Text)
+ netstat_m = Column(Text)
+ netstat_id = Column(Text)
+ netstat_anr = Column(Text)
+ netstat_ana = Column(Text)
+ netstat_al = Column(Text)
+ fstat = Column(Text)
+ dmesg = Column(Text)
+ kernelconfig = Column(Text)
+ ddbcapturebuffer = Column(Text)
\ No newline at end of file
Added: soc2012/tzabal/server-side/akcrs-website/akcrs/scripts/__init__.py
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ soc2012/tzabal/server-side/akcrs-website/akcrs/scripts/__init__.py Sat Aug 18 03:46:59 2012 (r240484)
@@ -0,0 +1 @@
+# package
Added: soc2012/tzabal/server-side/akcrs-website/akcrs/scripts/initializedb.py
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ soc2012/tzabal/server-side/akcrs-website/akcrs/scripts/initializedb.py Sat Aug 18 03:46:59 2012 (r240484)
@@ -0,0 +1,37 @@
+import os
+import sys
+import transaction
+
+from sqlalchemy import engine_from_config
+
+from pyramid.paster import (
+ get_appsettings,
+ setup_logging,
+ )
+
+from ..models import (
+ DBSession,
+ User,
+ Bug,
+ Report,
+ Base,
+ )
+
+def usage(argv):
+ cmd = os.path.basename(argv[0])
+ print('usage: %s <config_uri>\n'
+ '(example: "%s development.ini")' % (cmd, cmd))
+ sys.exit(1)
+
+def main(argv=sys.argv):
+ if len(argv) != 2:
+ usage(argv)
+ config_uri = argv[1]
+ setup_logging(config_uri)
+ settings = get_appsettings(config_uri)
+ engine = engine_from_config(settings, 'sqlalchemy.')
+ DBSession.configure(bind=engine)
+ Base.metadata.create_all(engine)
+ #with transaction.manager:
+ # model = MyModel(name='one', value=1)
+ # DBSession.add(model)
Added: soc2012/tzabal/server-side/akcrs-website/akcrs/static/favicon.ico
==============================================================================
Binary file. No diff available.
Added: soc2012/tzabal/server-side/akcrs-website/akcrs/static/footerbg.png
==============================================================================
Binary file. No diff available.
Added: soc2012/tzabal/server-side/akcrs-website/akcrs/static/headerbg.png
==============================================================================
Binary file. No diff available.
Added: soc2012/tzabal/server-side/akcrs-website/akcrs/static/ie6.css
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ soc2012/tzabal/server-side/akcrs-website/akcrs/static/ie6.css Sat Aug 18 03:46:59 2012 (r240484)
@@ -0,0 +1,8 @@
+* html img,
+* html .png{position:relative;behavior:expression((this.runtimeStyle.behavior="none")&&(this.pngSet?this.pngSet=true:(this.nodeName == "IMG" && this.src.toLowerCase().indexOf('.png')>-1?(this.runtimeStyle.backgroundImage = "none",
+this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.src + "',sizingMethod='image')",
+this.src = "static/transparent.gif"):(this.origBg = this.origBg? this.origBg :this.currentStyle.backgroundImage.toString().replace('url("','').replace('")',''),
+this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.origBg + "',sizingMethod='crop')",
+this.runtimeStyle.backgroundImage = "none")),this.pngSet=true)
+);}
+#wrap{display:table;height:100%}
Added: soc2012/tzabal/server-side/akcrs-website/akcrs/static/middlebg.png
==============================================================================
Binary file. No diff available.
Added: soc2012/tzabal/server-side/akcrs-website/akcrs/static/pylons.css
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ soc2012/tzabal/server-side/akcrs-website/akcrs/static/pylons.css Sat Aug 18 03:46:59 2012 (r240484)
@@ -0,0 +1,65 @@
+html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;font-size:100%;/* 16px */
+vertical-align:baseline;background:transparent;}
+body{line-height:1;}
+ol,ul{list-style:none;}
+blockquote,q{quotes:none;}
+blockquote:before,blockquote:after,q:before,q:after{content:'';content:none;}
+:focus{outline:0;}
+ins{text-decoration:none;}
+del{text-decoration:line-through;}
+table{border-collapse:collapse;border-spacing:0;}
+sub{vertical-align:sub;font-size:smaller;line-height:normal;}
+sup{vertical-align:super;font-size:smaller;line-height:normal;}
+ul,menu,dir{display:block;list-style-type:disc;margin:1em 0;padding-left:40px;}
+ol{display:block;list-style-type:decimal-leading-zero;margin:1em 0;padding-left:40px;}
+li{display:list-item;}
+ul ul,ul ol,ul dir,ul menu,ul dl,ol ul,ol ol,ol dir,ol menu,ol dl,dir ul,dir ol,dir dir,dir menu,dir dl,menu ul,menu ol,menu dir,menu menu,menu dl,dl ul,dl ol,dl dir,dl menu,dl dl{margin-top:0;margin-bottom:0;}
+ol ul,ul ul,menu ul,dir ul,ol menu,ul menu,menu menu,dir menu,ol dir,ul dir,menu dir,dir dir{list-style-type:circle;}
+ol ol ul,ol ul ul,ol menu ul,ol dir ul,ol ol menu,ol ul menu,ol menu menu,ol dir menu,ol ol dir,ol ul dir,ol menu dir,ol dir dir,ul ol ul,ul ul ul,ul menu ul,ul dir ul,ul ol menu,ul ul menu,ul menu menu,ul dir menu,ul ol dir,ul ul dir,ul menu dir,ul dir dir,menu ol ul,menu ul ul,menu menu ul,menu dir ul,menu ol menu,menu ul menu,menu menu menu,menu dir menu,menu ol dir,menu ul dir,menu menu dir,menu dir dir,dir ol ul,dir ul ul,dir menu ul,dir dir ul,dir ol menu,dir ul menu,dir menu menu,dir dir menu,dir ol dir,dir ul dir,dir menu dir,dir dir dir{list-style-type:square;}
+.hidden{display:none;}
+p{line-height:1.5em;}
+h1{font-size:1.75em;line-height:1.7em;font-family:helvetica,verdana;}
+h2{font-size:1.5em;line-height:1.7em;font-family:helvetica,verdana;}
+h3{font-size:1.25em;line-height:1.7em;font-family:helvetica,verdana;}
+h4{font-size:1em;line-height:1.7em;font-family:helvetica,verdana;}
+html,body{width:100%;height:100%;}
+body{margin:0;padding:0;background-color:#ffffff;position:relative;font:16px/24px "NobileRegular","Lucida Grande",Lucida,Verdana,sans-serif;}
+a{color:#1b61d6;text-decoration:none;}
+a:hover{color:#e88f00;text-decoration:underline;}
+body h1,
+body h2,
+body h3,
+body h4,
+body h5,
+body h6{font-family:"NeutonRegular","Lucida Grande",Lucida,Verdana,sans-serif;font-weight:normal;color:#373839;font-style:normal;}
+#wrap{min-height:100%;}
+#header,#footer{width:100%;color:#ffffff;height:40px;position:absolute;text-align:center;line-height:40px;overflow:hidden;font-size:12px;vertical-align:middle;}
+#header{background:#000000;top:0;font-size:14px;}
+#footer{bottom:0;background:#000000 url(footerbg.png) repeat-x 0 top;position:relative;margin-top:-40px;clear:both;}
+.header,.footer{width:750px;margin-right:auto;margin-left:auto;}
+.wrapper{width:100%}
+#top,#top-small,#bottom{width:100%;}
+#top{color:#000000;height:230px;background:#ffffff url(headerbg.png) repeat-x 0 top;position:relative;}
+#top-small{color:#000000;height:60px;background:#ffffff url(headerbg.png) repeat-x 0 top;position:relative;}
+#bottom{color:#222;background-color:#ffffff;}
+.top,.top-small,.middle,.bottom{width:750px;margin-right:auto;margin-left:auto;}
+.top{padding-top:40px;}
+.top-small{padding-top:10px;}
+#middle{width:100%;height:100px;background:url(middlebg.png) repeat-x;border-top:2px solid #ffffff;border-bottom:2px solid #b2b2b2;}
+.app-welcome{margin-top:25px;}
+.app-name{color:#000000;font-weight:bold;}
+.bottom{padding-top:50px;}
+#left{width:350px;float:left;padding-right:25px;}
+#right{width:350px;float:right;padding-left:25px;}
+.align-left{text-align:left;}
+.align-right{text-align:right;}
+.align-center{text-align:center;}
+ul.links{margin:0;padding:0;}
+ul.links li{list-style-type:none;font-size:14px;}
+form{border-style:none;}
+fieldset{border-style:none;}
+input{color:#222;border:1px solid #ccc;font-family:sans-serif;font-size:12px;line-height:16px;}
+input[type=text],input[type=password]{width:205px;}
+input[type=submit]{background-color:#ddd;font-weight:bold;}
+/*Opera Fix*/
+body:before{content:"";height:100%;float:left;width:0;margin-top:-32767px;}
Added: soc2012/tzabal/server-side/akcrs-website/akcrs/static/pyramid-small.png
==============================================================================
Binary file. No diff available.
Added: soc2012/tzabal/server-side/akcrs-website/akcrs/static/pyramid.png
==============================================================================
Binary file. No diff available.
Added: soc2012/tzabal/server-side/akcrs-website/akcrs/static/transparent.gif
==============================================================================
Binary file. No diff available.
Added: soc2012/tzabal/server-side/akcrs-website/akcrs/templates/base.mako
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ soc2012/tzabal/server-side/akcrs-website/akcrs/templates/base.mako Sat Aug 18 03:46:59 2012 (r240484)
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="UTF-8">
+ <title>Automated Kernel Crash Reporting System</title>
+ </head>
+ <body>
+ <div id="header">
+ <h1><%block name="header"/></h1>
+ </div>
+
+ <div id="menu">
+ <ul>
+ <li><a href="/">Home</a></li>
+ <li><a href="/reports">Reports</a></li>
+ <li><a href="/bugs">Bugs</a></li>
+ % if logged_in:
+ <li><a href="/logout">Logout</a></li>
+ % else:
+ <li><a href="/login">Login</a></li>
+ % endif
+ </ul>
+ </div>
+
+ ${next.body()}
+ </body>
+</html>
\ No newline at end of file
Added: soc2012/tzabal/server-side/akcrs-website/akcrs/templates/bug.mako
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ soc2012/tzabal/server-side/akcrs-website/akcrs/templates/bug.mako Sat Aug 18 03:46:59 2012 (r240484)
@@ -0,0 +1,22 @@
+<%inherit file='base.mako'/>
+<%block name="header">
+ Details of Bug with ID ${request.matchdict['id']}
+</%block>
+<p>All the data of the requested bug.</p>
+<table border="1">
+ <tr>
+ <th>State</th>
+ <th>Reported</th>
+ </tr>
+ <tr>
+ <td>${bug.state}</td>
+ <td>${bug.reported}</td>
+ </tr>
+</table>
+<p>This bug has been reported ${bug.reported} times. The crash reports that refers to it are:
+<ul>
+ % for report in reports:
+ <li><a href="http://0.0.0.0:6543/report/${report.id}">Report</a></li>
+ %endfor
+</ul>
+</p>
\ No newline at end of file
Added: soc2012/tzabal/server-side/akcrs-website/akcrs/templates/bugs.mako
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ soc2012/tzabal/server-side/akcrs-website/akcrs/templates/bugs.mako Sat Aug 18 03:46:59 2012 (r240484)
@@ -0,0 +1,20 @@
+<%inherit file='base.mako'/>
+<%block name="header">
+ Kernel Crash Bugs
+</%block>
+
+<p>A list that contains all the bugs that we have identified.</p>
+<table border="1">
+ <tr>
+ <th>State</th>
+ <th>Reported</th>
+ <th>More Details</th>
+ </tr>
+ % for bug in bugs:
+ <tr>
+ <td>${bug.state}</td>
+ <td>${bug.reported}</td>
+ <td><a href="http://0.0.0.0:6543/bug/${bug.id}">Bug</a></td>
+ </tr>
+ % endfor
+</table>
\ No newline at end of file
Added: soc2012/tzabal/server-side/akcrs-website/akcrs/templates/edit_report.mako
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ soc2012/tzabal/server-side/akcrs-website/akcrs/templates/edit_report.mako Sat Aug 18 03:46:59 2012 (r240484)
@@ -0,0 +1,4 @@
+<%inherit file='base.mako'/>
+<%block name="header">
+ Edit the Crash Report with ID ${request.matchdict['id']}
+</%block>
\ No newline at end of file
Added: soc2012/tzabal/server-side/akcrs-website/akcrs/templates/index.mako
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ soc2012/tzabal/server-side/akcrs-website/akcrs/templates/index.mako Sat Aug 18 03:46:59 2012 (r240484)
@@ -0,0 +1,4 @@
+<%inherit file='base.mako'/>
+<%block name="header">
+ Welcome to AKCRS!
+</%block>
\ No newline at end of file
Added: soc2012/tzabal/server-side/akcrs-website/akcrs/templates/login.mako
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ soc2012/tzabal/server-side/akcrs-website/akcrs/templates/login.mako Sat Aug 18 03:46:59 2012 (r240484)
@@ -0,0 +1,20 @@
+<%inherit file='base.mako'/>
+<%block name="header">
+ Login
+</%block>
+
+% if failed_attempt:
+<p><font color="red">Invalid credentials, try again.</font></p>
+% endif
+
+<form method="POST" action="${request.path}">
+ <p>
+ <label for="email">Email</label><br />
+ <input type="email" id="email" name="email" />
+ </p>
+ <p>
+ <label for="password">Password</label><br />
+ <input type="password" id="password" name="password" />
+ </p>
+ <input type="submit" name="submit" value="Submit" />
+</form>
\ No newline at end of file
Added: soc2012/tzabal/server-side/akcrs-website/akcrs/templates/report.mako
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ soc2012/tzabal/server-side/akcrs-website/akcrs/templates/report.mako Sat Aug 18 03:46:59 2012 (r240484)
@@ -0,0 +1,28 @@
+<%inherit file='base.mako'/>
+<%block name="header">
+ Details of Crash Report with ID ${request.matchdict['id']}
+</%block>
+<p>All the crash data of the requested report.</p>
+<table border="1">
+ <tr>
+ <th>Crash Date</th>
+ <th>Operating System</th>
+ <th>Release</th>
+ <th>Architecture</th>
+ </tr>
+ <tr>
+ <td>${report.crashdate}</td>
+ <td>${report.ostype}</td>
+ <td>${report.osrelease}</td>
+ <td>${report.machine}</td>
+ </tr>
+</table>
+% if is_developer:
+<p>
+ As a developer you can perform the following actions:
+ <ul>
+ <li><a href="http://0.0.0.0:6543/report/${request.matchdict['id']}/edit_report">Edit Report</a></li>
+ </ul>
+Do you think that this report refers correctly to the bug?
+<p>
+% endif
\ No newline at end of file
Added: soc2012/tzabal/server-side/akcrs-website/akcrs/templates/reports.mako
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ soc2012/tzabal/server-side/akcrs-website/akcrs/templates/reports.mako Sat Aug 18 03:46:59 2012 (r240484)
@@ -0,0 +1,24 @@
+<%inherit file="base.mako"/>
+<%block name="header">
+ Kernel Crash Reports
+</%block>
+
+<p>A list that contains all the crash reports that we have collected.</p>
+<table border="1">
+ <tr>
+ <th>Release</th>
+ <th>Architecture</th>
+ <th>Panic Message</th>
+ <th>More Details</th>
+ <th>Refers to</th>
+ </tr>
+ % for report in reports:
+ <tr>
+ <td>${report.osrelease}</td>
+ <td>${report.machine}</td>
+ <td>${report.panic}</td>
+ <td><a href="http://0.0.0.0:6543/report/${report.id}">Report</a></td>
+ <td><a href="http://0.0.0.0:6543/bug/${report.bug_id}">Bug</a></td>
+ </tr>
+ % endfor
+</table>
\ No newline at end of file
Added: soc2012/tzabal/server-side/akcrs-website/akcrs/tests.py
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ soc2012/tzabal/server-side/akcrs-website/akcrs/tests.py Sat Aug 18 03:46:59 2012 (r240484)
@@ -0,0 +1,32 @@
+import unittest
+import transaction
+
+from pyramid import testing
+
+from .models import DBSession
+
+class TestMyView(unittest.TestCase):
+ def setUp(self):
+ self.config = testing.setUp()
+ from sqlalchemy import create_engine
+ engine = create_engine('sqlite://')
+ from .models import (
+ Base,
+ MyModel,
+ )
+ DBSession.configure(bind=engine)
+ Base.metadata.create_all(engine)
+ with transaction.manager:
+ model = MyModel(name='one', value=55)
+ DBSession.add(model)
+
+ def tearDown(self):
+ DBSession.remove()
+ testing.tearDown()
+
+ def test_it(self):
+ from .views import my_view
+ request = testing.DummyRequest()
+ info = my_view(request)
+ self.assertEqual(info['one'].name, 'one')
+ self.assertEqual(info['project'], 'akcrs')
Added: soc2012/tzabal/server-side/akcrs-website/akcrs/views.py
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ soc2012/tzabal/server-side/akcrs-website/akcrs/views.py Sat Aug 18 03:46:59 2012 (r240484)
@@ -0,0 +1,112 @@
+import hashlib
+
+from pyramid.httpexceptions import HTTPForbidden
+from pyramid.httpexceptions import HTTPFound
+from pyramid.httpexceptions import HTTPNotFound
+from pyramid.security import authenticated_userid
+from pyramid.security import forget
+from pyramid.security import remember
+from pyramid.view import view_config
+from sqlalchemy.exc import DBAPIError
+
+from .models import DBSession, User, Bug, Report
+
+
+ at view_config(route_name='index', renderer='index.mako')
+def index(request):
+ logged_in = authenticated_userid(request)
+ return {'logged_in': logged_in}
+
+
+ at view_config(route_name='login', renderer='login.mako')
+def login(request):
+ logged_in = authenticated_userid(request)
+ if logged_in:
+ goto = request.route_url('index')
+ return HTTPFound(location=goto)
+
+ if request.method == 'POST':
+ email = request.POST.get('email')
+ password = request.POST.get('password')
+
+ if email and password:
+ query = DBSession.query(User).filter(User.email == email)
+ try:
+ user = query.one()
+ except:
+ pass # either no such email in db or more than 2 times in db!
+ else:
+ hashobj = hashlib.sha256()
+ hashobj.update(password)
+ hashpass = hashobj.hexdigest()
+ if hashpass == user.password:
+ goto = request.route_url('index')
+ headers = remember(request, email)
+ return HTTPFound(location=goto, headers=headers)
+
+ return {'failed_attempt': True}
+
+ return {'failed_attempt': False, 'logged_in': logged_in}
+
+
+ at view_config(route_name='logout')
+def logout(request):
+ logged_in = authenticated_userid(request)
+ if not logged_in:
+ goto = request.route_url('index')
+ return HTTPFound(location=goto)
+ headers = forget(request)
+ goto = request.route_url('index')
+ return HTTPFound(location=goto, headers=headers)
+
+
+
+ at view_config(route_name='reports', renderer='reports.mako')
+def reports(request):
+ logged_in = authenticated_userid(request)
+ reports = DBSession.query(Report).filter(Report.confirmed == True).all()
+ return {'reports': reports, 'logged_in': logged_in}
+
+
+ at view_config(route_name='report', renderer='report.mako')
+def report(request):
+ logged_in = authenticated_userid(request)
+ is_developer = None
+ if logged_in:
+ user = DBSession.query(User).filter(User.email == logged_in).one()
+ is_developer = user.is_developer
+
+ id = request.matchdict['id']
+ query = DBSession.query(Report).filter(Report.confirmed == True, Report.id == id)
+ report = query.one()
+ return {'report': report, 'logged_in': logged_in, 'is_developer': is_developer}
+
+
+ at view_config(route_name='edit_report', renderer='edit_report.mako')
+def edit_report(request):
+ return {}
+
+
+ at view_config(route_name='bugs', renderer='bugs.mako')
+def bugs(request):
+ logged_in = authenticated_userid(request)
+ bugs = DBSession.query(Bug).filter(Bug.reported > 0).all()
+ return {'bugs': bugs, 'logged_in': logged_in}
+
+
+ at view_config(route_name='bug', renderer='bug.mako')
+def bug(request):
+ logged_in = authenticated_userid(request)
+ id = request.matchdict['id']
+
+ # All the data related to the requested bug
+ # A bug is considered valid when it is reported from at least one report
+ # A bug can have reported equals to zero if the report that refers to it
+ # is unconfirmed.
+ query = DBSession.query(Bug).filter(Bug.reported > 0, Bug.id == id)
+ bug = query.one()
+
+ # The reports that refer to the requested bug
+ query = DBSession.query(Report).filter(Report.bug_id == id, Report.confirmed == True)
+ reports = query.all()
+ return {'bug': bug, 'reports': reports, 'logged_in': logged_in}
Added: soc2012/tzabal/server-side/akcrs-website/development.ini
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ soc2012/tzabal/server-side/akcrs-website/development.ini Sat Aug 18 03:46:59 2012 (r240484)
@@ -0,0 +1,61 @@
+[app:main]
+use = egg:akcrs
+
+pyramid.reload_templates = true
+pyramid.debug_authorization = false
+pyramid.debug_notfound = false
+pyramid.debug_routematch = false
+pyramid.default_locale_name = en
+pyramid.includes =
+ pyramid_debugtoolbar
+ pyramid_tm
+
+# SQLAlchemy engine creation for PostgreSQL using the Psycopg2 driver
+sqlalchemy.url = postgresql+psycopg2://akcrs:freebsd@localhost/akcrsdb
+
+# Mako Directories
+mako.directories = akcrs:templates
+
+[server:main]
+use = egg:waitress#main
+host = 0.0.0.0
+port = 6543
+
+# Begin logging configuration
+
+[loggers]
+keys = root, akcrs, sqlalchemy
+
+[handlers]
+keys = console
+
+[formatters]
+keys = generic
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_akcrs]
+level = DEBUG
+handlers =
+qualname = akcrs
+
+[logger_sqlalchemy]
+level = INFO
+handlers =
+qualname = sqlalchemy.engine
+# "level = INFO" logs SQL queries.
+# "level = DEBUG" logs SQL queries and results.
+# "level = WARN" logs neither. (Recommended for production systems.)
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[formatter_generic]
+format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
+
+# End logging configuration
Added: soc2012/tzabal/server-side/akcrs-website/production.ini
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ soc2012/tzabal/server-side/akcrs-website/production.ini Sat Aug 18 03:46:59 2012 (r240484)
@@ -0,0 +1,56 @@
+[app:main]
+use = egg:akcrs
+
+pyramid.reload_templates = false
+pyramid.debug_authorization = false
+pyramid.debug_notfound = false
+pyramid.debug_routematch = false
+pyramid.default_locale_name = en
+pyramid.includes =
+ pyramid_tm
+
+sqlalchemy.url = sqlite:///%(here)s/akcrs.db
+
+[server:main]
+use = egg:waitress#main
+host = 0.0.0.0
+port = 6543
+
+# Begin logging configuration
+
+[loggers]
+keys = root, akcrs, sqlalchemy
+
+[handlers]
+keys = console
+
+[formatters]
+keys = generic
+
+[logger_root]
+level = WARN
+handlers = console
+
+[logger_akcrs]
+level = WARN
+handlers =
+qualname = akcrs
+
+[logger_sqlalchemy]
+level = WARN
+handlers =
+qualname = sqlalchemy.engine
+# "level = INFO" logs SQL queries.
+# "level = DEBUG" logs SQL queries and results.
+# "level = WARN" logs neither. (Recommended for production systems.)
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[formatter_generic]
+format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
+
+# End logging configuration
Added: soc2012/tzabal/server-side/akcrs-website/setup.cfg
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ soc2012/tzabal/server-side/akcrs-website/setup.cfg Sat Aug 18 03:46:59 2012 (r240484)
@@ -0,0 +1,27 @@
+[nosetests]
+match=^test
+nocapture=1
+cover-package=akcrs
+with-coverage=1
+cover-erase=1
+
+[compile_catalog]
+directory = akcrs/locale
+domain = akcrs
+statistics = true
+
+[extract_messages]
+add_comments = TRANSLATORS:
+output_file = akcrs/locale/akcrs.pot
+width = 80
+
+[init_catalog]
+domain = akcrs
+input_file = akcrs/locale/akcrs.pot
+output_dir = akcrs/locale
+
+[update_catalog]
+domain = akcrs
+input_file = akcrs/locale/akcrs.pot
+output_dir = akcrs/locale
+previous = true
Added: soc2012/tzabal/server-side/akcrs-website/setup.py
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ soc2012/tzabal/server-side/akcrs-website/setup.py Sat Aug 18 03:46:59 2012 (r240484)
@@ -0,0 +1,47 @@
+import os
+
+from setuptools import setup, find_packages
+
+here = os.path.abspath(os.path.dirname(__file__))
+README = open(os.path.join(here, 'README.txt')).read()
+CHANGES = open(os.path.join(here, 'CHANGES.txt')).read()
+
+requires = [
+ 'pyramid',
+ 'SQLAlchemy',
+ 'transaction',
+ 'pyramid_tm',
+ 'pyramid_debugtoolbar',
+ 'zope.sqlalchemy',
+ 'waitress',
+ # tutorial added dependency. maybe remove (docutils)
+ 'docutils',
+ ]
+
+setup(name='akcrs',
+ version='0.0',
+ description='akcrs',
+ long_description=README + '\n\n' + CHANGES,
+ classifiers=[
+ "Programming Language :: Python",
+ "Framework :: Pylons",
+ "Topic :: Internet :: WWW/HTTP",
+ "Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
+ ],
+ author='',
+ author_email='',
+ url='',
+ keywords='web wsgi bfg pylons pyramid',
+ packages=find_packages(),
+ include_package_data=True,
+ zip_safe=False,
+ test_suite='akcrs',
+ install_requires=requires,
+ entry_points="""\
+ [paste.app_factory]
+ main = akcrs:main
+ [console_scripts]
+ initialize_akcrs_db = akcrs.scripts.initializedb:main
+ """,
+ )
+
More information about the svn-soc-all
mailing list