app/soc/views/helpers/templates_helpers.py
author Todd Larsen <tlarsen@google.com>
Thu, 28 Aug 2008 21:35:34 +0000
changeset 114 9998e95ce609
parent 99 8c38b546a3cf
permissions -rw-r--r--
A collection of functions for determining the characteristics of the "system" on which a Melange application is running. Currently, this consists of only a boolean isDebug() function. Patch by: Todd Larsen Review by: to-be-reviewed
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
99
8c38b546a3cf Added public view support (not using controller yet)
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
     1
#!/usr/bin/python2.5
8c38b546a3cf Added public view support (not using controller yet)
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
     2
#
8c38b546a3cf Added public view support (not using controller yet)
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
     3
# Copyright 2008 the Melange authors.
8c38b546a3cf Added public view support (not using controller yet)
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
     4
#
8c38b546a3cf Added public view support (not using controller yet)
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
     5
# Licensed under the Apache License, Version 2.0 (the "License");
8c38b546a3cf Added public view support (not using controller yet)
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
     6
# you may not use this file except in compliance with the License.
8c38b546a3cf Added public view support (not using controller yet)
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
     7
# You may obtain a copy of the License at
8c38b546a3cf Added public view support (not using controller yet)
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
     8
#
8c38b546a3cf Added public view support (not using controller yet)
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
     9
#   http://www.apache.org/licenses/LICENSE-2.0
8c38b546a3cf Added public view support (not using controller yet)
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    10
#
8c38b546a3cf Added public view support (not using controller yet)
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    11
# Unless required by applicable law or agreed to in writing, software
8c38b546a3cf Added public view support (not using controller yet)
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    12
# distributed under the License is distributed on an "AS IS" BASIS,
8c38b546a3cf Added public view support (not using controller yet)
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    13
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8c38b546a3cf Added public view support (not using controller yet)
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    14
# See the License for the specific language governing permissions and
8c38b546a3cf Added public view support (not using controller yet)
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    15
# limitations under the License.
8c38b546a3cf Added public view support (not using controller yet)
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    16
8c38b546a3cf Added public view support (not using controller yet)
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    17
"""Helpers used with templates.
8c38b546a3cf Added public view support (not using controller yet)
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    18
"""
8c38b546a3cf Added public view support (not using controller yet)
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    19
8c38b546a3cf Added public view support (not using controller yet)
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    20
__authors__ = [
8c38b546a3cf Added public view support (not using controller yet)
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    21
  '"Todd Larsen" <tlarsen@google.com>',
8c38b546a3cf Added public view support (not using controller yet)
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    22
  '"Pawel Solyga" <pawel.solyga@gmail.com',
8c38b546a3cf Added public view support (not using controller yet)
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    23
  ]
8c38b546a3cf Added public view support (not using controller yet)
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    24
8c38b546a3cf Added public view support (not using controller yet)
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    25
8c38b546a3cf Added public view support (not using controller yet)
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    26
def makeSiblingTemplatePath(template_path, view_template):
8c38b546a3cf Added public view support (not using controller yet)
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    27
  """Replaces the template name at the end of template_path with
8c38b546a3cf Added public view support (not using controller yet)
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    28
     view_template argument.
8c38b546a3cf Added public view support (not using controller yet)
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    29
  """
8c38b546a3cf Added public view support (not using controller yet)
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    30
  #TODO(solydzajs) : implements this funtion
8c38b546a3cf Added public view support (not using controller yet)
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    31
  return