FoxDot.lib.Workspace.Format

FoxDot.lib.Workspace.Format.find_comment(line)[source]

Finds the index of a comment # and returns None if not found

FoxDot.lib.Workspace.Format.find_multiline(text)[source]
FoxDot.lib.Workspace.Format.findstyles(line, *args)[source]

Finds any locations of any regex and returns the name of the style and the start and end point in the line

FoxDot.lib.Workspace.Format.get_keywords()[source]
FoxDot.lib.Workspace.Format.path(fn)[source]
FoxDot.lib.Workspace.Format.re_list(string, br='[]')[source]
FoxDot.lib.Workspace.Format.re_pat(string)[source]
FoxDot.lib.Workspace.Format.userdefined(line)[source]

Returns the name of a user defined function or class in a string i.e. def foo(x) -> foo

FoxDot.lib.Workspace.Format.user_defn = '(?<=def )(\\w+)'

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to ‘utf-8’. errors defaults to ‘strict’.

FoxDot.lib.Workspace.Format.players = '(?<=>>)(\\s*\\w+)'

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to ‘utf-8’. errors defaults to ‘strict’.

FoxDot.lib.Workspace.Format.comments = '^\\s*#.*|[^\\"\']*(#[^\\"\']*$)'

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to ‘utf-8’. errors defaults to ‘strict’.

FoxDot.lib.Workspace.Format.decorator = '\\A\\s*@.+'

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to ‘utf-8’. errors defaults to ‘strict’.

FoxDot.lib.Workspace.Format.numbers = '\\W+(\\d+)'

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to ‘utf-8’. errors defaults to ‘strict’.

FoxDot.lib.Workspace.Format.strings = '\\".*?\\"|\\".*|\'.*?\'|\'.*'

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to ‘utf-8’. errors defaults to ‘strict’.

FoxDot.lib.Workspace.Format.dollar = '\\s\\$\\s?'

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to ‘utf-8’. errors defaults to ‘strict’.

FoxDot.lib.Workspace.Format.arrow = '\\s>>\\s?'

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to ‘utf-8’. errors defaults to ‘strict’.

FoxDot.lib.Workspace.Format.multiline = '\\"\\"\\".*\\"\\"\\"|\'\'\'.*\'\'\''

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to ‘utf-8’. errors defaults to ‘strict’.

FoxDot.lib.Workspace.Format.foxdot_kw = ['Clock', 'Group', 'Scale', 'Server', 'Root', 'Samples', 'var', 'Pvar', 'Attributes', 'PatternMethods', 'PatternTypes', 'now', 'linvar', 'expvar', 'mapvar', 'sinvar', 'inf', 'when', 'lambda', 'λ', '\\A\\s*@.+']

Built-in mutable sequence.

If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.

FoxDot.lib.Workspace.Format.foxdot_funcs = ['URLError', 'Version', 'dots', 'POperand', 'metaPattern', 'Pattern', 'Cycle', 'PGroup', 'GeneratorPattern', 'PatternContainer', 'EmptyItem', 'GeneratorPattern', 'Pattern', 'RandomGenerator', 'PRand', 'PWhite', 'PxRand', 'PwRand', 'PChain', 'PZ12', 'PTree', 'PWalk', 'PDelta', 'PSquare', 'PIndex', 'PFibMod', 'deepcopy', 'dataclass', 'field', 'urlopen', 'is_version_greather', 'get_pypi_version', 'stdout', 'sliceToRange', 'LCM', 'EuclidsAlgorithm', 'PulsesToDurations', 'get_first_item', 'modi', 'get_expanded_len', 'max_length', 'get_inverse_op', 'isiterable', 'recursive_any', 'DominantPattern', 'Nil', 'Add', 'Sub', 'Mul', 'Div', 'Mod', 'Pow', 'Get', 'FloorDiv', 'Xor', 'Or', 'rAdd', 'rGet', 'rSub', 'rMul', 'rDiv', 'rMod', 'rPow', 'rFloorDiv', 'rXor', 'rOr', 'PEq', 'PNe', 'loop_pattern_func', 'loop_pattern_method', 'PatternMethod', 'StaticPatternMethod', 'ClassPatternMethod', 'asStream', 'PatternFormat', 'PatternInput', 'Format', 'convert_nested_data', 'patternclass', 'Convert', 'asPattern', 'pattern_depth', 'equal_values', 'group_modi', 'get_avg_if', 'sum_delays', 'force_pattern_args', 'PShuf', 'PAlt', 'PStretch', 'PPairs', 'PZip', 'PZip2', 'PStutter', 'PSq', 'P10', 'PStep', 'PSum', 'PRange', 'PTri', 'PSine', 'PEuclid', 'PEuclid2', 'PBern', 'PBeat', 'PDur', 'PDelay', 'PStrum', 'PQuicken', 'PRhythm', 'PJoin', 'P']

Built-in mutable sequence.

If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.

FoxDot.lib.Workspace.Format.py_indent_kw = ['for', 'if', 'elif', 'else', 'def', 'while', 'class', 'try', 'except']

Built-in mutable sequence.

If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.

FoxDot.lib.Workspace.Format.py_functions = ['if', 'elif', 'else', 'return', 'def', 'print', 'when', 'from', 'and', 'or', 'not', 'is', 'in', 'for', 'as', 'with', 'global', 'while', 'class', 'import', 'try', 'except', 'from', 'break']

Built-in mutable sequence.

If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.

FoxDot.lib.Workspace.Format.py_other_kws = ['Clock', 'Group', 'Scale', 'Server', 'Root', 'Samples', 'var', 'Pvar', 'Attributes', 'PatternMethods', 'PatternTypes', 'now', 'linvar', 'expvar', 'mapvar', 'sinvar', 'inf', 'when', 'lambda', 'λ', '\\A\\s*@.+', 'True', 'False', 'None', 'self']

Built-in mutable sequence.

If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.

FoxDot.lib.Workspace.Format.py_key_types = ['URLError', 'Version', 'dots', 'POperand', 'metaPattern', 'Pattern', 'Cycle', 'PGroup', 'GeneratorPattern', 'PatternContainer', 'EmptyItem', 'GeneratorPattern', 'Pattern', 'RandomGenerator', 'PRand', 'PWhite', 'PxRand', 'PwRand', 'PChain', 'PZ12', 'PTree', 'PWalk', 'PDelta', 'PSquare', 'PIndex', 'PFibMod', 'deepcopy', 'dataclass', 'field', 'urlopen', 'is_version_greather', 'get_pypi_version', 'stdout', 'sliceToRange', 'LCM', 'EuclidsAlgorithm', 'PulsesToDurations', 'get_first_item', 'modi', 'get_expanded_len', 'max_length', 'get_inverse_op', 'isiterable', 'recursive_any', 'DominantPattern', 'Nil', 'Add', 'Sub', 'Mul', 'Div', 'Mod', 'Pow', 'Get', 'FloorDiv', 'Xor', 'Or', 'rAdd', 'rGet', 'rSub', 'rMul', 'rDiv', 'rMod', 'rPow', 'rFloorDiv', 'rXor', 'rOr', 'PEq', 'PNe', 'loop_pattern_func', 'loop_pattern_method', 'PatternMethod', 'StaticPatternMethod', 'ClassPatternMethod', 'asStream', 'PatternFormat', 'PatternInput', 'Format', 'convert_nested_data', 'patternclass', 'Convert', 'asPattern', 'pattern_depth', 'equal_values', 'group_modi', 'get_avg_if', 'sum_delays', 'force_pattern_args', 'PShuf', 'PAlt', 'PStretch', 'PPairs', 'PZip', 'PZip2', 'PStutter', 'PSq', 'P10', 'PStep', 'PSum', 'PRange', 'PTri', 'PSine', 'PEuclid', 'PEuclid2', 'PBern', 'PBeat', 'PDur', 'PDelay', 'PStrum', 'PQuicken', 'PRhythm', 'PJoin', 'P', 'abs', 'divmod', 'input', 'open', 'staticmethod', 'all', 'enumerate', 'int', 'ord', 'str', 'any', 'eval', 'isinstance', 'pow', 'sum', 'basestring', 'execfile', 'issubclass', 'super', 'bin', 'file', 'iter', 'property', 'tuple', 'bool', 'filter', 'len', 'range', 'type', 'bytearray', 'float', 'list', 'raw_input', 'unichr', 'callable', 'format', 'locals', 'reduce', 'unicode', 'chr', 'frozenset', 'long', 'reload', 'vars', 'classmethod', 'getattr', 'map', 'repr', 'xrange', 'cmp', 'globals', 'max', 'reversed', 'zip', 'compile', 'hasattr', 'memoryview', 'round', '__import__', 'complex', 'hash', 'min', 'delattr', 'set', 'help', 'next', 'setattr', 'dict', 'hex', 'object', 'slice', 'dir', 'id', 'sorted']

Built-in mutable sequence.

If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.

FoxDot.lib.Workspace.Format.py_separators = ['[', ']', '(', ')', '{', '}', ',', '.', '/', '*', '+', '=', '-', ' ', '\t', '\n']

Built-in mutable sequence.

If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.

FoxDot.lib.Workspace.Format.py_whitespace = [' ', '\t', '\n', '\r', '\x0c', '\x0b']

Built-in mutable sequence.

If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.

FoxDot.lib.Workspace.Format.left_b = ['(', '[', '{', "'", '"']

Built-in mutable sequence.

If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.

FoxDot.lib.Workspace.Format.right_b = [')', ']', '}', "'", '"']

Built-in mutable sequence.

If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.

FoxDot.lib.Workspace.Format.brackets = {')': '(', ']': '[', '}': '{'}

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s

(key, value) pairs

dict(iterable) -> new dictionary initialized as if via:

d = {} for k, v in iterable:

d[k] = v

dict(**kwargs) -> new dictionary initialized with the name=value pairs

in the keyword argument list. For example: dict(one=1, two=2)

FoxDot.lib.Workspace.Format.tabsize = 4

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer iteral. >>> int(‘0b100’, base=0) 4

FoxDot.lib.Workspace.Format.functions = '(?<![a-zA-Z._])(if|elif|else|return|def|print|when|from|and|or|not|is|in|for|as|with|global|while|class|import|try|except|from|break)(?![_a-zA-Z])'

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to ‘utf-8’. errors defaults to ‘strict’.

FoxDot.lib.Workspace.Format.key_types = '(?<![a-zA-Z._])(URLError|Version|dots|POperand|metaPattern|Pattern|Cycle|PGroup|GeneratorPattern|PatternContainer|EmptyItem|GeneratorPattern|Pattern|RandomGenerator|PRand|PWhite|PxRand|PwRand|PChain|PZ12|PTree|PWalk|PDelta|PSquare|PIndex|PFibMod|deepcopy|dataclass|field|urlopen|is_version_greather|get_pypi_version|stdout|sliceToRange|LCM|EuclidsAlgorithm|PulsesToDurations|get_first_item|modi|get_expanded_len|max_length|get_inverse_op|isiterable|recursive_any|DominantPattern|Nil|Add|Sub|Mul|Div|Mod|Pow|Get|FloorDiv|Xor|Or|rAdd|rGet|rSub|rMul|rDiv|rMod|rPow|rFloorDiv|rXor|rOr|PEq|PNe|loop_pattern_func|loop_pattern_method|PatternMethod|StaticPatternMethod|ClassPatternMethod|asStream|PatternFormat|PatternInput|Format|convert_nested_data|patternclass|Convert|asPattern|pattern_depth|equal_values|group_modi|get_avg_if|sum_delays|force_pattern_args|PShuf|PAlt|PStretch|PPairs|PZip|PZip2|PStutter|PSq|P10|PStep|PSum|PRange|PTri|PSine|PEuclid|PEuclid2|PBern|PBeat|PDur|PDelay|PStrum|PQuicken|PRhythm|PJoin|P|abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|eval|isinstance|pow|sum|basestring|execfile|issubclass|super|bin|file|iter|property|tuple|bool|filter|len|range|type|bytearray|float|list|raw_input|unichr|callable|format|locals|reduce|unicode|chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|__import__|complex|hash|min|delattr|set|help|next|setattr|dict|hex|object|slice|dir|id|sorted)(?![_a-zA-Z])'

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to ‘utf-8’. errors defaults to ‘strict’.

FoxDot.lib.Workspace.Format.other_kws = '(?<![a-zA-Z._])(Clock|Group|Scale|Server|Root|Samples|var|Pvar|Attributes|PatternMethods|PatternTypes|now|linvar|expvar|mapvar|sinvar|inf|when|lambda|λ|\\A\\s*@.+|True|False|None|self)(?![_a-zA-Z])'

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to ‘utf-8’. errors defaults to ‘strict’.

FoxDot.lib.Workspace.Format.colour_map = {'arrow': '#eae02a', 'background': '#1a1a1a', 'comments': '#666666', 'dollar': '#ec4e20', 'functions': '#bf4acc', 'key_types': '#29abe2', 'numbers': '#e89c18', 'other_kws': '#49db8b', 'plaintext': '#ffffff', 'players': '#ec4e20', 'strings': '#eae02a', 'user_defn': '#29abe2'}

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s

(key, value) pairs

dict(iterable) -> new dictionary initialized as if via:

d = {} for k, v in iterable:

d[k] = v

dict(**kwargs) -> new dictionary initialized with the name=value pairs

in the keyword argument list. For example: dict(one=1, two=2)

FoxDot.lib.Workspace.Format.re_patterns = {'arrow': '\\s>>\\s?', 'dollar': '\\s\\$\\s?', 'functions': '(?<![a-zA-Z._])(if|elif|else|return|def|print|when|from|and|or|not|is|in|for|as|with|global|while|class|import|try|except|from|break)(?![_a-zA-Z])', 'key_types': '(?<![a-zA-Z._])(URLError|Version|dots|POperand|metaPattern|Pattern|Cycle|PGroup|GeneratorPattern|PatternContainer|EmptyItem|GeneratorPattern|Pattern|RandomGenerator|PRand|PWhite|PxRand|PwRand|PChain|PZ12|PTree|PWalk|PDelta|PSquare|PIndex|PFibMod|deepcopy|dataclass|field|urlopen|is_version_greather|get_pypi_version|stdout|sliceToRange|LCM|EuclidsAlgorithm|PulsesToDurations|get_first_item|modi|get_expanded_len|max_length|get_inverse_op|isiterable|recursive_any|DominantPattern|Nil|Add|Sub|Mul|Div|Mod|Pow|Get|FloorDiv|Xor|Or|rAdd|rGet|rSub|rMul|rDiv|rMod|rPow|rFloorDiv|rXor|rOr|PEq|PNe|loop_pattern_func|loop_pattern_method|PatternMethod|StaticPatternMethod|ClassPatternMethod|asStream|PatternFormat|PatternInput|Format|convert_nested_data|patternclass|Convert|asPattern|pattern_depth|equal_values|group_modi|get_avg_if|sum_delays|force_pattern_args|PShuf|PAlt|PStretch|PPairs|PZip|PZip2|PStutter|PSq|P10|PStep|PSum|PRange|PTri|PSine|PEuclid|PEuclid2|PBern|PBeat|PDur|PDelay|PStrum|PQuicken|PRhythm|PJoin|P|abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|eval|isinstance|pow|sum|basestring|execfile|issubclass|super|bin|file|iter|property|tuple|bool|filter|len|range|type|bytearray|float|list|raw_input|unichr|callable|format|locals|reduce|unicode|chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|__import__|complex|hash|min|delattr|set|help|next|setattr|dict|hex|object|slice|dir|id|sorted)(?![_a-zA-Z])', 'numbers': '\\W+(\\d+)', 'other_kws': '(?<![a-zA-Z._])(Clock|Group|Scale|Server|Root|Samples|var|Pvar|Attributes|PatternMethods|PatternTypes|now|linvar|expvar|mapvar|sinvar|inf|when|lambda|λ|\\A\\s*@.+|True|False|None|self)(?![_a-zA-Z])', 'players': '(?<=>>)(\\s*\\w+)', 'strings': '\\".*?\\"|\\".*|\'.*?\'|\'.*', 'user_defn': '(?<=def )(\\w+)'}

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s

(key, value) pairs

dict(iterable) -> new dictionary initialized as if via:

d = {} for k, v in iterable:

d[k] = v

dict(**kwargs) -> new dictionary initialized with the name=value pairs

in the keyword argument list. For example: dict(one=1, two=2)

FoxDot.lib.Workspace.Format.bracket_formatting = {'borderwidth': 2, 'relief': 'groove'}

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s

(key, value) pairs

dict(iterable) -> new dictionary initialized as if via:

d = {} for k, v in iterable:

d[k] = v

dict(**kwargs) -> new dictionary initialized with the name=value pairs

in the keyword argument list. For example: dict(one=1, two=2)

FoxDot.lib.Workspace.Format.tag_weights = [['numbers'], ['key_types', 'functions', 'user_defn', 'other_kws', 'dollar', 'arrow', 'players'], ['strings'], ['comments']]

Built-in mutable sequence.

If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.