code
stringlengths
1
2.01M
repo_name
stringlengths
3
62
path
stringlengths
1
267
language
stringclasses
231 values
license
stringclasses
13 values
size
int64
1
2.01M
{% extends "base.html" %} {% block title %}Matrix{% endblock %} {% block content %} <h1>Matrix</h1> <table> <thead> <tr> <th scope="col"> username </th> <th scope="col"> date </th> <th scope="col"> pnum </th> <th scope="col"> light </th> <th scope="col"> temp </th> <th scope="col"> ...
100uhaco
trunk/GAE/haco/templates/haco_list.html
HTML
asf20
821
{% extends "base.html" %} {% block title %}Login{% endblock %} {% block content %} <h1>Login</h1> <form action="{{ request.get_full_path }}" method="post"> <table>{{ form }}</table> <input type="submit" value="Login" /> </form> {% endblock content %}
100uhaco
trunk/GAE/haco/templates/login.html
HTML
asf20
256
{% extends "base.html" %} {% block title %}Report{% endblock %} {% block content %} <h1>Report</h1> <a href={{ prev_url }}>PREV</a> {% if delta %} <a href={{ next_url }}>NEXT</a> {% endif %} <br> <strong>{{ day }}</strong> <div class="chart"> <img class = "chart" src='http://chart.apis.google.com/chart...
100uhaco
trunk/GAE/haco/templates/report.html
HTML
asf20
1,378
<html> <head> <title>100uhaco</title> </head> <body> <div id="haco_logo"> <img src={{MEDIA_URL}}"haco_logo.png" alt="haco_logo" /> </div> </body> </html>
100uhaco
trunk/GAE/haco/templates/index.html
HTML
asf20
188
{% extends "base.html" %} {% block doctype %}{% endblock %} {% block title %}Map{% endblock %} {% block js %} <script type="text/javascript" src="{{ MEDIA_URL }}combined-{{ LANGUAGE_CODE }}.js"></script> <script type='text/javascript' src='http://maps.google.com/maps/api/js?sensor=false'></script> <script ...
100uhaco
trunk/GAE/haco/templates/map.html
HTML
asf20
1,416
# -*- coding: utf-8 -*- from django.contrib.auth.decorators import login_required from django.http import HttpResponse from django.http import HttpResponseRedirect from django.utils.translation import ugettext as _ from ragendja.template import render_to_response from django.template import Context, RequestContext, lo...
100uhaco
trunk/GAE/haco/views.py
Python
asf20
5,258
# -*- coding: utf-8 -*- from django.contrib.auth.decorators import login_required from django.http import HttpResponse from django.http import HttpResponseRedirect from django.utils.translation import ugettext as _ from ragendja.template import render_to_response from django.template import Context, loader f...
100uhaco
trunk/GAE/haco/cron.py
Python
asf20
455
from django.contrib import admin from haco.models import HacoUser, Haco class HacoUserAdmin( admin.ModelAdmin): list_display =( 'user', 'prefecture', 'city') class HacoAdmin( admin.ModelAdmin): list_display =( 'temp', 'light', 'watt', 'date') admin.site.register( HacoUser) admin.site.register( Haco)
100uhaco
trunk/GAE/haco/admin.py
Python
asf20
312
# -*- coding: utf-8 -*- from datetime import * def now(): return datetime.now() + timedelta(hours=9) def today(): return now().replace(hour=0,minute=0,second=0,microsecond=0) def tomorrow(): return (now() + timedelta(days=1)).replace(hour=0,minute=0,second=0,microsecond=0) def someday(delta): ...
100uhaco
trunk/GAE/haco/jsTime.py
Python
asf20
413
from ragendja.settings_post import settings settings.add_app_media('combined-%(LANGUAGE_DIR)s.css', 'blueprintcss/reset.css', 'blueprintcss/typography.css', 'blueprintcss/forms.css', 'blueprintcss/grid.css', 'blueprintcss/lang-%(LANGUAGE_DIR)s.css', ) settings.add_app_media('combined-print-%(LANGUAG...
100uhaco
trunk/GAE/blueprintcss/settings.py
Python
asf20
428
/* -------------------------------------------------------------- typography.css * Sets up some sensible default typography. -------------------------------------------------------------- */ /* Default font settings. The font-size percentage is of 16px. (0.75 * 16px = 12px) */ body { font-size: 7...
100uhaco
trunk/GAE/blueprintcss/media/typography.css
CSS
asf20
3,149
/* -------------------------------------------------------------- rtl.css * Mirrors Blueprint for left-to-right languages By Ran Yaniv Hartstein [ranh.co.il] -------------------------------------------------------------- */ body .container { direction: rtl; } body .column { float: right; margin-r...
100uhaco
trunk/GAE/blueprintcss/media/lang-rtl.css
CSS
asf20
4,477
/* -------------------------------------------------------------- forms.css * Sets up some default styling for forms * Gives you classes to enhance your forms Usage: * For text fields, use class .title or .text -------------------------------------------------------------- */ label { ...
100uhaco
trunk/GAE/blueprintcss/media/forms.css
CSS
asf20
1,414
/* -------------------------------------------------------------- print.css * Gives you some sensible styles for printing pages. * See Readme file in this directory for further instructions. Some additions you'll want to make, customized to your markup: #header, #footer, #navigation { display:...
100uhaco
trunk/GAE/blueprintcss/media/print.css
CSS
asf20
1,867
/* -------------------------------------------------------------- reset.css * Resets default browser CSS. -------------------------------------------------------------- */ html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, code, del, dfn, em, img...
100uhaco
trunk/GAE/blueprintcss/media/reset.css
CSS
asf20
1,077
/* -------------------------------------------------------------- ie.css Contains every hack for Internet Explorer, so that our core files stay sweet and nimble. -------------------------------------------------------------- */ /* Fixes IE margin bugs */ * html .column, * html div.span-1, * html ...
100uhaco
trunk/GAE/blueprintcss/media/ie.css
CSS
asf20
1,861
/* -------------------------------------------------------------- grid.css - mirror version of src/grid.css -------------------------------------------------------------- */ /* A container should group all your columns. */ .container { width: 950px; margin: 0 auto; } /* Use this class on any div.span / contain...
100uhaco
trunk/GAE/blueprintcss/media/grid.css
CSS
asf20
9,611
# -*- coding: utf-8 -*- from django.conf.urls.defaults import * from ragendja.urlsauto import urlpatterns from ragendja.auth.urls import urlpatterns as auth_patterns #from myapp.forms import UserRegistrationForm from django.contrib import admin from django.contrib.auth import views as auth_views from haco import views...
100uhaco
trunk/GAE/urls.py
Python
asf20
1,190
/* Add your global CSS (i.e., code that is project-specific and not part of any app) here. */ body { padding: 15px 20px; } #clickme { background-color: #eeeeee; border: 1px solid black; padding: 3px; } #footer { clear: both; }
100uhaco
trunk/GAE/media/look.css
CSS
asf20
240
*{ margin:0; padding:0; } li{ list-style-type:none;} body{ line-height:1.8; font-size:80%; }
100uhaco
trunk/GAE/media/iPhone.css
CSS
asf20
102
from ragendja.settings_post import settings if not hasattr(settings, 'ACCOUNT_ACTIVATION_DAYS'): settings.ACCOUNT_ACTIVATION_DAYS = 30
100uhaco
trunk/GAE/registration/settings.py
Python
asf20
140
from django.conf.urls.defaults import * rootpatterns = patterns('', (r'^account/', include('registration.urls')), )
100uhaco
trunk/GAE/registration/urlsauto.py
Python
asf20
121
import datetime import random import re import sha from google.appengine.ext import db from django.conf import settings from django.contrib.auth.models import User from django.contrib.sites.models import Site from django.db import models from django.template.loader import render_to_string from django.utils.translatio...
100uhaco
trunk/GAE/registration/models.py
Python
asf20
11,287
""" Forms and validation code for user registration. """ from django.contrib.auth.models import User from django import forms from django.utils.translation import ugettext_lazy as _ from registration.models import RegistrationProfile # I put this on all required fields, because it's easier to pick up # on them wit...
100uhaco
trunk/GAE/registration/forms.py
Python
asf20
5,496
""" Unit tests for django-registration. These tests assume that you've completed all the prerequisites for getting django-registration running in the default setup, to wit: 1. You have ``registration`` in your ``INSTALLED_APPS`` setting. 2. You have created all of the templates mentioned in this application's doc...
100uhaco
trunk/GAE/registration/tests.py
Python
asf20
15,474
""" URLConf for Django user registration and authentication. If the default behavior of the registration views is acceptable to you, simply use a line like this in your root URLConf to set up the default URLs for registration:: (r'^accounts/', include('registration.urls')), This will also automatically set up th...
100uhaco
trunk/GAE/registration/urls.py
Python
asf20
3,620
{% extends "base.html" %} {% block title %}Reset password{% endblock %} {% block content %} <h1>Reset password</h1> <form action="{{ request.path }}" method="post"> <table>{{ form }}</table> <input type="submit" value="Reset" /> </form> {% endblock content %}
100uhaco
trunk/GAE/registration/templates/password_reset_form.html
HTML
asf20
265
{% extends "base.html" %} {% block title %}Password reset complete{% endblock %} {% block content %} <h1>Password reset complete</h1> <p>You've successfully reset your password!</p> {% endblock content %}
100uhaco
trunk/GAE/registration/templates/password_reset_complete.html
HTML
asf20
206
{% extends "base.html" %} {% block title %}Config{% endblock %} {% block content %} <h1>Config</h1> <p>configuration complete</p> {% endblock content %}
100uhaco
trunk/GAE/registration/templates/config_complete.html
HTML
asf20
156
Hi! In order to reset your password please visit the following link: {{ protocol }}://{{ domain }}{% url auth_password_reset_confirm uidb36=uid,token=token %} Thanks, Your {{ site_name }} team
100uhaco
trunk/GAE/registration/templates/password_reset_email.html
HTML
asf20
195
{% extends "base.html" %} {% block title %}{% if account %}Activation successful{% else %}Activation failed :({% endif %}{% endblock %} {% block content %} {% if account %} <h1>Activation successful</h1> <p>Congratulations, {{ account.username }}. Your account has been created successfully.</p> {% else %} <h1>Ac...
100uhaco
trunk/GAE/registration/templates/activate.html
HTML
asf20
581
{% extends "base.html" %} {% block title %}Reset password{% endblock %} {% block content %} <h1>Reset password</h1> <p>You've received an email with instructions for resetting your password. Please check your inbox.</p> {% endblock content %}
100uhaco
trunk/GAE/registration/templates/password_reset_done.html
HTML
asf20
244
{% extends "base.html" %} {% block title %}Activation required{% endblock %} {% block content %} <h1>Activation required</h1> <p>In order to activate your account please check your email and click on the activation link.</p> {% endblock content %}
100uhaco
trunk/GAE/registration/templates/registration_complete.html
HTML
asf20
251
{% extends "base.html" %} {% block title %}Register{% endblock %} {% block content %} <h1>Register</h1> <form action="{{ request.path }}" method="post"> <table>{{ form }}</table> <input type="submit" value="Register" /> </form> {% endblock content %}
100uhaco
trunk/GAE/registration/templates/registration_form.html
HTML
asf20
256
{% extends "base.html" %} {% block title %}Login{% endblock %} {% block content %} <h1>Login</h1> <form action="{{ request.get_full_path }}" method="post"> <table>{{ form }}</table> <input type="submit" value="Login" /> </form> {% endblock content %}
100uhaco
trunk/GAE/registration/templates/login.html
HTML
asf20
256
{% extends "base.html" %} {% block title %}Password Change{% endblock %} {% block content %} {% if form.errors %} <p>Your username and password didn't match. Please try again.</p> {% endif %} <form method="post" action="."> <table> <tr> <td>{{ form.old_password.label_tag }}</td> <td>{{ form.old_password...
100uhaco
trunk/GAE/registration/templates/password_change_form.html
HTML
asf20
728
{% extends "base.html" %} {% block title %}Logged out{% endblock %} {% block content %} <h1>Logged out</h1> <p>You've successfully logged out.</p> {% endblock content %}
100uhaco
trunk/GAE/registration/templates/logged_out.html
HTML
asf20
171
{% extends "base.html" %} {% block title %}Config{% endblock %} {% block content %} <h1>Config</h1> <form action="." method="POST"> <table>{{ form }}</table> <input type="submit" value="Submit"> </form> <br><br> <strong>Caution!</strong><br> If you use Arduino Device without RTC, you should edit program and ...
100uhaco
trunk/GAE/registration/templates/config.html
HTML
asf20
572
{% extends "base.html" %} {% block title %}Confirm password reset{% endblock %} {% block content %} <h1>Confirm password reset</h1> <form action="{{ request.path }}" method="post"> <table>{{ form }}</table> <input type="submit" value="Reset" /> </form> {% endblock content %}
100uhaco
trunk/GAE/registration/templates/password_reset_confirm.html
HTML
asf20
281
""" A management command which deletes expired accounts (e.g., accounts which signed up but never activated) from the database. Calls ``RegistrationProfile.objects.delete_expired_users()``, which contains the actual logic for determining which accounts are deleted. """ from django.core.management.base import NoArgsC...
100uhaco
trunk/GAE/registration/management/commands/cleanupregistration.py
Python
asf20
577
""" Views which allow users to create and activate accounts. """ from django.contrib.auth.decorators import login_required from django.conf import settings from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from django.shortcuts import render_to_response from django.template imp...
100uhaco
trunk/GAE/registration/views.py
Python
asf20
6,397
from django.contrib import admin from registration.models import RegistrationProfile class RegistrationAdmin(admin.ModelAdmin): list_display = ('__unicode__', 'activation_key_expired') search_fields = ('user__username', 'user__first_name') admin.site.register(RegistrationProfile, RegistrationAdmin)
100uhaco
trunk/GAE/registration/admin.py
Python
asf20
313
from django.dispatch import Signal # A new user has registered. user_registered = Signal(providing_args=["user"]) # A user has activated his or her account. user_activated = Signal(providing_args=["user"])
100uhaco
trunk/GAE/registration/signals.py
Python
asf20
209
{% extends 'base.html' %} {% block title %}Server error{% endblock %} {% block content %} There was an error while handling your request. {% endblock %}
100uhaco
trunk/GAE/templates/500.html
HTML
asf20
154
{% extends "admin/base.html" %} {% load i18n %} {% block title %}{{ title }} | {% trans 'Django site admin' %}{% endblock %} {% block userlinks %} <a href="/">Back to sample project</a> / {% url django-admindocs-docroot as docsroot %}{% if docsroot %}<a href="{{ docsroot }}">{% trans 'Documentation' %}</a> / {% endif...
100uhaco
trunk/GAE/templates/admin/base_site.html
HTML
asf20
631
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" dir="{% if LANGUAGE_BIDI %}rtl{% else %}ltr{% endif %}" xml:lang="{% firstof LANGUAGE_CODE 'en' %}" lang="{% firstof LANGUAGE_CODE ...
100uhaco
trunk/GAE/templates/haco_base.html
HTML
asf20
2,242
{% block doctype %} <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> {% endblock %} <html xmlns="http://www.w3.org/1999/xhtml" dir="{% if LANGUAGE_BIDI %}rtl{% else %}ltr{% endif %}" xml:lang="{% firstof LANGUAGE_CODE 'en' %}" ...
100uhaco
trunk/GAE/templates/base.html
HTML
asf20
2,658
{% extends 'base.html' %} {% block title %}Page not found{% endblock %} {% block content %} The page you requested could not be found. {% endblock %}
100uhaco
trunk/GAE/templates/404.html
HTML
asf20
151
{% extends 'base.html' %} {% block title %}{{ flatpage.title }}{% endblock %} {% block content %} {{ flatpage.content|safe }} {% endblock %}
100uhaco
trunk/GAE/templates/flatpages/default.html
HTML
asf20
142
{% extends 'base.html' %} {% block title %}Welcome!{% endblock %} {% block content %} <h1>Welcome to the app-engine-patch sample project</h1> <p>This site is a demonstration of <a href="http://code.google.com/p/app-engine-patch/">app-engine-patch</a> which is an <a href="http://code.google.com/appengine/">App Engine</...
100uhaco
trunk/GAE/templates/main.html
HTML
asf20
1,554
#include "Python.h" #include "structmember.h" #if PY_VERSION_HEX < 0x02060000 && !defined(Py_TYPE) #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) #endif #if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) typedef int Py_ssize_t; #define PY_SSIZE_T_MAX INT_MAX #define PY_SSIZE_T_MIN INT_MIN #define PyInt_F...
100uhaco
trunk/GAE/simplejson/_speedups.c
C
asf20
75,169
"""Implementation of JSONDecoder """ import re import sys import struct from simplejson.scanner import make_scanner try: from simplejson._speedups import scanstring as c_scanstring except ImportError: c_scanstring = None __all__ = ['JSONDecoder'] FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL def _floatconst...
100uhaco
trunk/GAE/simplejson/decoder.py
Python
asf20
12,032
"""JSON token scanner """ import re try: from simplejson._speedups import make_scanner as c_make_scanner except ImportError: c_make_scanner = None __all__ = ['make_scanner'] NUMBER_RE = re.compile( r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?', (re.VERBOSE | re.MULTILINE | re.DOTALL)) def py_make_scan...
100uhaco
trunk/GAE/simplejson/scanner.py
Python
asf20
2,227
"""Implementation of JSONEncoder """ import re try: from simplejson._speedups import encode_basestring_ascii as c_encode_basestring_ascii except ImportError: c_encode_basestring_ascii = None try: from simplejson._speedups import make_encoder as c_make_encoder except ImportError: c_make_encoder = None ...
100uhaco
trunk/GAE/simplejson/encoder.py
Python
asf20
15,836
r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data interchange format. :mod:`simplejson` exposes an API familiar to users of the standard library :mod:`marshal` and :mod:`pickle` modules. It is the externally maintained version of ...
100uhaco
trunk/GAE/simplejson/__init__.py
Python
asf20
12,503
r"""Using simplejson from the shell to validate and pretty-print:: $ echo '{"json":"obj"}' | python -msimplejson.tool { "json": "obj" } $ echo '{ 1.2:3.4}' | python -msimplejson.tool Expecting property name: line 1 column 2 (char 2) """ import simplejson def main(): import sys if l...
100uhaco
trunk/GAE/simplejson/tool.py
Python
asf20
908
// Define the overlay, derived from google.maps.OverlayView function Label(opt_options){ // Initialization this.setValues(opt_options); // Label specific var span = this.span_ = document.createElement('span'); span.style.cssText = 'position: relative; left: 0%; top: -50px; ' + 'whit...
100uhaco
trunk/GAE/_generated_media/1/haco/label.js
JavaScript
asf20
1,794
*{ margin:0; padding:0; } li{ list-style-type:none;} body{ line-height:1.8; font-size:80%; } IMG.top { width:900px } IMG.chart { width:900px } DIV.bar { text-align: right; } DIV.passwd { width: 900px; } FORM { position: relative; width: 900px; }
100uhaco
trunk/GAE/_generated_media/1/iPhone.css
CSS
asf20
289
# -*- coding: utf-8 -*- import os, sys COMMON_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) PROJECT_DIR = os.path.dirname(COMMON_DIR) ZIP_PACKAGES_DIRS = (os.path.join(PROJECT_DIR, 'zip-packages'), os.path.join(COMMON_DIR, 'zip-packages')) # Overrides for os.environ env_ext = {...
100uhaco
trunk/GAE/common/appenginepatch/aecmd.py
Python
asf20
4,878
#!/usr/bin/env python if __name__ == '__main__': from common.appenginepatch.aecmd import setup_env setup_env(manage_py_env=True) # Recompile translation files from mediautils.compilemessages import updatemessages updatemessages() # Generate compressed media files for manage.py update impor...
100uhaco
trunk/GAE/common/appenginepatch/.svn/text-base/manage.py.svn-base
Python
asf20
566
# -*- coding: utf-8 -*- import os, sys # Add current folder to sys.path, so we can import aecmd. # App Engine causes main.py to be reloaded if an exception gets raised # on the first request of a main.py instance, so don't add current_dir multiple # times. current_dir = os.path.abspath(os.path.dirname(__file__)) if cu...
100uhaco
trunk/GAE/common/appenginepatch/main.py
Python
asf20
2,674
# Empty file neeed to make this a Django app.
100uhaco
trunk/GAE/common/appenginepatch/appenginepatcher/models.py
Python
asf20
46
#!/usr/bin/python2.4 # # Copyright 2008 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
100uhaco
trunk/GAE/common/appenginepatch/appenginepatcher/imp.py
Python
asf20
932
# -*- coding: utf-8 -*- from django.utils.translation import ugettext_lazy as _ from google.appengine.ext import db
100uhaco
trunk/GAE/common/appenginepatch/appenginepatcher/conf/app_template/models.py
Python
asf20
118
# -*- coding: utf-8 -*- from django.http import HttpResponseRedirect from django.utils.translation import ugettext as _ from ragendja.template import render_to_response
100uhaco
trunk/GAE/common/appenginepatch/appenginepatcher/conf/app_template/views.py
Python
asf20
171
#!/usr/bin/python2.4 # # Copyright 2008 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
100uhaco
trunk/GAE/common/appenginepatch/appenginepatcher/.svn/text-base/imp.py.svn-base
Python
asf20
932
# -*- coding: utf-8 -*- from django.db.models import signals from django.test import TestCase from ragendja.dbutils import cleanup_relations from ragendja.testutils import ModelTestCase from google.appengine.ext import db from google.appengine.ext.db.polymodel import PolyModel from datetime import datetime # Test clas...
100uhaco
trunk/GAE/common/appenginepatch/appenginepatcher/tests.py
Python
asf20
5,416
# -*- coding: utf-8 -*- # Unfortunately, we have to fix a few App Engine bugs here because otherwise # not all of our features will work. Still, we should keep the number of bug # fixes to a minimum and report everything to Google, please: # http://code.google.com/p/googleappengine/issues/list from google.appengine.ex...
100uhaco
trunk/GAE/common/appenginepatch/appenginepatcher/patch.py
Python
asf20
27,320
from google.appengine.api import apiproxy_stub_map from google.appengine.ext import db from django.dispatch import Signal from django.db.models import signals from django.utils._threading_local import local from functools import wraps # Add signals which can be run after a transaction has been committed signals.post_...
100uhaco
trunk/GAE/common/appenginepatch/appenginepatcher/transactions.py
Python
asf20
2,808
from google.appengine.api import apiproxy_stub_map import os, sys have_appserver = bool(apiproxy_stub_map.apiproxy.GetStub('datastore_v3')) if have_appserver: appid = os.environ.get('APPLICATION_ID') else: try: from google.appengine.tools import dev_appserver from aecmd import PROJECT_DIR ...
100uhaco
trunk/GAE/common/appenginepatch/appenginepatcher/__init__.py
Python
asf20
591
from google.appengine.api.memcache import *
100uhaco
trunk/GAE/common/appenginepatch/appenginepatcher/lib/memcache.py
Python
asf20
44
from ragendja.settings_post import settings from appenginepatcher import have_appserver, on_production_server if have_appserver and not on_production_server and \ settings.MEDIA_URL.startswith('/'): if settings.ADMIN_MEDIA_PREFIX.startswith(settings.MEDIA_URL): settings.ADMIN_MEDIA_PREFIX = '/genera...
100uhaco
trunk/GAE/common/appenginepatch/mediautils/settings.py
Python
asf20
587
# -*- coding: utf-8 -*- from django.conf import settings from django.utils.simplejson import dumps from os.path import getmtime import os, codecs, shutil, logging, re path_re = re.compile(r'/[^/]+/\.\./') MEDIA_VERSION = unicode(settings.MEDIA_VERSION) COMPRESSOR = os.path.join(os.path.dirname(__file__), '.yuicompres...
100uhaco
trunk/GAE/common/appenginepatch/mediautils/generatemedia.py
Python
asf20
12,670
# -*- coding: utf-8 -*- from os.path import getmtime import codecs, os def updatemessages(): from django.conf import settings if not settings.USE_I18N: return from django.core.management.commands.compilemessages import compile_messages if any([needs_update(path) for path in settings.LOCALE_PATH...
100uhaco
trunk/GAE/common/appenginepatch/mediautils/compilemessages.py
Python
asf20
4,228
# -*- coding: utf-8 -*- """ This app combines media files specified in the COMBINE_MEDIA setting into one single file. It's a dictionary mapping the combined name to a tuple of files that should be combined: COMBINE_MEDIA = { 'global/js/combined.js': ( 'global/js/main.js', 'app/js/other.js', ),...
100uhaco
trunk/GAE/common/appenginepatch/mediautils/management/commands/generatemedia.py
Python
asf20
1,813
# -*- coding: utf-8 -*- from django.core.management.base import NoArgsCommand, CommandError from optparse import make_option import os, cStringIO, gzip, mimetypes class Command(NoArgsCommand): help = 'Uploads your _generated_media folder to Amazon S3.' option_list = NoArgsCommand.option_list + ( make_o...
100uhaco
trunk/GAE/common/appenginepatch/mediautils/management/commands/s3uploadmedia.py
Python
asf20
2,908
# -*- coding: utf-8 -*- from django.http import HttpResponse, Http404 from django.views.decorators.cache import cache_control from mediautils.generatemedia import get_targets, get_copy_targets, \ get_target_content, get_media_dirs from mimetypes import guess_type from ragendja.template import render_to_response @c...
100uhaco
trunk/GAE/common/appenginepatch/mediautils/views.py
Python
asf20
1,103
# -*- coding: utf-8 -*- from django.conf import settings from mediautils.views import get_file class MediaMiddleware(object): """Returns media files. This is a middleware, so it can handle the request as early as possible and thus with minimum overhead.""" def process_request(self, request): ...
100uhaco
trunk/GAE/common/appenginepatch/mediautils/middleware.py
Python
asf20
492
from django.conf import settings from django.core.cache import cache from django.contrib.sites.models import Site from ragendja.dbutils import db_create from ragendja.pyutils import make_tls_property _default_site_id = getattr(settings, 'SITE_ID', None) SITE_ID = settings.__class__.SITE_ID = make_tls_property() class...
100uhaco
trunk/GAE/common/appenginepatch/ragendja/sites/dynamicsite.py
Python
asf20
1,805
# -*- coding: utf-8 -*- """ Imports urlpatterns from apps, so we can have nice plug-n-play installation. :) """ from django.conf.urls.defaults import * from django.conf import settings IGNORE_APP_URLSAUTO = getattr(settings, 'IGNORE_APP_URLSAUTO', ()) check_app_imports = getattr(settings, 'check_app_imports', None) u...
100uhaco
trunk/GAE/common/appenginepatch/ragendja/urlsauto.py
Python
asf20
983
from django.conf import settings import os def import_module(module_name): return __import__(module_name, {}, {}, ['']) def import_package(package_name): package = [import_module(package_name)] if package[0].__file__.rstrip('.pyc').rstrip('.py').endswith('__init__'): package.extend([import_module(...
100uhaco
trunk/GAE/common/appenginepatch/ragendja/apputils.py
Python
asf20
1,497
# -*- coding: utf-8 -*- from django.utils._threading_local import local def make_tls_property(default=None): """Creates a class-wide instance property with a thread-specific value.""" class TLSProperty(object): def __init__(self): self.local = local() def __get__(self, instance, cl...
100uhaco
trunk/GAE/common/appenginepatch/ragendja/pyutils.py
Python
asf20
2,758
# -*- coding: utf-8 -*- from django.test import TestCase from google.appengine.ext import db from pyutils import object_list_to_table, equal_lists import os class ModelTestCase(TestCase): """ A test case for models that provides an easy way to validate the DB contents against a given list of row-values. ...
100uhaco
trunk/GAE/common/appenginepatch/ragendja/testutils.py
Python
asf20
1,487
from copy import deepcopy import re from django import forms from django.utils.datastructures import SortedDict, MultiValueDict from django.utils.html import conditional_escape from django.utils.encoding import StrAndUnicode, smart_unicode, force_unicode from django.utils.safestring import mark_safe from django.forms....
100uhaco
trunk/GAE/common/appenginepatch/ragendja/forms.py
Python
asf20
13,674
# -*- coding: utf-8 -*- from copy import deepcopy from django.forms.forms import NON_FIELD_ERRORS from django.template import Library from django.utils.datastructures import SortedDict from django.utils.safestring import mark_safe from django.utils.translation import ugettext as _ from ragendja.dbutils import prefetch_...
100uhaco
trunk/GAE/common/appenginepatch/ragendja/templatetags/ragendjatags.py
Python
asf20
3,006
# -*- coding: utf-8 -*- from django.conf import settings from django.template import Library from django.utils.html import escape from google.appengine.api import users register = Library() @register.simple_tag def google_login_url(redirect=settings.LOGIN_REDIRECT_URL): return escape(users.create_login_url(redire...
100uhaco
trunk/GAE/common/appenginepatch/ragendja/templatetags/googletags.py
Python
asf20
588
from django.contrib.auth.models import * from django.contrib.auth.models import DjangoCompatibleUser as User
100uhaco
trunk/GAE/common/appenginepatch/ragendja/auth/models.py
Python
asf20
109
# -*- coding: utf-8 -*- """ Provides basic set of auth urls. """ from django.conf.urls.defaults import * from django.conf import settings urlpatterns = patterns('') LOGIN = '^%s$' % settings.LOGIN_URL.lstrip('/') LOGOUT = '^%s$' % settings.LOGOUT_URL.lstrip('/') # If user set a LOGOUT_REDIRECT_URL we do a redirect. ...
100uhaco
trunk/GAE/common/appenginepatch/ragendja/auth/urls.py
Python
asf20
1,486
# -*- coding: utf-8 -*- from google.appengine.api import users def google_user(request): return {'google_user': users.get_current_user()}
100uhaco
trunk/GAE/common/appenginepatch/ragendja/auth/context_processors.py
Python
asf20
143
from django.utils.translation import ugettext_lazy as _ from django.conf import settings from google.appengine.api import users from google.appengine.ext import db from ragendja.auth.models import EmailUserTraits class GoogleUserTraits(EmailUserTraits): @classmethod def get_djangouser_for_user(cls, user): ...
100uhaco
trunk/GAE/common/appenginepatch/ragendja/auth/google_models.py
Python
asf20
1,678
# -*- coding: utf-8 -*- from django.contrib.auth.decorators import login_required from functools import wraps from ragendja.auth.views import google_redirect_to_login from ragendja.template import render_to_response def staff_only(view): """ Decorator that requires user.is_staff. Otherwise renders no_access.ht...
100uhaco
trunk/GAE/common/appenginepatch/ragendja/auth/decorators.py
Python
asf20
901
# -*- coding: utf-8 -*- from django.conf import settings from django.contrib.auth import REDIRECT_FIELD_NAME from django.contrib.auth.views import login, logout from django.http import HttpResponseRedirect from django.utils.translation import ugettext as _ from google.appengine.api import users from ragendja.template i...
100uhaco
trunk/GAE/common/appenginepatch/ragendja/auth/views.py
Python
asf20
2,483
from django.contrib import admin from django.utils.translation import ugettext_lazy as _ class UserAdmin(admin.ModelAdmin): fieldsets = ( (_('Personal info'), {'fields': ('user',)}), (_('Permissions'), {'fields': ('is_active', 'is_staff', 'is_superuser', 'user_permissions')}), (_('Important...
100uhaco
trunk/GAE/common/appenginepatch/ragendja/auth/google_admin.py
Python
asf20
604
# Parts of this code are taken from Google's django-helper (license: Apache 2) class LazyGoogleUser(object): def __init__(self, middleware_class): self._middleware_class = middleware_class def __get__(self, request, obj_type=None): if not hasattr(request, '_cached_user'): from djan...
100uhaco
trunk/GAE/common/appenginepatch/ragendja/auth/middleware.py
Python
asf20
1,147
from django.utils.translation import ugettext_lazy as _ from google.appengine.ext import db from ragendja.auth.google_models import GoogleUserTraits class User(GoogleUserTraits): """User class that provides support for Django and Google Accounts.""" user = db.UserProperty() username = db.StringProperty(req...
100uhaco
trunk/GAE/common/appenginepatch/ragendja/auth/hybrid_models.py
Python
asf20
780
# -*- coding: utf-8 -*- """ This is a set of utilities for faster development with Django templates. render_to_response() and render_to_string() use RequestContext internally. The app_prefixed_loader is a template loader that loads directly from the app's 'templates' folder when you specify an app prefix ('app/templa...
100uhaco
trunk/GAE/common/appenginepatch/ragendja/template.py
Python
asf20
3,680
# -*- coding: utf-8 -*- from django.conf import settings from django.core.serializers.json import DjangoJSONEncoder from django.http import HttpResponse from django.utils import simplejson from django.utils.encoding import force_unicode from django.utils.functional import Promise class LazyEncoder(DjangoJSONEncoder): ...
100uhaco
trunk/GAE/common/appenginepatch/ragendja/json.py
Python
asf20
784
# -*- coding: utf-8 -*- from django.http import HttpRequest class RegisterVars(dict): """ This class provides a simplified mechanism to build context processors that only add variables or functions without processing a request. Your module should have a global instance of this class called 'regist...
100uhaco
trunk/GAE/common/appenginepatch/ragendja/registervars.py
Python
asf20
1,731
# -*- coding: utf-8 -*- from appenginepatcher import on_production_server, have_appserver import os DEBUG = not on_production_server # The MEDIA_VERSION will get integrated via %d MEDIA_URL = '/media/%d/' # The MEDIA_URL will get integrated via %s ADMIN_MEDIA_PREFIX = '%sadmin_media/' ADMINS = () DATABASE_ENGINE = '...
100uhaco
trunk/GAE/common/appenginepatch/ragendja/settings_pre.py
Python
asf20
1,646
from django.conf import settings from django.http import HttpResponseServerError from ragendja.template import render_to_string def server_error(request, *args, **kwargs): debugkey = request.REQUEST.get('debugkey') if debugkey and debugkey == getattr(settings, 'DEBUGKEY', None): import sys from...
100uhaco
trunk/GAE/common/appenginepatch/ragendja/views.py
Python
asf20
625