Back to index

plone3  3.1.7
Classes | Functions | Variables
ResourceRegistries.tools.BaseRegistry Namespace Reference

Classes

class  Resource
class  Skin
class  BaseRegistryTool

Functions

def getDummyFileForContent
def getCharsetFromContentType

Variables

 __five__ = False
 __five_pre_1_3_ = True
 __five_pre_1_3__ = False

Function Documentation

def ResourceRegistries.tools.BaseRegistry.getCharsetFromContentType (   contenttype,
  default = 'utf-8' 
)

Definition at line 58 of file BaseRegistry.py.

00058 
00059 def getCharsetFromContentType(contenttype, default='utf-8'):
00060     contenttype = contenttype.lower()
00061     if 'charset=' in contenttype:
00062         i = contenttype.index('charset=')
00063         charset = contenttype[i+8:]
00064         charset = charset.split(';')[0]
00065         return charset
00066     else:
00067         return default

Here is the caller graph for this function:

Definition at line 51 of file BaseRegistry.py.

00051 
00052 def getDummyFileForContent(name, ctype):
00053     # make output file like and add an headers dict, so the contenttype
00054     # is properly set in the headers
00055     output = StringIO()
00056     output.headers = {'content-type': ctype}
00057     return File(name, name, output)

Here is the caller graph for this function:


Variable Documentation

Definition at line 36 of file BaseRegistry.py.

Definition at line 43 of file BaseRegistry.py.

Definition at line 47 of file BaseRegistry.py.