Author: chrisz
Date: Wed Jan 19 08:19:48 2011
New Revision: 7212
URL: http://trac.turbogears.org/changeset/7212
Log:
Some clean-up, consistent style.
Modified:
branches/1.5/setup.py
branches/1.5/turbogears/__init__.py
branches/1.5/turbogears/command/base.py
branches/1.5/turbogears/config.py
branches/1.5/turbogears/controllers.py
branches/1.5/turbogears/database.py
branches/1.5/turbogears/decorator.py
branches/1.5/turbogears/dispatchers.py
branches/1.5/turbogears/errorhandling.py
branches/1.5/turbogears/filters.py
branches/1.5/turbogears/hooks.py
branches/1.5/turbogears/identity/__init__.py
branches/1.5/turbogears/identity/base.py
branches/1.5/turbogears/identity/conditions.py
branches/1.5/turbogears/identity/exceptions.py
branches/1.5/turbogears/identity/visitor.py
branches/1.5/turbogears/release.py
branches/1.5/turbogears/scheduler.py
branches/1.5/turbogears/startup.py
branches/1.5/turbogears/testutil.py
branches/1.5/turbogears/util.py
branches/1.5/turbogears/visit/__init__.py
branches/1.5/turbogears/visit/api.py
branches/1.5/turbogears/widgets/base.py
branches/1.5/turbogears/widgets/big_widgets.py
branches/1.5/turbogears/widgets/datagrid.py
branches/1.5/turbogears/widgets/forms.py
branches/1.5/turbogears/widgets/i18n.py
branches/1.5/turbogears/widgets/links.py
branches/1.5/turbogears/widgets/meta.py
branches/1.5/turbogears/widgets/rpc.py
Modified: branches/1.5/setup.py
==============================================================================
--- branches/1.5/setup.py Wed Jan 19 04:07:56 2011 (r7211)
+++ branches/1.5/setup.py Wed Jan 19 08:19:48 2011 (r7212)
@@ -1,4 +1,4 @@
-# -*- coding: UTF-8 -*-
+"""TurboGears Setup."""
import os
import sys
Modified: branches/1.5/turbogears/__init__.py
==============================================================================
--- branches/1.5/turbogears/__init__.py Wed Jan 19 04:07:56 2011 (r7211)
+++ branches/1.5/turbogears/__init__.py Wed Jan 19 08:19:48 2011 (r7212)
@@ -1,5 +1,11 @@
"""TurboGears Front-to-Back Web Framework"""
+__all__ = ['absolute_url', 'database', 'command', 'config',
+ 'controllers', 'expose', 'flash', 'error_handler',
+ 'exception_handler', 'mochikit', 'redirect',
+ 'scheduler', 'start_server', 'update_config',
+ 'url', 'validate', 'validators', 'view', 'widgets']
+
import warnings
import pkg_resources
@@ -29,25 +35,3 @@
i18n.install() # adds _ (gettext) to builtins namespace
-
-__all__ = [
- 'absolute_url',
- 'database',
- 'command',
- 'config',
- 'controllers',
- 'expose',
- 'flash',
- 'error_handler',
- 'exception_handler',
- 'mochikit',
- 'redirect',
- 'scheduler',
- 'start_server',
- 'update_config',
- 'url',
- 'validate',
- 'validators',
- 'view',
- 'widgets',
-]
Modified: branches/1.5/turbogears/command/base.py
==============================================================================
--- branches/1.5/turbogears/command/base.py Wed Jan 19 04:07:56 2011
(r7211)
+++ branches/1.5/turbogears/command/base.py Wed Jan 19 08:19:48 2011
(r7212)
@@ -1,5 +1,7 @@
"""Commands for the TurboGears command line tool."""
+__all__ = ['main']
+
import glob
import optparse
import os
@@ -404,5 +406,3 @@
command = command(__version__)
command.run()
-
-__all__ = ["main"]
Modified: branches/1.5/turbogears/config.py
==============================================================================
--- branches/1.5/turbogears/config.py Wed Jan 19 04:07:56 2011 (r7211)
+++ branches/1.5/turbogears/config.py Wed Jan 19 08:19:48 2011 (r7212)
@@ -1,3 +1,7 @@
+"""TurboGears configuration"""
+
+__all__ = ['update_config', 'get', 'update']
+
import os, glob, re
import cherrypy
@@ -6,8 +10,6 @@
import pkg_resources
import logging.handlers
-__all__ = ["update_config", "get", "update"]
-
# TurboGear's server-side config just points directly to CherryPy.
server = cp_config
Modified: branches/1.5/turbogears/controllers.py
==============================================================================
--- branches/1.5/turbogears/controllers.py Wed Jan 19 04:07:56 2011
(r7211)
+++ branches/1.5/turbogears/controllers.py Wed Jan 19 08:19:48 2011
(r7212)
@@ -1,9 +1,13 @@
"""Classes and methods for TurboGears controllers."""
+__all__ = ['Controller', 'absolute_url',
+ 'error_handler', 'exception_handler',
+ 'expose', 'get_server_name', 'flash', 'redirect',
+ 'Root', 'RootController', 'url', 'validate']
+
import logging
import urllib
import urlparse
-import time
import types
from itertools import izip
@@ -685,18 +689,3 @@
redirect_path = urlparse.urljoin(request.path_info, redirect_path)
raise cherrypy.HTTPRedirect(url(redirect_path, redirect_params, **kw))
-
-__all__ = [
- "Controller",
- "absolute_url",
- "error_handler",
- "exception_handler",
- "expose",
- "get_server_name",
- "flash",
- "redirect",
- "Root",
- "RootController",
- "url",
- "validate",
-]
Modified: branches/1.5/turbogears/database.py
==============================================================================
--- branches/1.5/turbogears/database.py Wed Jan 19 04:07:56 2011 (r7211)
+++ branches/1.5/turbogears/database.py Wed Jan 19 08:19:48 2011 (r7212)
@@ -1,5 +1,12 @@
"""Convenient access to an SQLObject or SQLAlchemy managed database."""
+__all__ = ['AutoConnectHub', 'bind_metadata', 'create_session',
+ 'create_session_mapper', 'commit_all', 'end_all',
+ 'DatabaseError', 'DatabaseConfigurationError',
+ 'EndTransactions', 'get_engine', 'get_metadata', 'mapper',
+ 'metadata', 'PackageHub', 'rollback_all', 'session',
+ 'session_mapper', 'set_db_uri', 'so_columns', 'so_joins', 'so_to_dict']
+
import sys
import time
import logging
@@ -29,15 +36,16 @@
from turbogears import config
from turbogears.util import remove_keys
-log = logging.getLogger("turbogears.database")
-
-_using_sa = False
+log = logging.getLogger('turbogears.database')
class DatabaseError(Exception):
- pass
+ """TurboGears Database Error."""
+
+
class DatabaseConfigurationError(DatabaseError):
- pass
+ """TurboGears Database Configuration Error."""
+
# Provide support for SQLAlchemy
if sqlalchemy:
@@ -81,7 +89,8 @@
for k, v in config.items():
if ".dburi" in k and 'sqlalchemy.' not in k:
- get_metadata(k.split(".")[0]).bind =
sqlalchemy.create_engine(v, **alch_args)
+ get_metadata(k.split(".")[0]).bind = sqlalchemy.create_engine(
+ v, **alch_args)
def create_session():
"""Create a session that uses the engine from thread-local metadata.
@@ -357,6 +366,7 @@
class PackageHub(object):
pass
+
def set_db_uri(dburi, package=None):
"""Sets the database URI to use either globally or for a specific
package. Note that once the database is accessed, calling
@@ -370,32 +380,41 @@
else:
config.update({"sqlobject.dburi" : dburi})
+
def commit_all():
"""Commit the transactions in all registered hubs (for this thread)."""
for hub in hub_registry:
hub.commit()
+
def rollback_all():
"""Rollback the transactions in all registered hubs (for this thread)."""
for hub in hub_registry:
hub.rollback()
+
def end_all():
"""End the transactions in all registered hubs (for this thread)."""
for hub in hub_registry:
hub.end()
+
@abstract()
def run_with_transaction(func, *args, **kw):
pass
+
@abstract()
def restart_transaction(args):
pass
+
+_using_sa = False
+
def _use_sa(args=None):
return _using_sa
+
# include "args" to avoid call being pre-cached
@when(run_with_transaction, "not _use_sa(args)")
def so_rwt(func, *args, **kw):
@@ -419,13 +438,15 @@
finally:
end_all()
+
# include "args" to avoid call being pre-cached
@when(restart_transaction, "not _use_sa(args)")
def so_restart_transaction(args):
- #log.debug("ReStarting SQLObject transaction")
+ # log.debug("ReStarting SQLObject transaction")
# Disable for now for compatibility
pass
+
def dispatch_exception(exception, args, kw):
# errorhandling import here to avoid circular imports
from turbogears.errorhandling import dispatch_error
@@ -443,6 +464,7 @@
del exc_trace
return output
+
# include "args" to avoid call being pre-cached
@when(run_with_transaction, "_use_sa(args)")
def sa_rwt(func, *args, **kw):
@@ -478,6 +500,7 @@
session.close()
return retval
+
# include "args" to avoid call being pre-cached
@when(restart_transaction, "_use_sa(args)")
def sa_restart_transaction(args):
@@ -490,6 +513,7 @@
session.close()
request.sa_transaction = session.begin()
+
def sa_transaction_active():
"""Check whether SA transaction is still active."""
try:
@@ -504,6 +528,7 @@
except AttributeError:
return False
+
def so_to_dict(sqlobj):
"""Convert SQLObject to a dictionary based on columns."""
d = {}
@@ -517,6 +542,7 @@
d.pop('childName')
return d
+
def so_columns(sqlclass, columns=None):
"""Return a dict with all columns from a SQLObject.
@@ -531,6 +557,7 @@
so_columns(sqlclass.__base__, columns)
return columns
+
def so_joins(sqlclass, joins=None):
"""Return a list with all joins from a SQLObject.
@@ -544,18 +571,13 @@
so_joins(sqlclass.__base__, joins)
return joins
+
def EndTransactions():
if _use_sa():
- try:
- session.expunge_all()
- except AttributeError: # SQLAlchemy < 0.5.1
- session.clear()
- end_all()
-
-__all__ = ["AutoConnectHub", "bind_metadata", "create_session",
- "create_session_mapper", "commit_all", "end_all",
- "DatabaseError", "DatabaseConfigurationError",
- "EndTransactions", "get_engine", "get_metadata", "mapper",
- "metadata", "PackageHub", "rollback_all", "session",
- "session_mapper", "set_db_uri", "so_columns", "so_joins",
- "so_to_dict"]
+ try:
+ session.expunge_all()
+ except AttributeError: # SQLAlchemy < 0.5.1
+ session.clear()
+ else:
+ end_all()
+
Modified: branches/1.5/turbogears/decorator.py
==============================================================================
--- branches/1.5/turbogears/decorator.py Wed Jan 19 04:07:56 2011
(r7211)
+++ branches/1.5/turbogears/decorator.py Wed Jan 19 08:19:48 2011
(r7212)
@@ -1,5 +1,10 @@
"""Decorator tools"""
+__all__ = ['decorate', 'make_weak_signature', 'compose',
+ 'decorator', 'weak_signature_decorator',
+ 'simple_decorator', 'simple_weak_signature_decorator',
+ 'func_id', 'func_eq', 'func_original', 'func_composition']
+
import itertools
from inspect import getargspec, formatargspec
@@ -110,8 +115,3 @@
"""Check if functions are identical."""
return func_id(f) == func_id(g)
-
-__all__ = ["decorate", "make_weak_signature", "compose",
- "decorator", "weak_signature_decorator",
- "simple_decorator", "simple_weak_signature_decorator",
- "func_id", "func_eq", "func_original", "func_composition"]
Modified: branches/1.5/turbogears/dispatchers.py
==============================================================================
--- branches/1.5/turbogears/dispatchers.py Wed Jan 19 04:07:56 2011
(r7211)
+++ branches/1.5/turbogears/dispatchers.py Wed Jan 19 08:19:48 2011
(r7212)
@@ -1,5 +1,3 @@
-# -*- coding: UTF-8 -*-
-
"""Standard TurboGears request dispatchers for CherryPy."""
__all__ = ['VirtualPathDispatcher']
Modified: branches/1.5/turbogears/errorhandling.py
==============================================================================
--- branches/1.5/turbogears/errorhandling.py Wed Jan 19 04:07:56 2011
(r7211)
+++ branches/1.5/turbogears/errorhandling.py Wed Jan 19 08:19:48 2011
(r7212)
@@ -1,3 +1,9 @@
+"""Error handling functions."""
+
+__all__ = ['dispatch_error', 'dispatch_error_adaptor', 'try_call',
+ 'run_with_errors', 'default', 'register_handler', 'FailsafeSchema',
+ 'dispatch_failsafe', 'error_handler', 'exception_handler']
+
import sys
from itertools import izip, islice
from inspect import getargspec
@@ -5,8 +11,8 @@
import cherrypy
from peak.rules import abstract, when, around, NoApplicableMethods
-from turbogears.util import inject_args, adapt_call, call_on_stack, has_arg, \
- remove_keys, Enum
+from turbogears.util import (inject_args, adapt_call, call_on_stack, has_arg,
+ remove_keys, Enum)
from turbogears.decorator import func_id
@@ -60,8 +66,8 @@
def adaptor(controller, tg_source,
tg_errors, tg_exceptions, *args, **kw):
tg_format = kw.pop('tg_format', None)
- args, kw = inject_args(func, {"tg_source": tg_source,
- "tg_errors": tg_errors, "tg_exceptions": tg_exceptions},
+ args, kw = inject_args(func, {'tg_source': tg_source,
+ 'tg_errors': tg_errors, 'tg_exceptions': tg_exceptions},
args, kw, 1)
args, kw = adapt_call(func, args, kw, 1)
if tg_format is not None:
@@ -76,16 +82,16 @@
try:
return func(self, *args, **kw)
except Exception, e:
- if isinstance(e, cherrypy.HTTPRedirect) or \
- call_on_stack("dispatch_error",
- {"tg_source": func, "tg_exception": e}, 4):
+ if (isinstance(e, cherrypy.HTTPRedirect)
+ or call_on_stack('dispatch_error',
+ {'tg_source': func, 'tg_exception': e}, 4)):
raise
else:
exc_type, exc_value, exc_trace = sys.exc_info()
- remove_keys(kw, ("tg_source", "tg_errors", "tg_exceptions"))
+ remove_keys(kw, ('tg_source', 'tg_errors', 'tg_exceptions'))
if 'tg_format' in cherrypy.request.params:
kw['tg_format'] = 'json'
- if getattr(cherrypy.request, "in_transaction", None):
+ if getattr(cherrypy.request, 'in_transaction', None):
restart_transaction(1)
try:
output = dispatch_error(self, func, None, e, *args, **kw)
@@ -98,7 +104,7 @@
def run_with_errors(errors, func, self, *args, **kw):
"""Branch execution depending on presence of errors."""
if errors:
- if hasattr(self, "validation_error"):
+ if hasattr(self, 'validation_error'):
import warnings
warnings.warn(
"Use decorator error_handler() on per-method base "
@@ -106,7 +112,7 @@
DeprecationWarning, 2)
return self.validation_error(func.__name__, kw, errors)
else:
- remove_keys(kw, ("tg_source", "tg_errors", "tg_exceptions"))
+ remove_keys(kw, ('tg_source', 'tg_errors', 'tg_exceptions'))
if 'tg_format' in cherrypy.request.params:
kw['tg_format'] = 'json'
try:
@@ -151,7 +157,7 @@
exception_handler = bind_rules("tg_exceptions")
-FailsafeSchema = Enum("none", "values", "map_errors", "defaults")
+FailsafeSchema = Enum('none', 'values', 'map_errors', 'defaults')
def dispatch_failsafe(schema, values, errors, source, kw):
"""Dispatch fail-safe mechanism for failed inputs."""
@@ -186,13 +192,10 @@
def _failsafe_defaults(schema, values, errors, source, kw):
"""Map erroneous inputs to method defaults."""
argnames, defaultvals = getargspec(source)[::3]
- defaults = dict(izip(islice(argnames, len(argnames) - len(defaultvals),
- None), defaultvals))
+ defaults = dict(izip(islice(
+ argnames, len(argnames) - len(defaultvals), None), defaultvals))
for key in errors:
if key in defaults:
kw[key] = defaults[key]
return kw
-__all__ = ["dispatch_error", "dispatch_error_adaptor", "try_call",
- "run_with_errors", "default", "register_handler", "FailsafeSchema",
- "dispatch_failsafe", "error_handler", "exception_handler"]
Modified: branches/1.5/turbogears/filters.py
==============================================================================
--- branches/1.5/turbogears/filters.py Wed Jan 19 04:07:56 2011 (r7211)
+++ branches/1.5/turbogears/filters.py Wed Jan 19 08:19:48 2011 (r7212)
@@ -1,5 +1,3 @@
-# -*- coding: UTF-8 -*-
-
"""Package collecting various request filters."""
raise ImportError("The filters have been replaced by hooks in TurboGears 1.5")
Modified: branches/1.5/turbogears/hooks.py
==============================================================================
--- branches/1.5/turbogears/hooks.py Wed Jan 19 04:07:56 2011 (r7211)
+++ branches/1.5/turbogears/hooks.py Wed Jan 19 08:19:48 2011 (r7212)
@@ -1,5 +1,3 @@
-# -*- coding: UTF-8 -*-
-
"""Standard TurboGears request hooks for CherryPy."""
__all__ = ['NestedVariablesHook']
Modified: branches/1.5/turbogears/identity/__init__.py
==============================================================================
--- branches/1.5/turbogears/identity/__init__.py Wed Jan 19 04:07:56
2011 (r7211)
+++ branches/1.5/turbogears/identity/__init__.py Wed Jan 19 08:19:48
2011 (r7212)
@@ -1,44 +1,19 @@
"""The TurboGears identity management package."""
# declare what should be exported
-__all__ = [
- 'All',
- 'Any',
- 'CompoundPredicate',
- 'IdentityConfigurationException',
- 'IdentityException',
- 'IdentityFailure',
- 'IdentityManagementNotEnabledException',
- 'IdentityPredicateHelper',
- 'NotAny',
- 'Predicate',
- 'RequestRequiredException',
- 'SecureObject',
- 'SecureResource',
- 'current',
- 'current_provider',
- 'create_default_provider',
- 'encrypt_password',
- 'encrypt_pw_with_algorithm',
- 'from_host',
- 'from_any_host',
- 'get_identity_errors',
- 'get_failure_url',
- 'in_all_groups',
- 'in_any_group',
- 'in_group',
- 'has_all_permissions',
- 'has_any_permission',
- 'has_permission',
- 'not_anonymous',
- 'require',
- 'set_current_identity',
- 'set_current_provider',
- 'set_identity_errors',
- 'set_login_attempted',
- 'verify_identity_status',
- 'was_login_attempted',
-]
+__all__ = ['All', 'Any', 'NotAny', 'CompoundPredicate',
+ 'IdentityConfigurationException', 'IdentityException', 'IdentityFailure',
+ 'IdentityManagementNotEnabledException', 'IdentityPredicateHelper',
+ 'Predicate', 'RequestRequiredException', 'SecureObject', 'SecureResource',
+ 'current', 'current_provider', 'create_default_provider',
+ 'encrypt_password', 'encrypt_pw_with_algorithm',
+ 'from_host', 'from_any_host', 'get_identity_errors', 'get_failure_url',
+ 'in_all_groups', 'in_any_group', 'in_group',
+ 'has_all_permissions', 'has_any_permission', 'has_permission',
+ 'not_anonymous', 'require',
+ 'set_current_identity', 'set_current_provider',
+ 'set_identity_errors', 'set_login_attempted',
+ 'verify_identity_status', 'was_login_attempted']
from turbogears.identity.base import (current, current_provider,
create_default_provider, encrypt_password, encrypt_pw_with_algorithm,
Modified: branches/1.5/turbogears/identity/base.py
==============================================================================
--- branches/1.5/turbogears/identity/base.py Wed Jan 19 04:07:56 2011
(r7211)
+++ branches/1.5/turbogears/identity/base.py Wed Jan 19 08:19:48 2011
(r7212)
@@ -1,22 +1,13 @@
"""The TurboGears identity management package."""
# declare what should be exported
-__all__ = [
- '_encrypt_password',
- 'create_default_provider',
- 'current',
- 'current_provider',
- 'encrypt_password',
- 'encrypt_pw_with_algorithm',
- 'get_identity_errors',
- 'get_failure_url',
- 'set_current_identity',
- 'set_current_provider',
- 'set_identity_errors',
- 'set_login_attempted',
- 'was_login_attempted',
- 'verify_identity_status',
-]
+__all__ = ['_encrypt_password', 'create_default_provider',
+ 'current', 'current_provider',
+ 'encrypt_password', 'encrypt_pw_with_algorithm',
+ 'get_identity_errors', 'get_failure_url',
+ 'set_current_identity', 'set_current_provider',
+ 'set_identity_errors', 'set_login_attempted',
+ 'was_login_attempted', 'verify_identity_status']
import logging
Modified: branches/1.5/turbogears/identity/conditions.py
==============================================================================
--- branches/1.5/turbogears/identity/conditions.py Wed Jan 19 04:07:56
2011 (r7211)
+++ branches/1.5/turbogears/identity/conditions.py Wed Jan 19 08:19:48
2011 (r7212)
@@ -1,27 +1,13 @@
"""Definition of the identity predicates."""
-
# declare what should be exported
-__all__ = [
- 'All',
- 'Any',
- 'CompoundPredicate',
- 'IdentityPredicateHelper',
- 'NotAny',
- 'Predicate',
- 'SecureObject',
- 'SecureResource',
- 'from_host',
- 'from_any_host',
- 'in_all_groups',
- 'in_any_group',
- 'in_group',
- 'has_all_permissions',
- 'has_any_permission',
- 'has_permission',
- 'not_anonymous',
- 'require',
-]
+__all__ = ['All', 'Any', 'NotAny', 'CompoundPredicate',
+ 'IdentityPredicateHelper', 'Predicate',
+ 'SecureObject', 'SecureResource',
+ 'from_host', 'from_any_host',
+ 'in_all_groups', 'in_any_group', 'in_group',
+ 'has_all_permissions', 'has_any_permission', 'has_permission',
+ 'not_anonymous', 'require']
import types
Modified: branches/1.5/turbogears/identity/exceptions.py
==============================================================================
--- branches/1.5/turbogears/identity/exceptions.py Wed Jan 19 04:07:56
2011 (r7211)
+++ branches/1.5/turbogears/identity/exceptions.py Wed Jan 19 08:19:48
2011 (r7212)
@@ -1,16 +1,10 @@
"""Identity management exceptions."""
# declare what should be exported
-__all__ = [
- 'IdentityConfigurationException',
- 'IdentityException',
- 'IdentityFailure',
- 'IdentityManagementNotEnabledException',
- 'RequestRequiredException',
- 'get_failure_url',
- 'get_identity_errors',
- 'set_identity_errors',
-]
+__all__ = ['IdentityConfigurationException',
+ 'IdentityException', 'IdentityFailure',
+ 'IdentityManagementNotEnabledException', 'RequestRequiredException',
+ 'get_failure_url', 'get_identity_errors', 'set_identity_errors']
import cherrypy
import turbogears
Modified: branches/1.5/turbogears/identity/visitor.py
==============================================================================
--- branches/1.5/turbogears/identity/visitor.py Wed Jan 19 04:07:56 2011
(r7211)
+++ branches/1.5/turbogears/identity/visitor.py Wed Jan 19 08:19:48 2011
(r7212)
@@ -1,11 +1,7 @@
"""The visit and identity management *plugins* are defined here."""
-__all__ = [
- 'IdentityVisitPlugin',
- 'create_extension_model',
- 'shutdown_extension',
- 'start_extension',
-]
+__all__ = ['IdentityVisitPlugin', 'create_extension_model',
+ 'shutdown_extension', 'start_extension']
import base64
import logging
Modified: branches/1.5/turbogears/release.py
==============================================================================
--- branches/1.5/turbogears/release.py Wed Jan 19 04:07:56 2011 (r7211)
+++ branches/1.5/turbogears/release.py Wed Jan 19 08:19:48 2011 (r7212)
@@ -1,4 +1,5 @@
# -*- coding: UTF-8 -*-
+
"""\
Front-to-back rapid web development
===================================
Modified: branches/1.5/turbogears/scheduler.py
==============================================================================
--- branches/1.5/turbogears/scheduler.py Wed Jan 19 04:07:56 2011
(r7211)
+++ branches/1.5/turbogears/scheduler.py Wed Jan 19 08:19:48 2011
(r7212)
@@ -1,22 +1,9 @@
-# -*- coding: UTF-8 -*-
-
"""Module that provides a cron-like task scheduler."""
-__all__ = [
- 'add_cron_like_task'
- 'add_interval_task',
- 'add_monthday_task',
- 'add_monthly_task',
- 'add_single_task',
- 'add_weekday_task',
- 'add_weekly_task',
- 'cancel',
- 'get_task',
- 'get_tasks',
- 'rename_task',
- 'start_scheduler',
- 'stop_scheduler',
-]
+__all__ = ['add_cron_like_task', 'add_interval_task', 'add_monthday_task',
+ 'add_monthly_task', 'add_single_task', 'add_weekday_task',
+ 'add_weekly_task', 'cancel', 'get_task', 'get_tasks',
+ 'rename_task', 'start_scheduler', 'stop_scheduler']
from tgscheduler.scheduler import (add_cron_like_task, add_interval_task,
add_monthday_task, add_monthly_task, add_single_task,
Modified: branches/1.5/turbogears/startup.py
==============================================================================
--- branches/1.5/turbogears/startup.py Wed Jan 19 04:07:56 2011 (r7211)
+++ branches/1.5/turbogears/startup.py Wed Jan 19 08:19:48 2011 (r7212)
@@ -1,16 +1,9 @@
"""Things to do when the TurboGears server is started."""
-__all__ = [
- 'call_on_startup',
- 'call_on_shutdown',
- 'reloader_thread',
- 'start_bonjour',
- 'stop_bonjour',
- 'start_server',
- 'start_turbogears',
- 'stop_turbogears',
- 'webpath',
-]
+__all__ = ['call_on_startup', 'call_on_shutdown',
+ 'reloader_thread', 'webpath',
+ 'start_bonjour', 'stop_bonjour', 'start_server',
+ 'start_turbogears', 'stop_turbogears']
import atexit
import logging
Modified: branches/1.5/turbogears/testutil.py
==============================================================================
--- branches/1.5/turbogears/testutil.py Wed Jan 19 04:07:56 2011 (r7211)
+++ branches/1.5/turbogears/testutil.py Wed Jan 19 08:19:48 2011 (r7212)
@@ -1,25 +1,10 @@
-# -*- coding: UTF-8 -*-
"""TurboGears Test Utilities."""
-__all__ = [
- 'BrowsingSession',
- 'DBTest',
- 'DBTestSA',
- 'DBTestSO',
- 'DummySession',
- 'TGTest',
- 'capture_log',
- 'make_app',
- 'make_wsgiapp',
- 'mount',
- 'print_log',
- 'get_log',
- 'sqlalchemy_cleanup',
- 'start_server',
- 'stop_server',
- 'unmount'
-]
-
+__all__ = ['BrowsingSession', 'DBTest', 'DBTestSA', 'DBTestSO',
+ 'DummySession', 'TGTest',
+ 'capture_log', 'make_app', 'make_wsgiapp', 'mount',
+ 'print_log', 'get_log', 'sqlalchemy_cleanup',
+ 'start_server', 'stop_server', 'unmount']
import os
import types
Modified: branches/1.5/turbogears/util.py
==============================================================================
--- branches/1.5/turbogears/util.py Wed Jan 19 04:07:56 2011 (r7211)
+++ branches/1.5/turbogears/util.py Wed Jan 19 08:19:48 2011 (r7212)
@@ -1,5 +1,18 @@
"""The TurboGears utility module."""
+_all__ = ['Bunch', 'DictObj', 'DictWrapper', 'Enum', 'setlike',
+ 'get_package_name', 'get_model', 'load_project_config',
+ 'ensure_sequence', 'has_arg', 'to_kw', 'from_kw', 'adapt_call',
+ 'call_on_stack', 'remove_keys', 'arg_index',
+ 'inject_arg', 'inject_args', 'add_tg_args', 'bind_args',
+ 'recursive_update', 'combine_contexts',
+ 'request_available', 'flatten_sequence', 'load_class',
+ 'parse_http_accept_header', 'simplify_http_accept_header',
+ 'to_unicode', 'to_utf8', 'quote_cookie', 'unquote_cookie',
+ 'get_template_encoding_default', 'get_mime_type_for_format',
+ 'mime_type_has_charset', 'find_precision', 'copy_if_mutable',
+ 'match_ip', 'deprecated']
+
import os
import sys
import re
@@ -780,16 +793,3 @@
ip = _inet_prefix(ip, masked)
return ip == cidr
-
-__all__ = ["Bunch", "DictObj", "DictWrapper", "Enum", "setlike",
- "get_package_name", "get_model", "load_project_config",
- "ensure_sequence", "has_arg", "to_kw", "from_kw", "adapt_call",
- "call_on_stack", "remove_keys", "arg_index",
- "inject_arg", "inject_args", "add_tg_args", "bind_args",
- "recursive_update", "combine_contexts",
- "request_available", "flatten_sequence", "load_class",
- "parse_http_accept_header", "simplify_http_accept_header",
- "to_unicode", "to_utf8", "quote_cookie", "unquote_cookie",
- "get_template_encoding_default", "get_mime_type_for_format",
- "mime_type_has_charset", "find_precision", "copy_if_mutable",
- "match_ip", "deprecated"]
Modified: branches/1.5/turbogears/visit/__init__.py
==============================================================================
--- branches/1.5/turbogears/visit/__init__.py Wed Jan 19 04:07:56 2011
(r7211)
+++ branches/1.5/turbogears/visit/__init__.py Wed Jan 19 08:19:48 2011
(r7212)
@@ -1,18 +1,10 @@
"""The TurboGears Visit Framework for tracking visitors from requests."""
# declare what should be exported
-__all__ = [
- 'BaseVisitManager',
- 'Visit',
- 'VisitTool',
- 'create_extension_model',
- 'current',
- 'enable_visit_plugin',
- 'disable_visit_plugin',
- 'set_current',
- 'start_extension',
- 'shutdown_extension',
-]
+__all__ = ['BaseVisitManager', 'Visit', 'VisitTool',
+ 'create_extension_model', 'current', 'enable_visit_plugin',
+ 'disable_visit_plugin', 'set_current',
+ 'start_extension', 'shutdown_extension']
from turbogears.visit.api import (
BaseVisitManager, Visit, VisitTool,
Modified: branches/1.5/turbogears/visit/api.py
==============================================================================
--- branches/1.5/turbogears/visit/api.py Wed Jan 19 04:07:56 2011
(r7211)
+++ branches/1.5/turbogears/visit/api.py Wed Jan 19 08:19:48 2011
(r7212)
@@ -1,18 +1,9 @@
-# -*- coding: UTF-8 -*-
"""Base API of the TurboGears Visit Framework."""
-__all__ = [
- 'BaseVisitManager',
- 'Visit',
- 'VisitTool',
- 'create_extension_model',
- 'current',
- 'enable_visit_plugin',
- 'disable_visit_plugin',
- 'set_current',
- 'start_extension',
- 'shutdown_extension',
-]
+__all__ = ['BaseVisitManager', 'Visit', 'VisitTool',
+ 'create_extension_model', 'current',
+ 'enable_visit_plugin', 'disable_visit_plugin',
+ 'set_current', 'start_extension', 'shutdown_extension']
import logging
Modified: branches/1.5/turbogears/widgets/base.py
==============================================================================
--- branches/1.5/turbogears/widgets/base.py Wed Jan 19 04:07:56 2011
(r7211)
+++ branches/1.5/turbogears/widgets/base.py Wed Jan 19 08:19:48 2011
(r7212)
@@ -1,5 +1,12 @@
"""Base TurboGears widget implementation"""
+__all__ = ['load_widgets', 'all_widgets', 'Widget', 'CompoundWidget',
+ 'WidgetsList', 'register_static_directory', 'static',
+ 'Resource', 'Link', 'CSSLink', 'JSLink',
+ 'Source', 'CSSSource', 'JSSource',
+ 'js_location', 'mochikit', 'jsi18nwidget',
+ 'WidgetDescription', 'set_with_self']
+
import os
import itertools
import warnings
@@ -16,15 +23,6 @@
from turbogears.widgets.meta import MetaWidget, load_template
-__all__ = [
- 'load_widgets', 'all_widgets', 'Widget', 'CompoundWidget',
- 'WidgetsList', 'register_static_directory', 'static',
- 'Resource', 'Link', 'CSSLink', 'JSLink',
- 'Source', 'CSSSource', 'JSSource',
- 'js_location', 'mochikit', 'jsi18nwidget',
- 'WidgetDescription', 'set_with_self']
-
-
class Enum(set):
"""Enum used at js_locations.
Modified: branches/1.5/turbogears/widgets/big_widgets.py
==============================================================================
--- branches/1.5/turbogears/widgets/big_widgets.py Wed Jan 19 04:07:56
2011 (r7211)
+++ branches/1.5/turbogears/widgets/big_widgets.py Wed Jan 19 08:19:48
2011 (r7212)
@@ -1,5 +1,9 @@
"""The bigger TurboGears widgets"""
+__all__ = ['CalendarDatePicker', 'CalendarDateTimePicker',
+ 'AutoCompleteField', 'AutoCompleteTextField',
+ 'LinkRemoteFunction', 'RemoteForm', 'AjaxGrid', 'URLLink']
+
import itertools
from datetime import datetime
@@ -12,11 +16,6 @@
HiddenField, TableForm, CheckBox, RadioButtonList)
from turbogears.widgets.rpc import RPC
-__all__ = [
- 'CalendarDatePicker', 'CalendarDateTimePicker',
- 'AutoCompleteField', 'AutoCompleteTextField',
- 'LinkRemoteFunction', 'RemoteForm', 'AjaxGrid', 'URLLink']
-
class CalendarDatePicker(FormField):
"""Use a Javascript calendar system to allow picking of calendar dates."""
Modified: branches/1.5/turbogears/widgets/datagrid.py
==============================================================================
--- branches/1.5/turbogears/widgets/datagrid.py Wed Jan 19 04:07:56 2011
(r7211)
+++ branches/1.5/turbogears/widgets/datagrid.py Wed Jan 19 08:19:48 2011
(r7212)
@@ -1,12 +1,12 @@
"""Generic widget to present and manipulate data in a grid (tabular) form."""
+__all__ = ['DataGrid', 'PaginateDataGrid']
+
from turbogears.widgets import Widget, CSSLink, static
from turbogears.widgets.base import CoreWD
NoDefault = object()
-__all__ = ['DataGrid', 'PaginateDataGrid']
-
class DataGrid(Widget):
"""Generic widget to present and manipulate data in a grid (tabular) form.
Modified: branches/1.5/turbogears/widgets/forms.py
==============================================================================
--- branches/1.5/turbogears/widgets/forms.py Wed Jan 19 04:07:56 2011
(r7211)
+++ branches/1.5/turbogears/widgets/forms.py Wed Jan 19 08:19:48 2011
(r7212)
@@ -1,11 +1,5 @@
"""TurboGears widgets for HTML forms"""
-from cherrypy import request
-from turbogears import validators, expose
-from turbogears.util import Bunch, request_available
-from turbogears.widgets.base import (Widget, CompoundWidget, WidgetsList,
- CoreWD, RenderOnlyWD)
-
__all__ = [
'InputWidget', 'CompoundInputWidget', 'RepeatingInputWidget',
'FormField', 'FormFieldsContainer', 'CompoundFormField',
@@ -16,6 +10,12 @@
'RadioButtonList', 'CheckBoxList', 'FieldSet',
'RepeatingFieldSet', 'Form', 'TableForm', 'ListForm', 'WidgetsList']
+from cherrypy import request
+from turbogears import validators, expose
+from turbogears.util import Bunch, request_available
+from turbogears.widgets.base import (Widget, CompoundWidget, WidgetsList,
+ CoreWD, RenderOnlyWD)
+
#############################################################################
# Functions and classes to manage input widgets #
Modified: branches/1.5/turbogears/widgets/i18n.py
==============================================================================
--- branches/1.5/turbogears/widgets/i18n.py Wed Jan 19 04:07:56 2011
(r7211)
+++ branches/1.5/turbogears/widgets/i18n.py Wed Jan 19 08:19:48 2011
(r7212)
@@ -1,5 +1,7 @@
"""Internationalization support for TurboGears widgets"""
+__all__ = ['LocalizableJSLink', 'CalendarLangFileLink']
+
import os
import codecs
from cherrypy import request
@@ -8,8 +10,6 @@
from turbogears.util import parse_http_accept_header
from turbogears.widgets.base import JSLink, CoreWD, RenderOnlyWD
-__all__ = ["LocalizableJSLink", "CalendarLangFileLink"]
-
class LocalizableJSLink(JSLink):
"""Provides a simple way to include language-specific data in your JS code.
Modified: branches/1.5/turbogears/widgets/links.py
==============================================================================
--- branches/1.5/turbogears/widgets/links.py Wed Jan 19 04:07:56 2011
(r7211)
+++ branches/1.5/turbogears/widgets/links.py Wed Jan 19 08:19:48 2011
(r7212)
@@ -1,13 +1,13 @@
"""TurboGears widgets for building menus"""
+__all__ = ['Tabber', 'SyntaxHighlighter', 'JumpMenu']
+
import warnings
from turbojson.jsonify import encode
from turbogears.widgets.base import (CSSLink, JSLink, CSSSource, JSSource,
Widget, CoreWD, static, js_location)
from turbogears.widgets.forms import SelectionField
-__all__ = ['Tabber', 'SyntaxHighlighter', 'JumpMenu']
-
class Tabber(Widget):
"""A tabbed-panel widget.
Modified: branches/1.5/turbogears/widgets/meta.py
==============================================================================
--- branches/1.5/turbogears/widgets/meta.py Wed Jan 19 04:07:56 2011
(r7211)
+++ branches/1.5/turbogears/widgets/meta.py Wed Jan 19 08:19:48 2011
(r7212)
@@ -1,5 +1,7 @@
"""Metaclass for TurboGears widgets and support for external packages"""
+__all__ = ['MetaWidget', 'load_template']
+
import copy
import threading
import re
@@ -12,8 +14,6 @@
from turbogears.util import setlike
from formencode.schema import Schema
-__all__ = ['MetaWidget', 'load_template']
-
default_engine = 'genshi'
param_prefix = '_param_'
Modified: branches/1.5/turbogears/widgets/rpc.py
==============================================================================
--- branches/1.5/turbogears/widgets/rpc.py Wed Jan 19 04:07:56 2011
(r7211)
+++ branches/1.5/turbogears/widgets/rpc.py Wed Jan 19 08:19:48 2011
(r7212)
@@ -1,10 +1,10 @@
"""TurboGears RPC base widget"""
+__all__ = ['RPC']
+
from turbogears.widgets.base import Widget, JSLink, static, mochikit
from turbojson import jsonify
-__all__ = ['RPC']
-
class RPC(Widget):
"""RPC base widget."""