Package translate :: Package filters :: Module decoration

[hide private]
[frames] | no frames]

# Module decoration

source code

functions to get decorative/informative text out of strings...

Functions | [hide private]

spacestart(str1) returns all the whitespace from the start of the string | source code

spaceend(str1) returns all the whitespace from the end of the string | source code

puncstart(str1, punctuation) returns all the punctuation from the start of the string | source code

puncend(str1, punctuation) returns all the punctuation from the end of the string | source code

ispurepunctuation(str1) checks whether the string is entirely punctuation | source code

Boolean

isvalidaccelerator(accelerator, acceptlist=None) returns whether the given accelerator character is valid | source code

findaccelerators(str1, accelmarker, acceptlist=None) returns all the accelerators and locations in str1 marked with a given marker | source code

findmarkedvariables(str1, startmarker, endmarker, ignorelist=`[``]`) returns all the variables and locations in str1 marked with a given marker | source code

getaccelerators(accelmarker, acceptlist=None) returns a function that gets a list of accelerators marked using accelmarker | source code

getvariables(startmarker, endmarker) returns a function that gets a list of variables marked using startmarker and endmarker | source code

getnumbers(str1) returns any numbers that are in the string | source code

getfunctions(str1) returns the functions() that are in a string, while ignoring the trailing punctuation in the given parameter | source code

getemails(str1) returns the email addresses that are in a string | source code

geturls(str1) returns the URIs in a string | source code

countaccelerators(accelmarker, acceptlist=None) returns a function that counts the number of accelerators marked with the given marker | source code

Variables | [hide private]

| _function_re = `re.compile(r'`(?x)``(``(?:``[`\w\.`]``+``(?:``(?:`::`|`->`|`\.`)`\w`+``)``...``

Imports: re, unicodedata, data

Function Details | [hide private]

### isvalidaccelerator(accelerator, acceptlist=None)

source code

returns whether the given accelerator character is valid

Parameters:
  - `accelerator` (character) - A character to be checked for accelerator validity
  - `acceptlist` (String) - A list of characters that are permissible as accelerators
Returns: Boolean
  True if the supplied character is an acceptable accelerator

Variables Details | [hide private]

### _function_re

Value:

      re.compile(r'(?x)((?:[\w\.]+(?:(?:::|->|\.)\w+)*\(\))+)')