Permalink
Browse files

Fixed style issues:

- Trailing whitespace
- Spacing between top level functions/classes
  • Loading branch information...
1 parent f1997e4 commit 4a7ab6167cede35cdf5e54361832d7cccde6882d @christopherb christopherb committed with Hacker Dojo Jun 23, 2010
Showing with 18 additions and 12 deletions.
  1. +12 −12 gaeunit.py
  2. +6 −0 notices.py
View
@@ -67,7 +67,7 @@
import django.utils.simplejson
from google.appengine.ext import webapp
-from google.appengine.api import apiproxy_stub_map
+from google.appengine.api import apiproxy_stub_map
from google.appengine.api import datastore_file_stub
from google.appengine.ext.webapp.util import run_wsgi_app
@@ -107,15 +107,15 @@ def get(self):
error = _log_error("The format '%s' is not valid." % cgi.escape(format))
self.error(404)
self.response.out.write(error)
-
+
def _render_html(self):
suite, error = _create_suite(self.request)
if not error:
self.response.out.write(_MAIN_PAGE_CONTENT % (_test_suite_to_json(suite), _WEB_TEST_DIR, __version__))
else:
self.error(404)
self.response.out.write(error)
-
+
def _render_plain(self):
self.response.headers["Content-Type"] = "text/plain"
runner = unittest.TextTestRunner(self.response.out)
@@ -173,7 +173,7 @@ def run(self, test):
class JsonTestRunHandler(webapp.RequestHandler):
- def get(self):
+ def get(self):
self.response.headers["Content-Type"] = "text/javascript"
test_name = self.request.get("name")
_load_default_test_modules()
@@ -222,7 +222,7 @@ def _create_suite(request):
module_names = package.__all__
for module_name in module_names:
suite.addTest(loader.loadTestsFromName('%s.%s' % (package_name, module_name)))
-
+
if suite.countTestCases() == 0:
raise Exception("'%s' is not found or does not contain any tests." % \
(test_name or package_name or 'local directory: \"%s\"' % _LOCAL_TEST_DIR))
@@ -283,14 +283,14 @@ def _run_test_suite(runner, suite):
test suite, run the test suite, and restore the development apiproxy.
This isolates the test datastore from the development datastore.
- """
+ """
original_apiproxy = apiproxy_stub_map.apiproxy
try:
apiproxy_stub_map.apiproxy = apiproxy_stub_map.APIProxyStubMap()
- temp_stub = datastore_file_stub.DatastoreFileStub('GAEUnitDataStore', None, None, trusted=True)
+ temp_stub = datastore_file_stub.DatastoreFileStub('GAEUnitDataStore', None, None, trusted=True)
apiproxy_stub_map.apiproxy.RegisterStub('datastore', temp_stub)
# Allow the other services to be used as-is for tests.
- for name in ['user', 'urlfetch', 'mail', 'memcache', 'images']:
+ for name in ['user', 'urlfetch', 'mail', 'memcache', 'images']:
apiproxy_stub_map.apiproxy.RegisterStub(name, original_apiproxy.GetStub(name))
runner.run(suite)
finally:
@@ -301,7 +301,7 @@ def _log_error(s):
logging.warn(s)
return s
-
+
################################################
# Browser HTML, CSS, and Javascript
################################################
@@ -390,11 +390,11 @@ def _log_error(s):
function testFailed() {
document.getElementById("testindicator").style.backgroundColor="red";
}
-
+
function testSucceed() {
document.getElementById("testindicator").style.backgroundColor="green";
}
-
+
function runTests() {
// Run each test asynchronously (concurrently).
var totalTests = 0;
@@ -467,4 +467,4 @@ def main():
run_wsgi_app(application)
if __name__ == '__main__':
- main()
+ main()
View
@@ -68,6 +68,7 @@ def notify_owner_confirmation(event):
event.key().id(),
slugify(event.name),))
+
def notify_staff_needed(event):
mail.send_mail(sender=FROM_ADDRESS, to=STAFF_ADDRESS,
subject='[Event Staffing] %s on %s' % (event.name, event.start_time.strftime('%a %b %d')),
@@ -96,6 +97,7 @@ def notify_staff_needed(event):
event.key().id(),
slugify(event.name),))
+
def notify_unapproved_unstaff_event(event):
mail.send_mail(sender=FROM_ADDRESS, to=STAFF_ADDRESS,
subject="[Event Unapproved, Needs Staffing] %s on %s" % (event.name, event.start_time.strftime('%a %b %d')),
@@ -124,6 +126,7 @@ def notify_unapproved_unstaff_event(event):
event.key().id(),
slugify(event.name),))
+
def notify_new_event(event):
mail.send_mail(sender=FROM_ADDRESS, to=NEW_EVENT_ADDRESS,
subject='[New Event] %s on %s' % (event.name, event.start_time.strftime('%a %b %d')),
@@ -147,6 +150,7 @@ def notify_new_event(event):
event.key().id(),
slugify(event.name),))
+
def notify_owner_approved(event):
mail.send_mail(sender=FROM_ADDRESS, to=event.member.email(),
subject="[Event Approved] %s" % event.name,
@@ -158,8 +162,10 @@ def notify_owner_approved(event):
http://events.hackerdojo.com/event/%s-%s
""" % (event.key().id(), slugify(event.name)))
+
def notify_owner_expiring(event):
pass
+
def notify_owner_expired(event):
pass

0 comments on commit 4a7ab61

Please sign in to comment.