This module provides helpful functions and classes for use in Python
Scripts. It can be accessed from Python with the statement "import
Products.zms.standard"
str
|
umlaut_quote(self,
s,
mapping={})
Replace umlauts in s using given mapping. |
|
|
str
|
string_maxlen(s,
maxlen=20,
etc='...',
encoding=None)
Returns string with specified maximum-length. |
|
|
str
|
url_encode(url)
All unsafe characters must always be encoded within a URL. |
|
|
tuple
|
guess_content_type(filename,
data)
Guess the type of a file based on its filename and the data. |
|
|
|
html_quote(v,
name='(Unknown name)',
md={}) |
|
|
str
|
bin2hex(m)
Returns a string with the hexadecimal representation of integer m. |
|
|
str
|
hex2bin(m)
Converts a hexadecimal-string m to an integer. |
|
|
list
|
|
str
|
|
str
|
encrypt_ordtype(s)
Encrypts given string with entities by random algorithm. |
|
|
int
|
rand_int(n)
Random integer in given range. |
|
|
|
|
str
|
id_prefix(s)
Returns prefix from identifier (which is the non-numeric part at the
beginning). |
|
|
|
|
|
objectTree(self,
clients=False) |
|
|
|
form_quote(text,
REQUEST) |
|
|
|
|
any
|
nvl(a1,
a2,
n=None)
Returns its first argument if it is not equal to third argument
(None), otherwise it returns its second argument. |
|
|
|
|
|
triggerEvent(self,
*args,
**kwargs) |
|
|
Bool
|
isManagementInterface(REQUEST)
Returns true if current context is management-interface, false else. |
|
|
Bool
|
isPreviewRequest(REQUEST)
Returns true if current context is preview-request, false else. |
|
|
|
|
str
|
http_import(self,
url,
method='GET',
auth=None,
parse_qs=0,
timeout=10,
headers={'Accept': '*/*'})
Send Http-Request and return Response-Body. |
|
|
|
|
|
|
|
|
|
|
|
|
str
|
re_sub(pattern,
replacement,
subject,
ignorecase=False)
Performs a search-and-replace across subject, replacing all matches
of regex in subject with replacement. |
|
|
str
|
re_search(pattern,
subject,
ignorecase=False)
Scan through string looking for a location where the regular
expression pattern produces a match, and return a corresponding
MatchObject instance. |
|
|
str
|
re_findall(pattern,
text,
ignorecase=False)
Return all non-overlapping matches of pattern in string, as a list of
strings. |
|
|
|
|
|
getLangFmtDate(self,
t,
lang=None,
fmt_str='SHORTDATETIME_FMT')
Formats date in locale-format |
|
|
|
getDateTime(t)
Bei Python 2.2 ist der Typ der Objekte des Moduls "time"
nicht mehr "tuple", sondern "time.struct_time". |
|
|
|
stripDateTime(t)
Strips time portion from date-time and returns date. |
|
|
int
|
daysBetween(t0,
t1)
Returns number of days between date t0 and t1. |
|
|
|
compareDate(t0,
t1)
Compares two dates t0 and t1 and returns result. |
|
|
struct_time
|
parseLangFmtDate(s)
Parse date in locale-format |
|
|
type
|
|
type
|
|
dict
|
|
any
|
operator_getitem(a,
b,
c=None,
ignorecase=True)
Retrieves value for key from python-dictionary. |
|
|
|
|
object
|
|
any
|
|
|
|
list
|
|
list
|
|
list
|
|
dict
|
dict_list(l)
Converts list to dictionary: key=l[x*2], value=l[x*2+1] |
|
|
list
|
distinct_list(l,
i=None)
Returns distinct values of given field from list. |
|
|
list
|
sort_list(l,
qorder=None,
qorderdir='asc',
ignorecase=1)
Sorts list by given field. |
|
|
list
|
string_list(s,
sep='\n',
trim=True)
Split string by given separator and trim items. |
|
|
str
|
str_json(i,
encoding='ascii',
errors='xmlcharrefreplace',
formatted=False,
level=0)
Returns a json-string representation of the object. |
|
|
str
|
str_item(i)
Returns a string representation of the item. |
|
|
list
|
filter_list(l,
i,
v,
o='%')
Filters list by given field. |
|
|
list
|
|
|
sync_list(l,
nl,
i)
Synchronizes list l with new list nl using the column i as
identifier. |
|
|
|
aggregate_list(l,
i)
Aggregates given field in list. |
|
|