Welcome to Jasy – Web Tooling Framework’s documentation!

Contents:

jasy package

Subpackages

jasy.abstract package

Submodules
jasy.abstract.Resolver module
class jasy.abstract.Resolver.Resolver(profile)[source]

Bases: object

Resolves dependencies between items.

This class is not type depended e.g. is used for both scripts and styles.

add(nameOrItem, prepend=False)[source]

Adds an item by its name or via the item instance.

exclude(items)[source]

Excludes the given items (just a hard-exclude which is applied after calculating the current dependencies)

getIncluded()[source]

Returns a final set of classes after resolving dependencies.

getRequired()[source]

Returns the user added classes - the so-called required classes.

remove(nameOrItem)[source]

Removes an item via its name or via the item instance.

exception jasy.abstract.Resolver.ResolverError[source]

Bases: Exception

Error which is throws when resolving items could be be finished because of items which could not be found or are of an unexpected type.

jasy.abstract.Sorter module
class jasy.abstract.Sorter.AbstractSorter(resolver)[source]

Bases: object

Sorts a final list of items according to their requirements.

This class is not type depended e.g. is used for both scripts and styles.

getSorted()[source]

Returns the sorted item list (caches result)

exception jasy.abstract.Sorter.SorterError[source]

Bases: Exception

Error which is throws when sorting could not be done because of circular dependencies.

Module contents

jasy.asset package

Subpackages
jasy.asset.sprite package
Submodules
jasy.asset.sprite.Block module
class jasy.asset.sprite.Block.Block(w, h, image=False)[source]

Bases: object

toJSON()[source]
jasy.asset.sprite.BlockNode module
class jasy.asset.sprite.BlockNode.BlockNode(parent, x, y, w, h)[source]

Bases: object

jasy.asset.sprite.BlockPacker module
class jasy.asset.sprite.BlockPacker.BlockPacker(w=0, h=0)[source]

Bases: object

findNode(root, w, h)[source]
fit(blocks)[source]
getUnused()[source]
growDown(w, h)[source]
growNode(w, h)[source]
growRight(w, h)[source]
splitNode(node, w, h)[source]
jasy.asset.sprite.File module
class jasy.asset.sprite.File.SpriteFile(width, height, relPath, fullPath, checksum)[source]

Bases: object

jasy.asset.sprite.Sheet module
class jasy.asset.sprite.Sheet.SpriteSheet(packer, blocks)[source]

Bases: object

export()[source]
write(filename, debug=False)[source]
Module contents
Submodules
jasy.asset.ImageInfo module
class jasy.asset.ImageInfo.GifFile(filename)[source]

Bases: jasy.asset.ImageInfo.ImgFile

Class for parsing GIF files.

size()[source]
type()[source]
verify()[source]
class jasy.asset.ImageInfo.ImgFile(filename)[source]

Bases: object

Abstract base class for all image types.

close()[source]
getChecksum()[source]
size()[source]
type()[source]
verify()[source]
class jasy.asset.ImageInfo.ImgInfo(filename)[source]

Bases: object

classes = [<class 'jasy.asset.ImageInfo.PngFile'>, <class 'jasy.asset.ImageInfo.GifFile'>, <class 'jasy.asset.ImageInfo.JpegFile'>]
getChecksum()[source]
getInfo()[source]

Returns (width, height, “type”) of the image.

getSize()[source]

Returns the image sizes of png, gif and jpeg files as.

(width, height) tuple

class jasy.asset.ImageInfo.JpegFile(filename)[source]

Bases: jasy.asset.ImageInfo.ImgFile

size()[source]
type()[source]
verify()[source]
class jasy.asset.ImageInfo.PngFile(filename)[source]

Bases: jasy.asset.ImageInfo.ImgFile

Class for parsing PNG files.

size()[source]
type()[source]
verify()[source]
jasy.asset.Manager module
class jasy.asset.Manager.AssetManager(profile)[source]

Bases: object

addProject(project)[source]
copyAssets()[source]

Copies assets from their source folder to the configured destination folder.

Does apply file name transformations during copying when requested.

exportToJson(items=None)[source]

Exports asset data for usage at the client side.

Utilizes JavaScript class jasy.Asset to inject data into the client at runtime.

getAnimationColumns(fileId)[source]
getAnimationFrames(fileId)[source]
getAnimationRows(fileId)[source]
getAssetHeight(fileId)[source]

Returns the width (image height) of the given item.

getAssetUrl(fileId)[source]

Returns the asset URL for the given item relative to the current working path.

getAssetWidth(fileId)[source]

Returns the width (image width) of the given item.

getSpriteHeight(fileId)[source]

Returns the height of the sprite sheet which contains the given single image.

getSpriteId(fileId)[source]

Returns the sprite asset which contains the image with the given ID.

getSpriteLeft(fileId)[source]

Returns the left position of the image on the sprite sheet.

getSpriteTop(fileId)[source]

Returns the top position of the image on the sprite sheet.

getSpriteUrl(fileId)[source]

Returns the url of the sprite sheet which contains the given single image.

getSpriteWidth(fileId)[source]

Returns the width of the sprite sheet which contains the given single image.

processAnimations()[source]

Processes jasyanimation files to merge animation data into asset registry.

processSprites()[source]

Processes jasysprite files to merge sprite data into asset registry.

jasy.asset.SpritePacker module
class jasy.asset.SpritePacker.PackerScore(sheets, external)[source]

Bases: object

data()[source]
class jasy.asset.SpritePacker.SpritePacker(base, types='png', width=1024, height=1024)[source]

Bases: object

Packs single images into sprite images automatically.

addDir(directory, recursive=False)[source]

Adds all images within a directory to the sprite packer.

addFile(relPath, fullPath)[source]

Adds the specific file to the sprite packer.

clear()[source]

Removes all generated sprite files found in the base directory.

generate(path='', debug=False)[source]

Generate sheets/variants.

pack(width=1024, height=1024, sort=None, silent=False)[source]

Packs all sprites within the pack into sheets of the given size.

packBest()[source]

Pack blocks into a sprite sheet by trying multiple settings.

packDir(path='', recursive=True, debug=False)[source]

Pack images inside a dir into sprite sheets.

setDataFormat(format='yaml')[source]

Sets format for metadata output - for format support take a look at jasy.core.Config.

Module contents

jasy.core package

Submodules
jasy.core.Base62 module
jasy.core.Base62.decode(str)[source]
jasy.core.Base62.decodeStringToArray(str)[source]
jasy.core.Base62.decodeToArrayOfBytes(arr)[source]
jasy.core.Base62.encode(str)[source]
jasy.core.Base62.encodeArrayOfBytes(arr)[source]
jasy.core.Base62.encodeArrayToString(arr)[source]
jasy.core.Cache module
class jasy.core.Cache.Cache(path, filename='jasycache', hashkeys=False)[source]

Bases: object

A cache class based on shelve feature of Python.

Supports transient in-memory storage, too. Uses memory storage for caching requests to DB as well for improved performance. Uses keys for identification of entries like a normal hash table / dictionary.

clear()[source]

Clears the cache file(s)

close()[source]

Closes the internal storage database.

open()[source]

Opens a cache file in the given path.

read(key, timestamp=None, inMemory=True)[source]

Reads the given value from cache.

Optionally support to check wether the value was stored after the given time to be valid (useful for comparing with file modification times).

store(key, value, timestamp=None, transient=False, inMemory=True)[source]

Stores the given value.

Default timestamp goes to the current time. Can be modified to the time of an other files modification date etc. Transient enables in-memory cache for the given value

sync()[source]

Syncs the internal storage database.

jasy.core.Config module
class jasy.core.Config.Config(data=None)[source]

Bases: object

Wrapper around YAML/JSON with easy to use import tools for using question files, command line arguments, etc.

ask(question, name, accept=None, required=True, default=None, force=False, parse=True)[source]

Asks the user for value for the given configuration field:

Parameters:
  • question (string) – Question to ask the user
  • name (string) – Name of field to store value in
  • accept (string) – Any of the supported types to validate for (see matchesType)
  • required (boolean) – Whether the field is required
  • default – Default value whenever user has given no value
debug()[source]

Prints data to the console.

executeScript(fileName, autoDelete=True, optional=False, encoding='utf-8')[source]

Executes the given script for configuration proposes and deletes the file afterwards (by default).

Returns True when the file was found and processed.

export()[source]

Returns a flat data structure of the internal data.

get(name, default=None)[source]

Returns the value of the given field or None when field is not set.

has(name)[source]

Returns whether there is a value for the given field name.

injectValues(parse=True, **argv)[source]

Injects a list of arguments into the configuration file, typically used for injecting command line arguments.

loadValues(fileName, optional=False, encoding='utf-8')[source]

Imports the values of the given config file Returns True when the file was found and processed.

Note: Supports dotted names to store into sub trees Note: This method overrides keys when they are already defined!

readQuestions(fileName, force=False, autoDelete=True, optional=False, encoding='utf-8')[source]

Reads the given configuration file with questions and deletes the file afterwards (by default).

Returns True when the file was found and processed.

set(name, value, accept=None, parse=False)[source]

Saves the given value under the given field.

write(fileName, indent=2, encoding='utf-8')[source]

Uses config writer to write the configuration file to the application.

jasy.core.Config.findConfig(fileName)[source]

Returns the name of a config file based on the given base file name (without extension).

Returns either a filename which endswith .yaml, .json or None when no file was found.

jasy.core.Config.isConfigName(fileName, requiredBaseName=None)[source]
jasy.core.Config.loadConfig(fileName, encoding='utf-8')[source]

Loads the given configuration file (filename without extension) and returns the parsed object structure.

jasy.core.Config.writeConfig(data, fileName, indent=2, encoding='utf-8')[source]

Writes the given data structure to the given file name.

Based on the given extension a different file format is choosen. Currently use either .yaml or .json.

jasy.core.Console module

Centralized logging for complete Jasy environment.

jasy.core.Console.colorize(text, color='red')[source]

Uses to colorize the given text for output on Unix terminals.

jasy.core.Console.header(title)[source]

Outputs the given title with prominent formatting.

jasy.core.Console.error(text, *argv)[source]

Outputs an error message (visible by default)

jasy.core.Console.warn(text, *argv)[source]

Outputs an warning (visible by default)

jasy.core.Console.info(text, *argv)[source]

Outputs an info message (visible by default, disable via –quiet option)

jasy.core.Console.debug(text, *argv)[source]

Output a debug message (hidden by default, enable via –verbose option)

jasy.core.Console.indent()[source]

Increments global indenting level. Prepends spaces to the next logging messages until outdent() is called.

Should be called whenever leaving a structural logging section.

jasy.core.Console.outdent(all=False)[source]

Decrements global indenting level.

Should be called whenever leaving a structural logging section.

jasy.core.Create module
jasy.core.Create.create(name='myproject', origin=None, originVersion=None, skeleton=None, destination=None, session=None, **argv)[source]

Creates a new project from a defined skeleton or an existing project’s root directory (only if there is a jasycreate config file).

Parameters:
  • name (string) – The name of the new created project
  • origin (string) – Path or git url to the base project
  • originVersion (string) – Version of the base project from wich will be created.
  • skeleton (string) – Name of a defined skeleton. None for creating from root
  • destination (string) – Destination path for the new created project
  • session (object) – An optional session to use as origin project
jasy.core.Create.getFirstSubFolder(start)[source]
jasy.core.Create.massFilePatcher(path, data)[source]
jasy.core.Doctor module
jasy.core.Doctor.doCompleteDoctor()[source]

Checks for uninstalled or too old versions of requirements and gives a complete output.

jasy.core.Doctor.doInitializationDoctor()[source]

Checks for uninstalled or too old versions only of requirements and gives error output.

jasy.core.File module

A module consisting of some often used file system actions in easy to use unix tradition.

jasy.core.File.cp(src, dst)[source]

Copies a file.

jasy.core.File.cpdir(src, dst)[source]

Copies a directory.

jasy.core.File.exists(name)[source]

Returns whether the given file or folder exists.

jasy.core.File.mkdir(name)[source]

Creates directory (works recursively)

jasy.core.File.mv(src, dst)[source]

Moves files or directories.

jasy.core.File.read(name, encoding='utf-8')[source]

Read the given file.

Returns None when file could not be found/opended

jasy.core.File.rm(name)[source]

Removes the given file.

jasy.core.File.rmdir(name)[source]

Removes a directory (works recursively)

jasy.core.File.sha1(fileOrPath, block_size=1048576)[source]

Returns a SHA 1 checksum (as hex digest) of the given file (handle)

jasy.core.File.syncfile(src, dst)[source]

Same as cp() but only do copying when source file is newer than target file.

jasy.core.File.write(dst, content, encoding='utf-8')[source]

Writes the content to the destination file name.

jasy.core.FileManager module
class jasy.core.FileManager.FileManager(profile=None)[source]

Bases: object

Summarizes utility methods for operations in filesystem.

copyDir(src, dst)[source]

Copies a directory to a destination directory.

Merges the existing directory structure with the folder to copy.

copyFile(src, dst)[source]

Copy src file to dst file.

Both should be filenames, not directories.

makeDir(dirname)[source]

Creates missing hierarchy levels for given directory.

removeDir(dirname)[source]

Removes the given directory.

removeFile(filename)[source]

Removes the given file.

updateFile(src, dst)[source]

Same as copyFile() but only do copying when source file is newer than target file.

writeFile(dst, content)[source]

Writes the content to the destination file name.

jasy.core.FlagSet module
class jasy.core.FlagSet.FlagSet(*args)[source]

Bases: object

Configures an formatting object which can be used to compress classes afterwards.

The optimization set is frozen after initialization which also generates the unique key based on the given formatting options.

disable(flag)[source]
enable(flag)[source]
getKey()[source]

Returns a unique key to identify this formatting set.

has(key)[source]

Whether the given formatting is enabled.

jasy.core.Inspect module
jasy.core.Inspect.extractDoc(value, limit=80, indent=2)[source]
jasy.core.Inspect.extractType(value)[source]
jasy.core.Inspect.generateApi(api)[source]

Returns a stringified output for the given API set.

jasy.core.Inspect.highlightArgs(value, inClassOrObject=False)[source]
jasy.core.Locale module
class jasy.core.Locale.LocaleParser(locale)[source]

Bases: object

Parses CLDR locales into JavaScript files.

export(path)[source]
getData()[source]

Returns a Python object with the parsed CLDR data.

jasy.core.Locale.camelCaseToUpper(input)[source]
jasy.core.Locale.pluralToJavaScript(expr)[source]

Translates the CLDR plural rules from http://cldr.unicode.org/index/cldr-spec/plural-rules into JavaScript expressions

jasy.core.MetaData module
class jasy.core.MetaData.MetaData(tree)[source]

Bases: object

Data structure to hold all meta information.

A instance of this class is typically created by processing all meta data relevant tags of all doc comments in the given node structure.

Hint: Must be a clean data class without links to other systems for optiomal cachability using Pickle

assets
breaks
optionals
parse(node)[source]

The internal inspection routine to add relevant data from comments.

requires
jasy.core.Options module
class jasy.core.Options.Options[source]

Bases: object

More flexible alternative to the standard python option parser module which solves the requirements to have arbirary tasks and custom parameters for each task.

add(name, accept=<class 'bool'>, value=None, short=None, help='')[source]
getTasks()[source]
parse(args)[source]
printOptions(indent=16)[source]
jasy.core.Permutation module
class jasy.core.Permutation.Permutation(combination)[source]

Bases: object

Object to store a single kind of permutation.

filter(available)[source]

Returns a variant of that permutation which only holds values for the available keys.

get(key)[source]

Returns the value of the given key in the permutation.

getChecksum()[source]

Returns the computed (SHA1) checksum based on the key of this permutation.

getKey()[source]

Returns the computed key from this permutation.

has(key)[source]

Whether the permutation holds a value for the given key.

jasy.core.Permutation.getPermutation(combination)[source]

Small wrapper to omit double creation of identical permutations in filter() method As these instances don’t have any reference to session etc.

they are actually cacheable globally.

jasy.core.Profile module
class jasy.core.Profile.Profile(session)[source]

Bases: object

Configuration object for the build profile of the current task.

addCommand(name, func, resultType=None, globalName=False)[source]

Registers the given function as a new command.

executeCommand(command, params=None)[source]

Executes the given command and returns the result.

expandFileName(fileName)[source]

Replaces placeholders inside the given filename and returns the result. The placeholders are based on the current state of the session.

These are the currently supported placeholders:

  • {{locale}}: Name of current locale e.g. de_DE
  • {{permutation}}: SHA1 checksum of current permutation
  • {{id}}: SHA1 checksum based on permutation and repository branch/revision
exportData()[source]
getAssetManager()[source]
getAssetOutputFolder()[source]

Name of the folder inside the destination folder for storing used assets.

getCompressionLevel()[source]
getCopyAssets()[source]
getCssOutputFolder()[source]

Name of the folder inside the destination folder for storing generated style sheets.

getCurrentFormatting()[source]
getCurrentLocale()[source]

Returns the current locale as defined in current permutation.

getCurrentLocaleProject(update=False)[source]

Returns a locale project for the currently configured locale.

Returns None if locale is not set to a valid value.

getCurrentOptimization()[source]
getCurrentPermutation()[source]

Returns current permutation object (useful during looping through permutations via permutate()).

getCurrentTranslation()[source]
getDestinationPath()[source]

Relative or path of the destination folder.

getDestinationUrl()[source]

The same as destination folder but from the URL/server perspective.

getFieldSetupScripts()[source]
getFileManager()[source]
getFlag(name, fallback=None)[source]
getFormattingLevel()[source]
getHashAssets()[source]
getId()[source]
getJsOutputFolder()[source]

Name of the folder inside the destination folder for storing generated script files.

getMatchingValues(matcher, transformer=None)[source]
getOutputFolder(type, fallback=None)[source]
getOutputFolders()[source]
getParts()[source]
getProjects()[source]

Returns all currently registered projects.

Injects locale project when current permutation has configured a locale.

getSession()[source]
getSetupScripts()[source]

Returns a list of (virtual) classes which are relevant for initial setup.

getTemplateOutputFolder()[source]

Name of the folder inside the destination folder for storing compiled templates.

getUseSource()[source]
getValue(key, fallback=None)[source]
getWorkingPath()[source]
permutate()[source]

Generator method for permutations for improving output capabilities.

permutateField(name, values=None, detect=None, default=None)[source]

Adds the given key/value pair to the session for permutation usage.

It supports an optional test. A test is required as soon as there is more than one value available. The detection method and values are typically already defined by the project declaring the key/value pair.

registerPart(name, className='', styleName='', templateName='')[source]
resetCurrentPermutation()[source]

Resets the current permutation object.

setAssetOutputFolder(folder)[source]
setCompressionLevel(level)[source]
setCopyAssets(enable)[source]
setCssOutputFolder(folder)[source]
setDefaultLocale(locale)[source]

Sets the default locale.

setDestinationPath(path)[source]
setDestinationUrl(url)[source]
setField(name, value)[source]

Statically configure the value of the given field.

This field is just injected into Permutation data and used for permutations, but as it only holds a single value all alternatives paths are removed/ignored.

setFlag(name, value)[source]
setFormattingLevel(level)[source]
setHashAssets(enable)[source]
setJsOutputFolder(folder)[source]
setLocales(locales, default=None)[source]

Store locales as a special built-in field with optional default value

setOutputFolder(type, value)[source]
setStaticPermutation(**argv)[source]

Sets current permutation to a static permutation which contains all values hardly wired to static values using setField() or given via additional named parameters.

setTemplateOutputFolder(folder)[source]
setUseSource(enable)[source]
setValue(key, value)[source]
setWorkingPath(path)[source]
jasy.core.Project module
class jasy.core.Project.Project(path, session, config=None, version=None, fromurl=False)[source]

Bases: object

addFile(relPath, fullPath, itemType, package, override=False)[source]
addItem(type, item)[source]

Add item to item list of given type.

clean()[source]

Clears the cache of the project.

close()[source]

Closes the project which deletes the internal caches.

getAssets()[source]

Returns all project asssets (images, stylesheets, static data, etc.).

getCache()[source]

Returns the cache instance.

getConfigValue(key, default=None)[source]
getDocs()[source]

Returns all package docs.

getFields()[source]

Return the project defined fields which may be configured by the build script.

getItem(type, name)[source]

Return item of given type and name.

getItems(type)[source]

Returns all items of given type.

getName()[source]
getPackage()[source]
getPath()[source]
getRequires(checkoutDirectory='external', updateRepositories=True)[source]

Return the project requirements as project instances.

getRevision()[source]

Returns the current revision of the project.

getScriptByName(className)[source]

Finds a class by its name.

getScripts()[source]

Returns all project classes.

Requires all files to have a “js” extension.

getSession()[source]
getStyles()[source]

Returns all project style styles.

Requires all files to have a “sht” extension.

getTranslations()[source]

Returns all translation objects.

hasRequires()[source]
isReady()[source]
kind = 'none'
pause()[source]

Pauses the project so that other processes could modify/access it.

resume()[source]

Resumes the paused project.

scan()[source]
scanned = False
toRelativeUrl(path, prefix='', subpath='source')[source]
jasy.core.Project.getProjectFromPath(path, session, config=None, version=None)[source]
jasy.core.Project.getProjectDependencies(project, checkoutDirectory='external', updateRepositories=True)[source]

Returns a sorted list of projects depending on the given project (including the given one)

jasy.core.Session module
class jasy.core.Session.Session[source]

Bases: object

Manages all projects.

addCommand(name, func, resultType=None, globalName=False)[source]

Registers the given function as a new command.

addItemType(itemType, name, cls)[source]
addProject(project)[source]

Adds the given project to the list of known projects. Projects should be added in order of their priority. This adds the field configuration of each project to the session fields. Fields must not conflict between different projects (same name).

Parameters:project (object) – Instance of Project to append to the list
clean()[source]

Clears all caches of all registered projects.

close()[source]

Closes the session and stores cache to the harddrive.

executeCommand(name, params)[source]
getAvailableTranslations()[source]

Returns a set of all available translations.

This is the sum of all projects so even if only one project supports “fr_FR” then it will be included here.

getCommands()[source]

Returns a dictionary of all commands.

getCurrentTask()[source]
getFields()[source]
getItemType(itemType)[source]
getItemTypes()[source]
getMain()[source]

Returns the main project which is the first project added to the session and the one with the highest priority.

getProjectByName(name)[source]

Returns a project by its name.

getProjects()[source]

Returns all currently registered projects.

getRelativePath(project)[source]

Returns the relative path of any project to the main project.

getScriptByName(className)[source]

Queries all currently registered projects for the given class and returns the class item. Returns None when no matching class item was found.

Parameters:className (str) – Any valid classname from any of the projects.
getStyleByName(styleName)[source]

Queries all currently registered projects for the given style and returns the style item. Returns None when no matching style item was found.

Parameters:styleName (str) – Any valid styleName from any of the projects.
getTranslationBundle(language=None)[source]

Returns a translation object for the given language containing all relevant translation files for the current project set.

getVirtualFilePathFromId(fileId, extension=None)[source]

Returns a valid virtual path for the given file item ID.

Supports adding an optional extension for files where the extension is not part of the idea (effectively this are most of them, but not assets)

getVirtualItem(baseName, itemClass, text, extension)[source]
getVirtualProject()[source]

Returns the virtual project for this application.

The project offers storage for dynamically created JavaScript classes and other files. Storage is kept intact between different Jasy sessions.

init(autoInitialize=True, updateRepositories=True, scriptEnvironment=None)[source]

Initialize the actual session with projects.

Parameters:
  • autoInitialize – Whether the projects should be automatically added when the current folder contains a valid Jasy project.
  • updateRepositories – Whether to update repositories of all project dependencies.
  • scriptEnvironment – API object as being used for loadLibrary to add Python features offered by projects.
  • commandEnvironment – API object as being used for loadCommands to add Python features for any item nodes.
loadCommands(objectName, fileName, encoding='utf-8')[source]

Loads new commands into the session wide command registry.

loadLibrary(objectName, fileName, encoding='utf-8', doc=None)[source]

Creates a new object inside the user API (jasyscript.py) with the given name containing all @share’d functions and fields loaded from the given file.

pause()[source]

Pauses the session.

This release cache files etc. and makes it possible to call other jasy processes on the same projects.

resume()[source]

Resumes the session after it has been paused.

scan()[source]

Scans all registered projects.

setCurrentTask(name=None)[source]
jasy.core.Text module
jasy.core.Text.highlightCodeBlocks(html, tabsize=2, defaultlang='javascript')[source]

Patches ‘code’ elements in HTML to apply HTML based syntax highlighting.

Automatically chooses the matching language detected via a CSS class of the ‘code’ element.

jasy.core.Text.markdownToHtml(markdownStr)[source]

Converts Markdown to HTML.

Supports GitHub’s fenced code blocks, auto linking and typographic features by SmartyPants.

jasy.core.Types module
class jasy.core.Types.CaseInsensitiveDict[source]

Bases: dict

A case-insensitive dict subclass. Each key is changed on entry to str(key).title().

classmethod fromkeys(seq, value=None)[source]
get(key, default=None)[source]
pop(key, default)[source]
setdefault(key, x=None)[source]
update(E)[source]
jasy.core.Util module
jasy.core.Util.camelize(str)[source]

Returns a camelized version of the incoming string: foo-bar-baz => fooBarBaz

Parameters:str – Input string
jasy.core.Util.executeCommand(args, failMessage=None, path=None, wrapOutput=True)[source]

Executes the given process and outputs failMessage when errors happen.

Parameters:
  • args (str or list) –
  • failMessage (str) – Message for exception when command fails
  • path (str) – Directory path where the command should be executed
  • wrapOutput (bool) – Whether shell output should be wrapped and returned (and passed through to Console.debug())
Raises:

Exception – Raises an exception whenever the shell command fails in execution

jasy.core.Util.generateChecksum(key, method='base62')[source]

Generates a unique SHA1 based hash/checksum encoded as Base62 or Hex depending on the given parameters.

Parameters:
  • key (str) –
  • method (str) –
jasy.core.Util.getKey(data, key, default=None)[source]

Returns the key from the data if available or the given default.

Parameters:
  • data (dict) – Data structure to inspect
  • key (str) – Key to lookup in dictionary
  • default (any) – Default value to return when key is not set
jasy.core.Util.hyphenate(str)[source]

Returns a hyphenated version of the incoming string: fooBarBaz => foo-bar-baz

Parameters:str – Input string
Module contents

jasy.env package

Submodules
jasy.env.Context module

Global environment which is used by jasyscript.py files.

jasy.env.State module

This module is used to pass a single session instance around to different modules.

jasy.env.Task module

Tasks are basically functions with some managment code allow them to run in jasyscript.py.

jasy.env.Task.task(*args, **kwargs)[source]

Specifies that this function is a task.

jasy.env.Task.executeTask(taskname, **kwargs)[source]

Executes the given task by name with any optional named arguments.

jasy.env.Task.runTask(project, task, **kwargs)[source]

Executes the given task of the given projects.

This happens inside a new sandboxed session during which the current session is paused/resumed automatically.

jasy.env.Task.printTasks(indent=16)[source]

Prints out a list of all avaible tasks and their descriptions.

jasy.env.Task.setCommand(cmd)[source]

Sets the jasy command which should be used to execute tasks with runTask()

jasy.env.Task.setOptions(options)[source]

Sets currently configured command line options.

Mainly used for printing help screens.

jasy.env.Task.getOptions()[source]

Returns the options as passed to the jasy command.

Useful for printing all command line arguments.

Module contents

Glue code used in jasyscript.py to have a convenient API on top of the full Jasy API.

jasy.http package

Submodules
jasy.http.Request module
jasy.http.Request.requestUrl(url, content_type='text/plain', headers=None, method='GET', port=None, body='', user=None, password=None)[source]

Generic HTTP request wrapper with support for basic authentification and automatic parsing of response content.

jasy.http.Request.uploadData(url, fields, files, user=None, password=None, method='POST')[source]

Easy wrapper for uploading content via HTTP multi part.

jasy.http.Server module
class jasy.http.Server.Proxy(id, config)[source]

Bases: object

default(*args, **query)[source]

This method returns the content of existing files on the file system.

Query string might be used for cache busting and are otherwise ignored.

class jasy.http.Server.Result(headers, content, status_code)

Bases: tuple

content

Alias for field number 1

headers

Alias for field number 0

status_code

Alias for field number 2

class jasy.http.Server.Server(port=8080, host='127.0.0.1', mimeTypes=None)[source]

Bases: object

Starts the built-in HTTP server inside the project’s root directory

setRoutes(routes)[source]

Adds the given routes to the server configuration. Routes can be used to add special top level entries to the different features of the integrated webserver either mirroring a remote server or delivering a local directory.

The parameters is a dict where every key is the name of the route and the value is the configuration of that route.

start()[source]

Starts the web server and blocks execution.

Note: This stops further execution of the current task or method.

class jasy.http.Server.Static(id, config, mimeTypes=None)[source]

Bases: object

default(*args, **query)[source]

This method returns the content of existing files on the file system.

Query string might be used for cache busting and are otherwise ignored.

jasy.http.Server.enableCrossDomain()[source]
jasy.http.Server.findIndex(path)[source]
jasy.http.Server.noBodyProcess()[source]
Module contents

jasy.item package

Submodules
jasy.item.Abstract module
class jasy.item.Abstract.AbstractItem(project, id=None, package=None)[source]

Bases: object

attach(path)[source]
classmethod fromPath(project, relpath, package=None)[source]

Initialize MyData from a dict’s items.

generateId(relpath, package)[source]
getChecksum(mode='rb')[source]

Returns the SHA1 checksum of the item.

getId()[source]

Returns a unique identify of the class.

Typically as it is stored inside the project.

getModificationTime()[source]

Returns last modification time of the class.

getPath()[source]

Returns the exact position of the class file in the file system.

getProject()[source]

Returns the project which the class belongs to.

getText(encoding='utf-8')[source]

Reads the file (as UTF-8) and returns the text

id = None
kind = 'jasy.Item'
mtime = None
project = None
saveText(text, path, encoding='utf-8')[source]

Saves the given text under the given path and stores both for future access.

This is mainly useful for “virtual” files which are not edited by the developer but which are created dynamically during runtime.

setId(id)[source]
setPath(path)[source]

Sets the path for the item.

setText(text)[source]

Stores text from custom reader.

setTextFilter(filterCallback)[source]

Sets text filter callback that is called on getText().

With this callback e.g. transformations from CoffeeScript to JavaScript are possible. The callback gets two parameter (text, ItemClass)

jasy.item.Asset module
class jasy.item.Asset.AssetItem(project, id=None, package=None)[source]

Bases: jasy.item.Abstract.AbstractItem

addImageAnimationData(columns, rows, frames=None, layout=None)[source]
addImageDimensionData(width, height)[source]
addImageSpriteData(id, left, top)[source]
exportData()[source]
generateId(relpath, package)[source]
getParsedObject()[source]
getType(short=False)[source]
isAudio()[source]
isImage()[source]
isImageAnimationConfig()[source]
isImageSpriteConfig()[source]
isText()[source]
isVideo()[source]
kind = 'jasy.Asset'
setId(id)[source]
jasy.item.Doc module
class jasy.item.Doc.DocItem(project, id=None, package=None)[source]

Bases: jasy.item.Abstract.AbstractItem

generateId(relpath, package)[source]

Generates the fileId of this item as being used by other modules.

getApi()[source]
kind = 'jasy.Doc'
jasy.item.Script module
exception jasy.item.Script.ScriptError(inst, msg)[source]

Bases: Exception

class jasy.item.Script.ScriptItem(project, id=None, package=None)[source]

Bases: jasy.item.Abstract.AbstractItem

filterPermutation(permutation)[source]
generateId(relpath, package)[source]

Generates the fileId of this item as being used by other modules.

getApi(highlight=True)[source]
getBreaks(permutation=None, items=None)[source]

Returns all down-priorized dependencies. This are dependencies which are required to make the module work, but are not required being available before the current item.

getCompressed(profile)[source]
getDependencies(permutation=None, items=None, fields=None, warnings=True)[source]

Returns a set of dependencies seen through the given list of known classes (ignoring all unknown items in original set) and configured fields with their individual detection classes.

This method also makes use of the meta data and the variable data.

getFields()[source]
getHighlightedCode()[source]
getMetaData(permutation=None)[source]
getScopeData(permutation=None)[source]

Returns the top level scope object which contains information about the global variable and package usage/influence.

getTranslations()[source]
kind = 'jasy.Script'
jasy.item.Script.collectFields(node, keys=None)[source]
jasy.item.Style module
exception jasy.item.Style.StyleError(inst, msg)[source]

Bases: Exception

Error class used for issues during style processing.

class jasy.item.Style.StyleItem(project, id=None, package=None)[source]

Bases: jasy.item.Abstract.AbstractItem

filterPermutation(permutation)[source]

Returns a new permutation which only contains information about the fields actually accessed in this stylesheet.

generateId(relpath, package)[source]

Generates the fileId of this item as being used by other modules.

getBreaks(permutation=None, items=None, warnings=True)[source]

Returns all down-priorized dependencies. These are dependencies which are required to make the item work, but are not required being available before the current item.

getCompressed(profile)[source]

Returns the compressed CSS code of this item.

getDependencies(permutation=None, items=None, fields=None, warnings=True)[source]

Returns a set of dependencies seen through the given list of known items (ignoring all unknown items in original set).

getFields()[source]

Returns the fields which are used by this stylesheet.

getIncludes(permutation)[source]

Returns the includes which are referenced by this stylesheet.

getMergedTree(profile)[source]

Returns the merged (includes resolved) and optimized.

(permutation values applied) tree.

getMetaData(permutation)[source]

Returns the meta data of this stylesheet.

getModificationTime(profile)[source]

Returns the modification date of the stylesheet.

(or the sum of modification dates when using includes)

kind = 'jasy.Style'
jasy.item.Style.collectFields(node, keys=None, condition=False)[source]

Collects all fields accessed by the given root node and all children.

Returns a set of field names.

jasy.item.Style.includeGenerator(node)[source]

A generator which yiels include names and the origin include nodes for every include in the given root node.

jasy.item.Template module
class jasy.item.Template.TemplateItem(project, id=None, package=None)[source]

Bases: jasy.item.Abstract.AbstractItem

attach(path)[source]
generateId(relpath, package)[source]

Generates the fileId of this item as being used by other modules.

getScriptItem()[source]

Returns a class representation for the template instance.

kind = 'jasy.Template'
jasy.item.Template.escapeContent(content)[source]
jasy.item.Template.templateFilter(text, item)[source]
jasy.item.Translation module
class jasy.item.Translation.TranslationItem(project, id=None, package=None, table=None)[source]

Bases: jasy.item.Abstract.AbstractItem

attach(path)[source]
export(classes, formatted=True)[source]

Exports the translation table as JSON based on the given set of classes.

generateId(relpath, package)[source]

Generates the fileId of this item as being used by other modules.

getLanguage()[source]

Returns the language of the translation file.

getTable()[source]

Returns the translation table.

kind = 'jasy.Translation'
setId(id)[source]
jasy.item.Translation.generateMessageId(basic, plural=None, context=None)[source]

Returns a unique message ID based on info typically stored in the code: id, plural, context

Module contents

jasy.parse package

Submodules
jasy.parse.AbstractNode module
class jasy.parse.AbstractNode.AbstractNode(tokenizer=None, type=None, args=[])[source]

Bases: list

append(kid, rel=None)[source]

Appends the given kid with an optional relation hint.

assignOp
comments
condition
elsePart
end
fileId
getChildrenLength(filter=True)[source]

Number of (per default unrelated) children.

getFileName()[source]

Traverses up the tree to find a node with a fileId and returns it.

getSource()[source]

Returns the source code of the node.

getUnrelatedChildren()[source]

Collects all unrelated children.

initializer
insert(index, kid)[source]

Inserts the given kid at the given index.

insertAll(index, kids)[source]

Inserts all kids starting with the given index.

insertAllReplace(orig, kids)[source]

Inserts all kids at the same position as the original node (which is removed afterwards)

line
name
names
params
parent
parenthesized
postfix
rel
remove(kid)[source]

Removes the given kid.

replace(kid, repl)[source]

Replaces the given kid with a replacement kid.

scope
start
statement
statements
thenPart
toXml(format=True, indent=0, tab=' ')[source]

Converts the node to XML.

tokenizer
type
value
values
variables
jasy.parse.ScopeData module
class jasy.parse.ScopeData.ScopeData[source]

Bases: object

Used by core/Variables.py to store the resulting statistics data efficiently. Contains information about:

  • Declared Variables (declared)
  • Modified Variables (modified)
  • Shared
  • Unused Variables (unused)
accessed
declared
export()[source]

Exports all data as a Python dict instance.

increment(name, by=1)[source]

Small helper so simplify adding variables to “accessed” dict.

modified
name
packages
params
shared
unused
Module contents

jasy.script package

Subpackages
jasy.script.api package
Submodules
jasy.script.api.Comment module
class jasy.script.api.Comment.Comment(text, context=None, lineNo=0, indent='', fileId=None)[source]

Bases: object

Comment class is attached to parsed nodes and used to store all comment related information.

The class supports a new Markdown and TomDoc inspired dialect to make developers life easier and work less repeative.

context = None
getHtml(highlight=True)[source]

Returns the comment text converted to HTML.

Parameters:highlight (bool) – Whether to highlight the code
getTags()[source]
hasContent()[source]
hasTag(name)[source]
params = None
returns = None
tags = None
text = None
type = None
exception jasy.script.api.Comment.CommentException(message, lineNo=0)[source]

Bases: Exception

Thrown when errors during comment processing are detected.

jasy.script.api.Data module
class jasy.script.api.Data.ApiData(id, highlight=True)[source]

Bases: object

Container for all relevant API data.

Automatically generated, filled and cached by jasy.item.Script.getApiDocs().

addAssets(assets)[source]

Adds the info about used assets.

addConstructor(valueNode, commentNode=None)[source]
addEntry(name, valueNode, commentNode, collection)[source]
addEvent(name, valueNode, commentNode, collection)[source]
addFields(permutations)[source]
addProperty(name, valueNode, commentNode, collection)[source]
addSize(size)[source]

Adds the statistics on different size aspects.

addUses(uses)[source]
assets
basename
construct
content
errors
events
export()[source]
highlight
id
implementedBy
implements
includedBy
includes
isEmpty
main
members
package
permutations
properties
removeUses(uses)[source]
scanTree(tree)[source]
setMain(mainType, mainNode, exportName)[source]
size
statics
usedBy
uses
warn(message, line)[source]
jasy.script.api.Text module
jasy.script.api.Text.extractSummary(text)[source]
jasy.script.api.Writer module
class jasy.script.api.Writer.ApiWriter(profile)[source]

Bases: object

Processes JavaScript classes into data for API documentation.

Exports plain data which can be used by a wide varity of tools for further processing or for displaying documentation. A good example of how to use the data generated by write is the ApiBrowser: https://github.com/zynga/apibrowser

write(distFolder, classFilter=None, callback='apiload', showInternals=False, showPrivates=False, printErrors=True, highlightCode=True)[source]

Writes API data generated from JavaScript into distFolder.

Parameters:
  • distFolder (str) – Where to store the API data
  • classFilter (tuple or function) – Tuple of classes or method to use for filtering
  • callback (function) – Name of callback to use for loading or None if pure JSON should be used
  • showInternals (bool) – Include internal methods inside API data
  • showPrivates (bool) – Include private methods inside API data
  • printErrors (bool) – Whether errors should be printed to the console
  • highlightCode (bool) – Whether to enable code highlighting using Pygments
jasy.script.api.Writer.connectInterface(className, interfaceName, classApi, interfaceApi)[source]
jasy.script.api.Writer.convertFunction(item)[source]
jasy.script.api.Writer.convertTags(item)[source]
jasy.script.api.Writer.isErrornous(data)[source]
jasy.script.api.Writer.mergeMixin(className, mixinName, classApi, mixinApi)[source]
jasy.script.api.Writer.safeUpdate(dest, origin)[source]

Like update() but only never overwrites.

Module contents
jasy.script.clean package
Submodules
jasy.script.clean.DeadCode module

This module is used to detect dead code branches and remove them. This is escecially useful after injecting values from the outside which might lead to simple truish equations which can be easily resolved.

This module is directly used by Class after Permutations have been applied (code branches) but can be used more widely, too.

This acts somewhat like the optimizers you find under “optimizer”, but is dependency relevant (Permutations might remove whole blocks of alternative code branches). It makes no sense to optimize this just before compilation. It must be done pretty early during the processing of classes.

The module currently support the following statements:

  • if
  • hook (?:)
  • switch

and can detect good code based on:

  • true
  • false
  • equal: ==
  • strict equal: ===
  • not equal: !=
  • strict not equal: !==
  • not: !
  • and: &&
  • or: ||

It supports the types “string” and “number” during comparisions. It uses a simple equality operator in Python which behaves like strict equal in JavaScript. This also means that number 42 is not equal to string “42” during the dead code analysis.

It can figure out combined expressions as well like:

  • 4 == 4 && !false
jasy.script.clean.DeadCode.cleanup(node)[source]

Reprocesses JavaScript to remove dead paths.

jasy.script.clean.Permutate module
jasy.script.clean.Permutate.patch(node, permutation)[source]

Replaces all occourences with incoming values.

jasy.script.clean.Unused module
exception jasy.script.clean.Unused.Error(name, line)[source]

Bases: Exception

jasy.script.clean.Unused.cleanup(node)[source]
Module contents
jasy.script.optimize package
Submodules
jasy.script.optimize.BlockReducer module
exception jasy.script.optimize.BlockReducer.Error(line)[source]

Bases: Exception

jasy.script.optimize.BlockReducer.cleanParens(node)[source]

Automatically tries to remove superfluous parens which are sometimes added for more clearance and readability but which are not required for parsing and just produce overhead.

jasy.script.optimize.BlockReducer.combineAssignments(condition, thenExpression, elseExpression, compressor)[source]

Combines then and else expression to one assignment when they both assign to the same target node and using the same operator.

jasy.script.optimize.BlockReducer.combineExpressions(condition, thenExpression, elseExpression)[source]

Combines then and else expression using a hook statement.

jasy.script.optimize.BlockReducer.combineToCommaExpression(node)[source]

This method tries to combine a block with multiple statements into one semicolon statement with a comma expression containing all expressions from the previous block. This only works when the block exclusively consists of expressions as this do not work with other statements. Still this conversion reduces the size impact of many blocks and leads to the removal of a lot of curly braces in the result code.

Example: {x++;y+=3} => x++,x+=3

jasy.script.optimize.BlockReducer.compactIf(node, thenPart, condition)[source]

Reduces the size of a if statement (without elsePart) using boolean operators instead of the typical keywords e.g. “if(something)make()” is translated to “something&&make()” which is two characters shorter.

This however only works when the thenPart is only based on expressions and does not contain other statements.

jasy.script.optimize.BlockReducer.containsIf(node)[source]

Checks whether the given node contains another if-statement

jasy.script.optimize.BlockReducer.containsIfElse(node)[source]

Checks whether the given node contains another if-else-statement

jasy.script.optimize.BlockReducer.createHook(condition, thenPart, elsePart)[source]

Creates a hook expression with the given then/else parts.

jasy.script.optimize.BlockReducer.createReturn(value)[source]

Creates a return statement with the given value.

jasy.script.optimize.BlockReducer.endsWithReturnOrThrow(node)[source]

Used by the automatic elsePart removal logic to find out whether the given node ends with a return or throw which is bascially the allowance to remove the else keyword as this is not required to keep the logic intact.

jasy.script.optimize.BlockReducer.fixParens(node)[source]

Automatically wraps the given node into parens when it was moved into another block and is not parsed there in the same way as it was the case previously.

The method needs to be called after the node has been moved to the target node.

jasy.script.optimize.BlockReducer.mergeParts(node, thenPart, elsePart, condition, compressor)[source]

Merges if statement with a elsePart using a hook. Supports two different ways of doing this: using a hook expression outside, or using a hook expression inside an assignment.

Example: if(test) first(); else second() => test ? first() : second(); if(foo) x=1; else x=2 => x = foo ? 1 : 2;

jasy.script.optimize.BlockReducer.optimize(node)[source]
jasy.script.optimize.BlockReducer.reworkElse(node, elsePart)[source]

If an if ends with a return/throw we are able to inline the content of the else to the same parent as the if resides into.

This method deals with all the nasty details of this operation.

jasy.script.optimize.ClosureWrapper module
jasy.script.optimize.ClosureWrapper.optimize(node)[source]
jasy.script.optimize.CombineDeclarations module
exception jasy.script.optimize.CombineDeclarations.Error(line)[source]

Bases: Exception

jasy.script.optimize.CombineDeclarations.optimize(node)[source]
jasy.script.optimize.CryptPrivates module
exception jasy.script.optimize.CryptPrivates.Error(name, line)[source]

Bases: Exception

jasy.script.optimize.CryptPrivates.optimize(node, contextId='')[source]
jasy.script.optimize.LocalVariables module
exception jasy.script.optimize.LocalVariables.Error(name, line)[source]

Bases: Exception

jasy.script.optimize.LocalVariables.optimize(node)[source]

Node to optimize with the global variables to ignore as names.

jasy.script.optimize.Translation module
jasy.script.optimize.Translation.hasText(node)[source]
jasy.script.optimize.Translation.optimize(node, translation)[source]
jasy.script.optimize.Translation.collectTranslations(node)[source]
Module contents
jasy.script.output package
Submodules
jasy.script.output.Compressor module
class jasy.script.output.Compressor.Compressor(format=None)[source]

Bases: object

compress(node)[source]
type_array_comp(node)[source]
type_array_init(node)[source]
type_assign(node)[source]
type_block(node)[source]
type_break(node)[source]
type_call(node)[source]
type_comma(node)[source]
type_comp_tail(node)[source]

Comprehensions Tails.

type_const(node)[source]
type_continue(node)[source]
type_declaration(node)[source]
type_do(node)[source]
type_exception(node)[source]
type_for(node)[source]
type_for_in(node)[source]
type_function(node)[source]
type_generator(node)[source]

Generator Expression.

type_getter(node)[source]
type_hook(node)[source]

aka ternary operator.

type_identifier(node)[source]
type_if(node)[source]
type_in(node)[source]
type_index(node)[source]
type_instanceof(node)[source]
type_label(node)[source]
type_let(node)[source]
type_let_block(node)[source]
type_list(node)[source]
type_new_with_args(node)[source]
type_number(node)[source]
type_object_init(node)[source]
type_property_init(node)[source]
type_regexp(node)[source]
type_return(node)[source]
type_script(node)[source]
type_semicolon(node)[source]
type_setter(node)[source]
type_string(node)[source]
type_switch(node)[source]
type_throw(node)[source]
type_try(node)[source]
type_var(node)[source]
type_while(node)[source]
jasy.script.output.Formatting module
class jasy.script.output.Formatting.Formatting(*args)[source]

Bases: jasy.core.FlagSet.FlagSet

Configures an formatting object which can be used to compress classes afterwards.

The optimization set is frozen after initialization which also generates the unique key based on the given formatting options.

jasy.script.output.Optimization module
exception jasy.script.output.Optimization.Error(msg)[source]

Bases: Exception

Error object which is raised whenever an optimization could not be applied correctly.

class jasy.script.output.Optimization.Optimization(*args)[source]

Bases: jasy.core.FlagSet.FlagSet

Configures an optimization object which can be used to compress classes afterwards.

The optimization set is frozen after initialization which also generates the unique key based on the given optimizations.

apply(tree)[source]

Applies the configured optimizations to the given node tree.

Modifies the tree in-place to be sure to have a deep copy if you need the original one. It raises an error instance whenever any optimization could not be applied to the given tree.

Module contents
jasy.script.parse package
Submodules
jasy.script.parse.Lang module
jasy.script.parse.Node module
class jasy.script.parse.Node.Node(tokenizer=None, type=None, args=[])[source]

Bases: jasy.parse.AbstractNode.AbstractNode

assignOp
block
body
comments
condition
defaultIndex
discriminant
elsePart
end
exception
expression
expressionClosure
fileId
finallyBlock
for
functionForm
guard
initializer
isEach
isLoop
iterator
label
line
name
names
object
params
parent
parenthesized
postfix
readOnly
rel
scope
setup
start
statement
statements
tail
thenPart
tokenizer
tryBlock
type
update
value
variables
jasy.script.parse.Parser module
jasy.script.parse.Parser.parse(source, fileId=None, line=1, builder=None)[source]
jasy.script.parse.Parser.parseExpression(source, fileId=None, line=1, builder=None)[source]
jasy.script.parse.ScopeScanner module
jasy.script.parse.ScopeScanner.scan(tree)[source]

Scans the given tree and attaches variable data instances (core/ScopeData.py) to every scope (aka function).

This data is being stored independently from the real tree so that if you modifiy the tree the data is not automatically updated. This means that every time you modify the tree heavily, it might make sense to re-execute this method to bring it in sync to the current tree structure.

jasy.script.parse.VanillaBuilder module
class jasy.script.parse.VanillaBuilder.VanillaBuilder[source]

Bases: object

The vanilla AST builder.

ADD_addOperand(node, childNode)[source]
ADD_build(tokenizer)[source]
ADD_finish(node)[source]
AND_addOperand(node, childNode)[source]
AND_build(tokenizer)[source]
AND_finish(node)[source]
ARRAYCOMP_build(tokenizer)[source]
ARRAYCOMP_finish(node)[source]
ARRAYCOMP_setExpression(node, expression)[source]
ARRAYCOMP_setTail(node, childNode)[source]
ARRAYINIT_addElement(node, childNode)[source]
ARRAYINIT_build(tokenizer)[source]
ARRAYINIT_finish(node)[source]
ASSIGN_addOperand(node, childNode)[source]
ASSIGN_build(tokenizer)[source]
ASSIGN_finish(node)[source]
ASSIGN_setAssignOp(node, operator)[source]
BITWISEAND_addOperand(node, childNode)[source]
BITWISEAND_build(tokenizer)[source]
BITWISEAND_finish(node)[source]
BITWISEOR_addOperand(node, childNode)[source]
BITWISEOR_build(tokenizer)[source]
BITWISEOR_finish(node)[source]
BITWISEXOR_addOperand(node, childNode)[source]
BITWISEXOR_build(tokenizer)[source]
BITWISEXOR_finish(node)[source]
BLOCK_addStatement(node, childNode)[source]
BLOCK_build(tokenizer, id)[source]
BLOCK_finish(node)[source]
BLOCK_hoistLets(node)[source]
BREAK_build(tokenizer)[source]
BREAK_finish(node)[source]
BREAK_setLabel(node, label)[source]
BREAK_setTarget(node, target)[source]
CASE_addStatement(node, statement)[source]
CASE_build(tokenizer)[source]
CASE_finish(node)[source]
CASE_initializeStatements(node, tokenizer)[source]
CASE_setLabel(node, expression)[source]
CATCH_build(tokenizer)[source]
CATCH_finish(node)[source]
CATCH_setBlock(node, statement)[source]
CATCH_setException(node, exception)[source]
CATCH_setGuard(node, expression)[source]
CATCH_wrapException(tokenizer)[source]
COMMA_addOperand(node, childNode)[source]
COMMA_build(tokenizer)[source]
COMMA_finish(node)[source]
COMMENTS_add(currNode, prevNode, comments)[source]
COMPTAIL_addFor(node, childNode)[source]
COMPTAIL_build(tokenizer)[source]
COMPTAIL_finish(node)[source]
COMPTAIL_setGuard(node, expression)[source]
CONST_addDecl(node, childNode, childContext=None)[source]
CONST_build(tokenizer)[source]
CONST_finish(node)[source]
CONTINUE_build(tokenizer)[source]
CONTINUE_finish(node)[source]
CONTINUE_setLabel(node, label)[source]
CONTINUE_setTarget(node, target)[source]
DEBUGGER_build(tokenizer)[source]
DECL_build(tokenizer)[source]
DECL_finish(node)[source]
DECL_setInitializer(node, expression)[source]
DECL_setName(node, identifier)[source]
DECL_setNames(node, expression)[source]
DECL_setReadOnly(node, readOnly)[source]
DEFAULT_addStatement(node, statement)[source]
DEFAULT_build(tokenizer)[source]
DEFAULT_finish(node)[source]
DEFAULT_initializeStatements(node, tokenizer)[source]
DO_build(tokenizer)[source]
DO_finish(node)[source]
DO_setBody(node, statement)[source]
DO_setCondition(node, expression)[source]
EQUALITY_addOperand(node, childNode)[source]
EQUALITY_build(tokenizer)[source]
EQUALITY_finish(node)[source]
EXPRESSION_addOperand(node, childNode)[source]
EXPRESSION_build(tokenizer, tokenType)[source]
EXPRESSION_finish(node)[source]
FOR_build(tokenizer)[source]
FOR_finish(node)[source]
FOR_rebuildForEach(node)[source]
FOR_rebuildForIn(node)[source]
FOR_setBody(node, statement)[source]
FOR_setCondition(node, expression)[source]
FOR_setIterator(node, expression, forBlock=None)[source]
FOR_setObject(node, expression, forBlock=None)[source]
FOR_setSetup(node, expression)[source]
FOR_setUpdate(node, expression)[source]
FUNCTION_addParam(node, tokenizer, expression)[source]
FUNCTION_build(tokenizer)[source]
FUNCTION_finish(node, x)[source]
FUNCTION_hoistVars(x)[source]
FUNCTION_initParams(node, tokenizer)[source]
FUNCTION_setBody(node, statement)[source]
FUNCTION_setExpressionClosure(node, expressionClosure)[source]
FUNCTION_setName(node, identifier)[source]
FUNCTION_wrapParam(tokenizer)[source]
GENERATOR_build(tokenizer)[source]
GENERATOR_finish(node)[source]
GENERATOR_setExpression(node, expression)[source]
GENERATOR_setTail(node, childNode)[source]
HOOK_build(tokenizer)[source]
HOOK_finish(node)[source]
HOOK_setCondition(node, expression)[source]
HOOK_setElsePart(node, childNode)[source]
HOOK_setThenPart(node, childNode)[source]
IF_build(tokenizer)[source]
IF_finish(node)[source]
IF_setCondition(node, expression)[source]
IF_setElsePart(node, statement)[source]
IF_setThenPart(node, statement)[source]
LABEL_build(tokenizer)[source]
LABEL_finish(node)[source]
LABEL_setLabel(node, label)[source]
LABEL_setStatement(node, statement)[source]
LETBLOCK_build(tokenizer)[source]
LETBLOCK_finish(node)[source]
LETBLOCK_setBlock(node, statement)[source]
LETBLOCK_setExpression(node, expression)[source]
LETBLOCK_setVariables(node, childNode)[source]
LET_addDecl(node, childNode, childContext=None)[source]
LET_build(tokenizer)[source]
LET_finish(node)[source]
LIST_addOperand(node, childNode)[source]
LIST_build(tokenizer)[source]
LIST_finish(node)[source]
MEMBER_addOperand(node, childNode)[source]
MEMBER_build(tokenizer, tokenType=None)[source]
MEMBER_finish(node)[source]
MEMBER_rebuildNewWithArgs(node)[source]
MULTIPLY_addOperand(node, childNode)[source]
MULTIPLY_build(tokenizer)[source]
MULTIPLY_finish(node)[source]
OBJECTINIT_addProperty(node, childNode)[source]
OBJECTINIT_build(tokenizer)[source]
OBJECTINIT_finish(node)[source]
OR_addOperand(node, childNode)[source]
OR_build(tokenizer)[source]
OR_finish(node)[source]
PRIMARY_build(tokenizer, tokenType)[source]
PRIMARY_finish(node)[source]
PROPERTYINIT_addOperand(node, childNode)[source]
PROPERTYINIT_build(tokenizer)[source]
PROPERTYINIT_finish(node)[source]
RELATIONAL_addOperand(node, childNode)[source]
RELATIONAL_build(tokenizer)[source]
RELATIONAL_finish(node)[source]
RETURN_build(tokenizer)[source]
RETURN_finish(node)[source]
RETURN_setValue(node, expression)[source]
SEMICOLON_build(tokenizer)[source]
SEMICOLON_finish(node)[source]
SEMICOLON_setExpression(node, expression)[source]
SHIFT_addOperand(node, childNode)[source]
SHIFT_build(tokenizer)[source]
SHIFT_finish(node)[source]
SWITCH_addCase(node, childNode)[source]
SWITCH_build(tokenizer)[source]
SWITCH_finish(node)[source]
SWITCH_setDefaultIndex(node, index)[source]
SWITCH_setDiscriminant(node, expression)[source]
THROW_build(tokenizer)[source]
THROW_finish(node)[source]
THROW_setException(node, expression)[source]
TRY_addCatch(node, childNode)[source]
TRY_build(tokenizer)[source]
TRY_finish(node)[source]
TRY_finishCatches(node)[source]
TRY_setFinallyBlock(node, statement)[source]
TRY_setTryBlock(node, statement)[source]
UNARY_addOperand(node, childNode)[source]
UNARY_build(tokenizer)[source]
UNARY_finish(node)[source]
UNARY_setPostfix(node)[source]
VAR_addDecl(node, childNode, childContext=None)[source]
VAR_build(tokenizer)[source]
VAR_finish(node)[source]
WHILE_build(tokenizer)[source]
WHILE_finish(node)[source]
WHILE_setBody(node, statement)[source]
WHILE_setCondition(node, expression)[source]
WITH_build(tokenizer)[source]
WITH_finish(node)[source]
WITH_setBody(node, statement)[source]
WITH_setObject(node, expression)[source]
YIELD_build(tokenizer)[source]
YIELD_finish(node)[source]
YIELD_setValue(node, expression)[source]
setHoists(id, vds)[source]
Module contents
jasy.script.tokenize package
Submodules
jasy.script.tokenize.Lang module

JavaScript 1.7 keywords

jasy.script.tokenize.Tokenizer module
exception jasy.script.tokenize.Tokenizer.ParseError(message, fileId, line)[source]

Bases: Exception

class jasy.script.tokenize.Tokenizer.Token[source]

Bases: object

assignOp
end
line
start
type
value
class jasy.script.tokenize.Tokenizer.Tokenizer(source, fileId='', line=1)[source]

Bases: object

done()[source]
get(scanOperand=False)[source]

It consumes input only if there is no lookahead. Dispatches to the appropriate lexing function depending on the input.

getComments()[source]
input_
lexDot(ch)[source]
lexExponent()[source]
lexIdent(ch)[source]
lexNumber(ch)[source]
lexOp(ch)[source]
lexRegExp(ch)[source]
lexString(ch)[source]
lexZeroNumber(ch)[source]
match(tokenType, scanOperand=False)[source]
mustMatch(tokenType)[source]
peek(scanOperand=False)[source]
peekOnSameLine(scanOperand=False)[source]
skip()[source]

Eats comments and whitespace.

token
unget()[source]

Match depends on unget returning undefined.

Module contents
jasy.script.util package
Module contents
jasy.script.util.assembleDot(node, result=None)[source]

Joins a dot node (cascaded supported, too) into a single string like “foo.bar.Baz”.

jasy.script.util.detectObjectType(objectNode)[source]

Returns a human readable type information of the given node.

jasy.script.util.detectPlusType(plusNode)[source]

Analyses the given “plus” node and tries to figure out if a “string” or “number” result is produced.

jasy.script.util.findAssignments(name, node)[source]

Returns a list of assignments which might have impact on the value used in the given node.

jasy.script.util.findCall(node, methodName)[source]

Recurses the tree starting with the given node and returns the first node which calls the given method name (supports namespaces, too)

jasy.script.util.findCommentNode(node)[source]

Finds the first doc comment node inside the given node.

jasy.script.util.findFunction(node)[source]

Returns the first function inside the given node.

jasy.script.util.findReturn(node)[source]

Finds the first return inside the given node.

jasy.script.util.getCallName(node)[source]
jasy.script.util.getDocComment(node)[source]

Returns the first doc comment of the given node.

jasy.script.util.getKeyValue(dict, key)[source]

Returns the value node of the given key inside the given object initializer.

jasy.script.util.getParamNamesFromFunction(func)[source]

Returns a human readable list of parameter names (sorted by their order in the given function)

jasy.script.util.getParameterFromCall(call, index=0)[source]

Returns a parameter node by index on the call node.

jasy.script.util.getVisibility(name)[source]

Returns the visibility of the given name by convention.

jasy.script.util.query(node, matcher, deep=True, inner=False)[source]

Recurses the tree starting with the given node and returns the first node which is matched by the given matcher method.

  • node: any node
  • matcher: function which should return a truish value when node matches
  • deep: whether inner scopes should be scanned, too
  • inner: used internally to differentiate between current and inner nodes
jasy.script.util.queryAll(node, matcher, deep=True, inner=False, result=None)[source]

Recurses the tree starting with the given node and returns a list of nodes matched by the given matcher method.

  • node: any node
  • matcher: function which should return a truish value when node matches
  • deep: whether inner scopes should be scanned, too
  • inner: used internally to differentiate between current and inner nodes
  • result: can be used to extend an existing list, otherwise a new list is created and returned
jasy.script.util.requiresDocumentation(name)[source]

Whether the given name suggests that documentation is required.

jasy.script.util.resolveIdentifierNode(identifierNode)[source]
jasy.script.util.valueToString(node)[source]

Converts the value of the given node into something human friendly.

Submodules
jasy.script.Resolver module
class jasy.script.Resolver.Resolver(profile)[source]

Bases: jasy.abstract.Resolver.Resolver

addVirtual(name, text)[source]

Adds a virtual aka generated class to the resolver with the given name and text.

Please note: The file name is modified to contain a checksum of the content as a postfix. This keeps caches in-tact when using different contents for the same file name aka different sets of assets, translations, etc. The classname itself (which is modified here as said) is not so much of relevance because of the situation that the virtual class object is automatically added to the resolver (and sorter).

getItemDependencies(item)[source]
getSorted()[source]

Returns a list of sorted classes.

jasy.script.Sorter module
class jasy.script.Sorter.Sorter(resolver)[source]

Bases: jasy.abstract.Sorter.AbstractSorter

Sorter for Script items.

getItemBreaks(item)[source]
getItemDependencies(item)[source]
Module contents

jasy.style package

Subpackages
jasy.style.clean package
Submodules
jasy.style.clean.Permutate module

This class is responsible for resolving if-conditions based on permutation data Not all if blocks are being able to be resolved that way though as some use variables etc. which are not available before actual full processing of the content.

exception jasy.style.clean.Permutate.ResolverError(message, node=None)[source]

Bases: Exception

jasy.style.clean.Permutate.patch(tree, permutation)[source]
jasy.style.clean.Unused module
exception jasy.style.clean.Unused.Error(name, line)[source]

Bases: Exception

jasy.style.clean.Unused.cleanup(node)[source]
Module contents
jasy.style.output package
Submodules
jasy.style.output.Compressor module
class jasy.style.output.Compressor.Compressor(optimize=None, format=None)[source]

Bases: object

compress(node)[source]

Compresses the given node and returns the compressed text result.

indent(code)[source]

Indents the given code by the current indenting setup.

type_block(node)[source]
type_call(node)[source]
type_comma(node)[source]
type_expr(node)[source]
type_fontface(node)[source]
type_frame(node)[source]
type_function(node)[source]
type_identifier(node)[source]
type_keyframes(node)[source]
type_list(node)[source]
type_media(node)[source]
type_mixin(node)[source]
type_number(node)[source]
type_page(node)[source]
type_property(node)[source]
type_raw(node)[source]
type_selector(node)[source]
type_sheet(node)[source]
type_slash(node)[source]
type_string(node)[source]
type_supports(node)[source]
exception jasy.style.output.Compressor.CompressorError(message, node)[source]

Bases: Exception

jasy.style.output.Formatting module
class jasy.style.output.Formatting.Formatting(*args)[source]

Bases: jasy.core.FlagSet.FlagSet

Configures an formatting object which can be used to compress stylesheets afterwards.

The optimization set is frozen after initialization which also generates the unique key based on the given formatting options.

jasy.style.output.Optimization module
exception jasy.style.output.Optimization.Error(msg)[source]

Bases: Exception

Error object which is raised whenever an optimization could not be applied correctly.

class jasy.style.output.Optimization.Optimization(*args)[source]

Bases: jasy.core.FlagSet.FlagSet

Configures an optimization object which can be used to compress stylesheets afterwards.

The optimization set is frozen after initialization which also generates the unique key based on the given optimizations.

apply(tree)[source]

Applies the configured optimizations to the given node tree.

Modifies the tree in-place to be sure to have a deep copy if you need the original one. It raises an error instance whenever any optimization could not be applied to the given tree.

Module contents
jasy.style.parse package
Submodules
jasy.style.parse.Node module
class jasy.style.parse.Node.Node(tokenizer=None, type=None, args=[])[source]

Bases: jasy.parse.AbstractNode.AbstractNode

assignOp
comments
condition
dynamic
elsePart
end
fileId
initializer
line
name
names
noscope
params
parent
parenthesized
quote
rel
rules
scope
selector
start
statement
statements
thenPart
token
tokenizer
type
unit
value
variables
vendor
jasy.style.parse.Parser module
jasy.style.parse.Parser.AddExpression(tokenizer, staticContext)[source]
jasy.style.parse.Parser.AndExpression(tokenizer, staticContext)[source]
jasy.style.parse.Parser.ArgumentList(tokenizer, staticContext)[source]
jasy.style.parse.Parser.AssignExpression(tokenizer, staticContext)[source]
jasy.style.parse.Parser.Block(tokenizer, staticContext)[source]
jasy.style.parse.Parser.Charset(tokenizer, staticContext)[source]
jasy.style.parse.Parser.CssArgumentList(tokenizer, staticContext)[source]
jasy.style.parse.Parser.EqualityExpression(tokenizer, staticContext)[source]
jasy.style.parse.Parser.Expression(tokenizer, staticContext)[source]

Top-down expression parser for stylestyles.

jasy.style.parse.Parser.ExpressionArgument(tokenizer, staticContext)[source]
jasy.style.parse.Parser.FontFace(tokenizer, staticContext)[source]
jasy.style.parse.Parser.KeyFrames(tokenizer, staticContext)[source]

Supports e.g.:

@keyframes fade{
from, 10%{
background-color: #000000;

}

100%{
background-color: #FFFFFF;

}

}

jasy.style.parse.Parser.Media(tokenizer, staticContext)[source]

Supports e.g.:

@media print{
body{
background-color: #000000;

}

}

@media handheld, tv{
body{
background-color: yellow;

}

}

@media screen and (max-width: 300px) {
body{
background-color: orange;

}

}

jasy.style.parse.Parser.MemberExpression(tokenizer, staticContext)[source]
jasy.style.parse.Parser.MultiplyExpression(tokenizer, staticContext)[source]
jasy.style.parse.Parser.OrExpression(tokenizer, staticContext)[source]
jasy.style.parse.Parser.Page(tokenizer, staticContext)[source]

Supports e.g.:

@page{
margin: 1cm;

}

@page :first{
margin: 5cm 2cm;

}

jasy.style.parse.Parser.ParenExpression(tokenizer, staticContext)[source]

An expression in parens.

Sometimes to force priority of math operations etc.

exception jasy.style.parse.Parser.ParseError(message, tokenizer)[source]

Bases: Exception

jasy.style.parse.Parser.PrimaryExpression(tokenizer, staticContext)[source]
jasy.style.parse.Parser.Property(tokenizer, staticContext)[source]

Parses all CSS properties e.g.

  • background: red
  • font: 12px bold Arial;
jasy.style.parse.Parser.RawArgument(tokenizer, staticContext)[source]
jasy.style.parse.Parser.RelationalExpression(tokenizer, staticContext)[source]
jasy.style.parse.Parser.Root(tokenizer, staticContext)[source]

Supports e.g.:

h1{

font-size: 20px;

@root html.desktop &{
font-size: 30px;

}

}

.date{

color: black; background: white;

@root{
&__dialog{
position: absolute;

}

}

}

jasy.style.parse.Parser.Selector(tokenizer, staticContext)[source]

CSS selector parser e.g.

h1 .infobox #header h1::after h2:first-child

jasy.style.parse.Parser.Sheet(tokenizer, staticContext)[source]

Parses the toplevel and rule bodies.

jasy.style.parse.Parser.Statement(tokenizer, staticContext)[source]

Parses a Statement.

jasy.style.parse.Parser.Statements(tokenizer, staticContext)[source]

Parses a list of Statements.

class jasy.style.parse.Parser.StaticContext[source]

Bases: object

jasy.style.parse.Parser.Supports(tokenizer, staticContext)[source]
jasy.style.parse.Parser.UnaryExpression(tokenizer, staticContext)[source]
jasy.style.parse.Parser.UrlArgumentList(tokenizer, staticContext)[source]
jasy.style.parse.Parser.ValueExpression(tokenizer, staticContext)[source]

Top-down expression parser for rule values in stylestyles.

jasy.style.parse.Parser.Variable(tokenizer, staticContext)[source]

All kind of variable usage:

  • variable access
  • variable declaration
  • mixin declaration
  • mixin call
jasy.style.parse.Parser.addComments(currNode, prevNode, comments)[source]
jasy.style.parse.Parser.parse(source, fileId=None, line=1)[source]
jasy.style.parse.Parser.parseExpression(source, fileId=None, line=1)[source]
jasy.style.parse.ScopeScanner module
jasy.style.parse.ScopeScanner.scan(tree)[source]

Scans the given tree and attaches variable data instances (core/ScopeData.py) to every scope (aka function).

This data is being stored independently from the real tree so that if you modifiy the tree the data is not automatically updated. This means that every time you modify the tree heavily, it might make sense to re-execute this method to bring it in sync to the current tree structure.

Module contents
jasy.style.process package
Submodules
jasy.style.process.Executer module
exception jasy.style.process.Executer.ExecuterError(message, node)[source]

Bases: Exception

jasy.style.process.Executer.process(tree, profile)[source]
jasy.style.process.Flatter module
jasy.style.process.Flatter.process(tree)[source]

Flattens selectors to that h1{ span{ ... is merged into h1 span{ ...

jasy.style.process.Mixins module
jasy.style.process.Mixins.isExtendCall(node)[source]
jasy.style.process.Mixins.isMixinCall(node)[source]
jasy.style.process.Mixins.processExtends(tree)[source]

Processes all requests for mixin extends.

jasy.style.process.Mixins.processMixins(tree)[source]

Processes all mixin includes inside mixins.

jasy.style.process.Mixins.processSelectors(tree)[source]

Processes all mixin includes inside selectors.

jasy.style.process.Operation module
exception jasy.style.process.Operation.OperationError(message, node)[source]

Bases: Exception

jasy.style.process.Operation.castToBool(node)[source]

Returns the boolean Python representation for the given Node.

jasy.style.process.Operation.compute(node, first=None, second=None, operator=None, session=None)[source]

Recursively processes given operation node.

Consumes optional hints for the first/second child of an operation as well as the operator itself (in cases where it could not be figured out automatically). The session is useful for supporting commands inside of operations.

Module contents
jasy.style.tokenize package
Submodules
jasy.style.tokenize.Tokenizer module
class jasy.style.tokenize.Tokenizer.Token[source]

Bases: object

assignOp
end
line
quote
start
type
unit
value
class jasy.style.tokenize.Tokenizer.Tokenizer(source, fileId='', line=1)[source]

Bases: object

done()[source]
find(anyOf)[source]
get(scanOperand=False)[source]

It consumes input only if there is no lookahead. Dispatches to the appropriate lexing function depending on the input.

getComments()[source]
input_
lexDot(ch)[source]
lexIdent(ch)[source]
lexNumber(ch)[source]
lexOp(ch)[source]
lexString(ch)[source]
lexUnit()[source]

Parses units like %, cm, inch, px, etc.

lexZeroNumber(ch)[source]
match(tokenType, scanOperand=False)[source]
mustMatch(tokenType)[source]
peek(scanOperand=False)[source]
peekOnSameLine(scanOperand=False)[source]
rewind(point)[source]
save()[source]
skip()[source]

Eats comments and whitespace.

token
unget()[source]

Match depends on unget returning undefined.

exception jasy.style.tokenize.Tokenizer.TokenizerError(message, fileId, line)[source]

Bases: Exception

Module contents
Submodules
jasy.style.Engine module
jasy.style.Engine.compressTree(tree, optimizationLevel=0, formattingLevel=0)[source]

Returns the compressed result from the given tree.

jasy.style.Engine.getTokenizer(text, fileId=None)[source]

Returns a tokenizer for the given file content.

jasy.style.Engine.getTree(text, fileId=None)[source]

Returns a tree of nodes from the given text.

jasy.style.Engine.permutateTree(tree, permutation=None)[source]

Returns an optimized tree with permutations applied.

jasy.style.Engine.printTokens(text, fileId=None)[source]

Prints out a structured list of tokens.

jasy.style.Engine.reduceTree(tree, profile=None)[source]

Applies all relevant modifications to the tree to allow compression to CSS.

jasy.style.Resolver module
class jasy.style.Resolver.Resolver(profile)[source]

Bases: jasy.abstract.Resolver.Resolver

getItemDependencies(item)[source]
getSorted()[source]

Returns a list of sorted classes.

jasy.style.Sorter module
class jasy.style.Sorter.Sorter(resolver)[source]

Bases: jasy.abstract.Sorter.AbstractSorter

Sorter for Style items.

getItemBreaks(item)[source]
getItemDependencies(item)[source]
jasy.style.Util module
jasy.style.Util.assembleDot(node, result=None)[source]

Joins a dot node (cascaded supported, too) into a single string like “foo.bar.Baz”.

jasy.style.Util.castNativeToNode(value)[source]
jasy.style.Util.combineMediaQueryList(media)[source]
jasy.style.Util.combineSelector(node, stop=None)[source]

Figures out the fully qualified selector, media query and @supports value of the given Node.

jasy.style.Util.combineSelectorList(selector, stop, root=None)[source]
jasy.style.Util.combineSupportList(supports)[source]
jasy.style.Util.executeCommand(node, profile)[source]
jasy.style.Util.extractName(name)[source]
jasy.style.Util.extractVendor(name)[source]
Module contents

jasy.template package

Submodules
jasy.template.Compiler module
jasy.template.Compiler.compile(text, labels=[], nostrip=False, name=None)[source]
jasy.template.Compiler.escapeContent(content)[source]
jasy.template.Compiler.escapeMatcher(str)[source]
jasy.template.Compiler.walk(node, labels, nostrip)[source]
jasy.template.Parser module
jasy.template.Parser.tokenize(text, nostrip=False)[source]

Tokenizer for template @text {String}. Returns an array of tokens where tags are returned as an object with the keys tag and name while normal strings are kept as strings.

Optionally you can keep white spaces (line breaks, leading, trailing, etc.) by enabling @nostrip {Boolean?false}.

jasy.template.Parser.parse(text, nostrip=False)[source]

Returns the token tree of the given template @text {String}.

A token holds the following information:

  • tag: tag of the token
  • name: name of the token
  • nodes: children of the node

Optionally you can keep white spaces (line breaks, leading, trailing, etc.) by enabling @nostrip {Boolean?false}.

Module contents

jasy.test package

Subpackages
jasy.test.script package
Submodules
jasy.test.script.api module
class jasy.test.script.api.Tests(methodName='runTest')[source]

Bases: unittest.case.TestCase

process(code)[source]
test_boolean()[source]
test_closure()[source]
test_closure_call()[source]
test_closure_call_alter()[source]
test_closure_hook()[source]
test_closure_if_else()[source]
test_closure_namedfunc()[source]
test_closure_static()[source]
test_closure_static_doc()[source]
test_closure_static_hoisting()[source]
test_closure_static_later()[source]
test_closure_static_sum()[source]
test_construct()[source]
test_core_class()[source]
test_core_module()[source]
test_custom_type()[source]
test_dynamic()[source]
test_dynamic_auto()[source]
test_dynamic_cascaded()[source]
test_events()[source]
test_events_doc()[source]
test_events_reference()[source]
test_function()[source]
test_function_return_dotted()[source]
test_function_return_number()[source]
test_function_return_plus_string()[source]
test_function_return_plus_x()[source]
test_function_return_string()[source]
test_implement()[source]
test_include()[source]
test_interface()[source]
test_kinds()[source]
test_lines()[source]
test_literal()[source]
test_number()[source]
test_params()[source]
test_params_optional()[source]
test_primitives()[source]
test_properties()[source]
test_properties_groups()[source]
test_properties_init()[source]
test_properties_multi()[source]
test_properties_nullable()[source]
test_reference()[source]
test_specials()[source]
test_summary()[source]
test_summary_nodot()[source]
test_tags()[source]
test_unsupported()[source]
test_uses()[source]
test_values()[source]
test_visibility()[source]
jasy.test.script.blockreduce module
class jasy.test.script.blockreduce.Tests(methodName='runTest')[source]

Bases: unittest.case.TestCase

process(code)[source]
test_combine_inner_out()[source]
test_combine_inner_out_parens()[source]
test_combine_inner_out_parens_mix()[source]
test_combine_mixed()[source]
test_combine_mixed_empty()[source]
test_combine_number()[source]
test_combine_number_omit()[source]
test_combine_string()[source]
test_elseinline_cascaded()[source]
test_elseinline_elseif()[source]
test_elseinline_elseif_nolast()[source]
test_elseinline_return()[source]
test_elseinline_throw()[source]
test_if_deep_if()[source]
test_if_else_both_empty()[source]
test_if_else_cascaded()[source]
test_if_else_empty()[source]
test_if_else_expression()[source]
test_if_else_while_if()[source]
test_if_empty_else()[source]
test_if_empty_else_two()[source]
test_ifoptimize_assign()[source]
test_ifoptimize_assign_late()[source]
test_ifoptimize_crazy()[source]
test_ifoptimize_empty()[source]
test_loop_brackets()[source]
test_mergeassign_assign()[source]
test_mergeassign_assign_plus()[source]
test_mergeassign_object()[source]
test_mergereturn()[source]
test_parens_arithm()[source]
test_parens_assign()[source]
test_parens_condition()[source]
test_parens_directexec()[source]
test_parens_new()[source]
test_parens_new_args()[source]
test_parens_numberoper()[source]
test_parens_return()[source]
test_return_in_elseif()[source]
test_single_command_if_block()[source]
test_strict()[source]
test_switch_return()[source]
jasy.test.script.combinedecl module
class jasy.test.script.combinedecl.Tests(methodName='runTest')[source]

Bases: unittest.case.TestCase

process(code)[source]
test_combine_basic()[source]
test_combine_closure()[source]
test_combine_closure_innerfirst()[source]
test_combine_complex()[source]
test_combine_destruct()[source]
test_combine_destruct_assign()[source]
test_combine_doubles()[source]
test_combine_doubles_break()[source]
test_combine_doubles_for()[source]
test_combine_doubles_oneassign()[source]
jasy.test.script.comments module
class jasy.test.script.comments.Tests(methodName='runTest')[source]

Bases: unittest.case.TestCase

process(code)[source]
test_code_blocks_in_list()[source]
test_doc()[source]
test_doc_markdown_code()[source]
test_doc_markdown_code_html()[source]
test_doc_markdown_code_single_blockquote()[source]
test_doc_markdown_code_single_inline()[source]
test_doc_markdown_formatting()[source]
test_doc_markdown_formatting_code()[source]
test_doc_markdown_quote()[source]
test_doc_markdown_smartypants()[source]
test_doc_multiline()[source]
test_doc_multiline_clean()[source]
test_doc_multiline_clean_three()[source]
test_doc_multiline_three()[source]
test_doc_params()[source]
test_doc_params_dynamic()[source]
test_doc_params_dynamic_default()[source]
test_doc_params_dynamic_multi()[source]
test_doc_params_dynamic_multi_spacey()[source]
test_doc_params_firstloose()[source]
test_doc_params_firstwin()[source]
test_doc_params_in_code_block()[source]
test_doc_params_lazytypes()[source]
test_doc_params_maps()[source]
test_doc_params_maps_multi_levels()[source]
test_doc_params_namespaced()[source]
test_doc_return()[source]
test_doc_return_twotypes()[source]
test_doc_tags()[source]
test_doc_tags_clean()[source]
test_doc_unbound()[source]
test_doc_unbound_nobreak()[source]
test_missing_node()[source]
test_multi()[source]
test_multi_code_blocks()[source]
test_multi_context_block_after()[source]
test_multi_context_block_before()[source]
test_multi_context_inline()[source]
test_multi_context_inline_multiline()[source]
test_multi_context_section()[source]
test_multi_multiline()[source]
test_multi_multiline_otherbreaks()[source]
test_multi_two()[source]
test_multi_unbound()[source]
test_multi_unbound_nobreak()[source]
test_protected()[source]
test_protected_jquery()[source]
test_protected_newline()[source]
test_single()[source]
test_single_context_block_after()[source]
test_single_context_block_before()[source]
test_single_context_inline()[source]
test_single_context_section()[source]
test_single_two()[source]
test_single_unbound()[source]
test_single_unbound_nobreak()[source]
jasy.test.script.compressor module
class jasy.test.script.compressor.Tests(methodName='runTest')[source]

Bases: unittest.case.TestCase

process(code)[source]
test_and()[source]
test_arithm()[source]
test_arithm_decrement()[source]
test_arithm_increment()[source]
test_array_comprehension()[source]
test_array_number()[source]
test_array_sparse()[source]
test_array_string()[source]
test_bitwise_and()[source]
test_block_empty()[source]
test_block_separate()[source]
test_call_destruct()[source]
test_call_multiargs()[source]
test_call_singlearg()[source]
test_const()[source]
test_const_multi()[source]
test_continue()[source]
test_continue_label()[source]
test_declaration()[source]
test_declaration_destruct()[source]
test_delete()[source]
test_destruct_assign()[source]
test_destruct_for()[source]
test_destruct_for_let()[source]
test_do_while()[source]
test_dot()[source]
test_expression_closure()[source]
test_for_each()[source]
test_for_in()[source]
test_for_multiinit()[source]
test_for_simple()[source]
test_function_declared()[source]
test_function_expressed()[source]
test_generator_expression()[source]
test_generator_expression_guard()[source]
test_getter()[source]
test_hook_assign()[source]
test_hook_left_child()[source]
test_hook_right_child()[source]
test_hook_simple()[source]
test_hook_two_children()[source]
test_if()[source]
test_if_else()[source]
test_if_else_if()[source]
test_if_else_if_noblocks()[source]
test_if_else_noblocks()[source]
test_if_empty()[source]
test_if_noblock()[source]
test_if_not()[source]
test_if_not_else()[source]
test_in()[source]
test_increment_postfix()[source]
test_increment_prefix()[source]
test_index()[source]
test_let_definition()[source]
test_let_expression()[source]
test_let_statement()[source]
test_new()[source]
test_new_args()[source]
test_new_args_empty()[source]
test_new_args_empty_dot_call()[source]
test_new_args_empty_dot_call_paren()[source]
test_new_dot_call()[source]
test_number_float()[source]
test_number_float_short()[source]
test_number_float_zero_prefix()[source]
test_number_hex()[source]
test_number_int()[source]
test_number_max()[source]
test_number_min()[source]
test_object_init()[source]
test_object_init_trail()[source]
test_or()[source]
test_regexp()[source]
test_regexp_in_array()[source]
test_return()[source]
test_return_array()[source]
test_return_empty()[source]
test_setter()[source]
test_strict()[source]
test_string()[source]
test_string_escape()[source]
test_string_quotes()[source]
test_switch()[source]
test_throw()[source]
test_tofixed()[source]
test_trycatch()[source]
test_trycatch_guard()[source]
test_unary()[source]
test_unicode()[source]
test_while()[source]
test_while_comma_condition()[source]
jasy.test.script.deadcode module
class jasy.test.script.deadcode.Tests(methodName='runTest')[source]

Bases: unittest.case.TestCase

process(code)[source]
test_if_equal_false()[source]
test_if_equal_true()[source]
test_if_falsy()[source]
test_if_falsy_and_falsy()[source]
test_if_falsy_and_trueish()[source]
test_if_falsy_and_unknown()[source]
test_if_falsy_or_falsy()[source]
test_if_falsy_or_trueish()[source]
test_if_falsy_or_unknown()[source]
test_if_identical_false()[source]
test_if_identical_true()[source]
test_if_not_falsy()[source]
test_if_not_trueish()[source]
test_if_trueish()[source]
test_if_trueish_and_falsy()[source]
test_if_trueish_and_trueish()[source]
test_if_trueish_and_unknown()[source]
test_if_trueish_or_falsy()[source]
test_if_trueish_or_trueish()[source]
test_if_trueish_or_unknown()[source]
test_if_unknown_and_falsy()[source]
test_if_unknown_and_trueish()[source]
test_if_unknown_or_falsy()[source]
test_if_unknown_or_trueish()[source]
jasy.test.script.inject module
class jasy.test.script.inject.Tests(methodName='runTest')[source]

Bases: unittest.case.TestCase

process(code, contextId='')[source]
test_get()[source]
test_if_isset()[source]
test_isset_bool_false()[source]
test_isset_bool_shorthand_false()[source]
test_isset_bool_shorthand_true()[source]
test_isset_bool_true()[source]
test_isset_float_false()[source]
test_isset_float_true()[source]
test_isset_int_false()[source]
test_isset_int_true()[source]
test_isset_lookup()[source]
test_isset_str_multi()[source]
test_isset_str_multilong()[source]
test_isset_str_single()[source]
test_isset_typediff()[source]
test_select()[source]
test_select_default()[source]
test_select_multi()[source]
test_select_notfound()[source]
jasy.test.script.localvariables module
class jasy.test.script.localvariables.Tests(methodName='runTest')[source]

Bases: unittest.case.TestCase

process(code)[source]
test_accessor_names()[source]
test_args()[source]
test_basic()[source]
test_bind()[source]
test_closure()[source]
test_conflict_generatedname()[source]
test_conflict_param_var()[source]
test_conflict_same_name()[source]
test_declaration()[source]
test_exception()[source]
test_exception_catchvar()[source]
test_function()[source]
test_inline_access()[source]
test_let_definition()[source]
test_let_expression()[source]
test_let_statement()[source]
test_reuse_different()[source]
test_reuse_names()[source]
jasy.test.script.meta module
class jasy.test.script.meta.Tests(methodName='runTest')[source]

Bases: unittest.case.TestCase

process(code)[source]
test_asset_escape()[source]
test_assets()[source]
test_classes()[source]
test_other()[source]
test_structured()[source]
jasy.test.script.privates module
class jasy.test.script.privates.Tests(methodName='runTest')[source]

Bases: unittest.case.TestCase

process(code, contextId='')[source]
test_access_same_named_external()[source]

Is is somehow an unsupported edge case which is not supported correctly yet.

Normally one would expect that the access to __field on RemoteObj would raise an error. At least it breaks this wrong access because this field is renamed based on file name as well.

test_assign()[source]
test_assign_long()[source]
test_global_obj_file1()[source]
test_global_obj_file2()[source]
test_local_deep()[source]
test_localvar()[source]
test_localvar_undeclared()[source]
test_mixin()[source]
test_remote()[source]
jasy.test.script.translation module
class jasy.test.script.translation.Tests(methodName='runTest')[source]

Bases: unittest.case.TestCase

process(code)[source]
test_basic()[source]
test_marktr()[source]
test_trc1()[source]
test_trc2()[source]
test_trc3()[source]
test_trn1()[source]
test_trn2()[source]
test_vars1()[source]
test_vars2()[source]
test_vars3()[source]
test_vars4()[source]
jasy.test.script.unused module
class jasy.test.script.unused.Tests(methodName='runTest')[source]

Bases: unittest.case.TestCase

process(code)[source]
test_func_called()[source]
test_func_expressed_form_named()[source]
test_func_expressed_form_named_inner()[source]
test_func_named_called()[source]
test_func_named_direct_called()[source]
test_func_named_unused()[source]
test_func_unused()[source]
test_global_func()[source]
test_global_var()[source]
test_named_func_same_inner_outer()[source]
test_named_vs_var()[source]
test_object()[source]

Non expressions must be protected with parens.

test_object_multi()[source]

Non expressions must be protected with parens.

test_object_multi_others()[source]

Non expressions must be protected with parens.

test_outdent()[source]
test_outdent_multi_var()[source]
test_params_first()[source]

x is unused but could not be removed.

test_params_last()[source]

y is unused and can be removed.

test_params_middle()[source]

y is unused but could not be removed.

test_var_dep_blocks()[source]

y contains operation so could not be removed and x is still in use.

test_var_dep_closure()[source]

Removes y first and in a second run removes x as well.

test_var_ief()[source]
test_var_ief_end()[source]
test_var_ief_middle()[source]
test_var_ief_noparens()[source]
test_var_ief_noparens_end()[source]
test_var_ief_noparens_middle()[source]
test_var_multi_first()[source]

y is unused.

Removes list entry.

test_var_multi_last()[source]

y is unused.

Removes list entry.

test_var_same_inner_outer()[source]
test_var_single()[source]

y is unused.

Removed whole var block.

test_var_vs_named()[source]
test_var_vs_named_inner()[source]
Module contents
jasy.test.style package
Submodules
jasy.test.style.commands module
class jasy.test.style.commands.Tests(methodName='runTest')[source]

Bases: unittest.case.TestCase

process(code)[source]
test_expr_minus()[source]
test_expr_minus_compact()[source]
test_expr_plus()[source]
test_expr_plus_compact()[source]
test_minus()[source]
test_multi()[source]
test_noexpr_minus_compact()[source]
test_noexpr_plus_compact()[source]
test_raw()[source]
test_simple()[source]
test_unary_minus()[source]
test_unary_plus()[source]
jasy.test.style.conditionals module
class jasy.test.style.conditionals.Tests(methodName='runTest')[source]

Bases: unittest.case.TestCase

process(code)[source]
test_field()[source]
test_field_as_variable()[source]
test_if()[source]
test_if_else_false()[source]
test_if_else_false_paren()[source]
test_if_else_false_paren_notoper()[source]
test_if_else_true()[source]
jasy.test.style.cssat module
class jasy.test.style.cssat.Tests(methodName='runTest')[source]

Bases: unittest.case.TestCase

process(code)[source]
test_charset()[source]
test_charset_invalid()[source]
test_charset_wrong_syntax()[source]
test_page()[source]
test_page_selector_first()[source]
test_page_selector_left()[source]
test_page_selector_right()[source]
jasy.test.style.extend module
class jasy.test.style.extend.Tests(methodName='runTest')[source]

Bases: unittest.case.TestCase

process(code)[source]
test_atmedia()[source]
test_atsupport()[source]
test_basic()[source]
test_call()[source]
test_content_deeper()[source]
test_content_media_and_supports()[source]
test_content_simple()[source]
test_content_simple_double()[source]
test_content_with_followup()[source]
test_content_with_media_in_call()[source]
test_content_with_media_in_mixin()[source]
test_content_with_preceding()[source]
test_content_with_supports_in_call()[source]
test_content_with_supports_in_mixin()[source]
test_content_without_call()[source]
test_def_as_func()[source]
test_double()[source]
test_extend_or_mixin()[source]
test_local()[source]
test_local_complex()[source]
test_local_deeper()[source]
test_local_override()[source]
test_local_with_atmedia()[source]
test_local_with_atsupports()[source]
test_local_with_inner_atmedia()[source]
test_local_with_inner_atsupports()[source]
jasy.test.style.flattening module
class jasy.test.style.flattening.Tests(methodName='runTest')[source]

Bases: unittest.case.TestCase

process(code)[source]
test_media_with_one_selector()[source]
test_merge_media()[source]
test_merge_media_and_selector()[source]
test_merge_media_and_selector_conditional()[source]
test_merge_selector()[source]
test_order()[source]
test_order_inner_media()[source]
jasy.test.style.fontface module
class jasy.test.style.fontface.Tests(methodName='runTest')[source]

Bases: unittest.case.TestCase

process(code)[source]
test_double()[source]
test_multi_local()[source]
test_single()[source]
jasy.test.style.keyframes module
class jasy.test.style.keyframes.Tests(methodName='runTest')[source]

Bases: unittest.case.TestCase

process(code)[source]
test_multistep()[source]
test_named()[source]
test_named_prefixed()[source]
test_percent()[source]
jasy.test.style.media module
class jasy.test.style.media.Tests(methodName='runTest')[source]

Bases: unittest.case.TestCase

process(code)[source]
test_and()[source]
test_and_color()[source]
test_and_inner()[source]
test_comma()[source]
test_comma_and()[source]
test_inner()[source]
test_inner_children()[source]
test_inner_double()[source]
test_inner_double_list()[source]
test_inner_double_switched()[source]
test_inner_not_double()[source]
test_print()[source]
test_ratio()[source]
test_reallife_pixel()[source]
test_size()[source]
jasy.test.style.mixins module
class jasy.test.style.mixins.Tests(methodName='runTest')[source]

Bases: unittest.case.TestCase

process(code)[source]
test_content_complex()[source]
test_content_double()[source]
test_content_mediaquery_case()[source]
test_content_none()[source]
test_content_simple()[source]
test_content_with_param()[source]
test_content_with_param_double()[source]
test_default_param()[source]
test_default_param_two_extends()[source]
test_double()[source]
test_local_override()[source]
test_param()[source]
test_param_forcall()[source]
test_param_missing()[source]
test_param_mixed_units()[source]
test_param_name_conflicts()[source]
test_param_name_conflicts_default_ignore()[source]
test_param_name_conflicts_default_use()[source]
test_param_name_default_from_outer()[source]
test_param_toomany()[source]
test_param_transparent_units()[source]
test_param_uses_extend()[source]
test_param_with_compution()[source]
test_param_with_mixed_compution()[source]
test_wrong_place_call()[source]
test_wrong_place_variable()[source]
jasy.test.style.parentreference module
class jasy.test.style.parentreference.Tests(methodName='runTest')[source]

Bases: unittest.case.TestCase

process(code)[source]
test_after()[source]
test_attribute()[source]
test_before()[source]
test_bem()[source]
test_between()[source]
test_inside()[source]
test_inside_variant()[source]
jasy.test.style.root module
class jasy.test.style.root.Tests(methodName='runTest')[source]

Bases: unittest.case.TestCase

process(code)[source]
test_basic()[source]
test_basic_media()[source]
test_basic_supports()[source]
test_deep()[source]
test_deep_multidist()[source]
test_parentreference_append()[source]
test_parentreference_append_multiroot()[source]
test_parentreference_between()[source]
test_parentreference_extend_content_double()[source]
test_parentreference_extend_content_double_deeper()[source]
test_parentreference_extend_content_double_multi()[source]
test_parentreference_extend_content_single()[source]
test_parentreference_generatedcontent()[source]
test_parentreference_inline()[source]
test_parentreference_inline_extend()[source]
test_parentreference_inline_inner()[source]
test_parentreference_inline_multidist_extend()[source]
test_parentreference_inline_multiroot()[source]
test_parentreference_inline_multiroot_multidist()[source]
jasy.test.style.selectorcss3 module
class jasy.test.style.selectorcss3.Tests(methodName='runTest')[source]

Bases: unittest.case.TestCase

process(code)[source]
test_adjacent_sibling_combinator()[source]
test_attribute()[source]
test_attribute_compare1()[source]
test_attribute_compare2()[source]
test_attribute_compare3()[source]
test_attribute_compare4()[source]
test_attribute_compare5()[source]
test_attribute_equal()[source]
test_child_combinator()[source]
test_class_multi()[source]
test_classname()[source]
test_general_sibling_combinator()[source]
test_id()[source]
test_id_multi()[source]
test_methodlike_iterarg()[source]
test_methodlike_lang()[source]
test_methodlike_noarg()[source]
test_methodlike_not()[source]
test_methodlike_posarg()[source]
test_pseudo_class()[source]
test_pseudo_element()[source]
test_pseudo_element_dashed()[source]
test_star()[source]
test_tag()[source]
test_tag_child()[source]
test_tag_id()[source]
test_tag_multi()[source]
jasy.test.style.specials module
class jasy.test.style.specials.Tests(methodName='runTest')[source]

Bases: unittest.case.TestCase

process(code)[source]
test_mozfullscreen()[source]
test_msbackdrop()[source]
jasy.test.style.strings module
class jasy.test.style.strings.Tests(methodName='runTest')[source]

Bases: unittest.case.TestCase

process(code)[source]
test_basic()[source]
test_quotes()[source]
test_single()[source]
jasy.test.style.supports module
class jasy.test.style.supports.Tests(methodName='runTest')[source]

Bases: unittest.case.TestCase

process(code)[source]
test_atmedia()[source]
test_atmedia_deeper()[source]
test_between()[source]
test_combined()[source]
test_combined_inner()[source]
test_inner()[source]
test_join()[source]
test_join_inside_atmedia()[source]
test_outer()[source]
jasy.test.style.values module
class jasy.test.style.values.Tests(methodName='runTest')[source]

Bases: unittest.case.TestCase

process(code)[source]
test_collection_arguments()[source]
jasy.test.style.variables module
class jasy.test.style.variables.Tests(methodName='runTest')[source]

Bases: unittest.case.TestCase

process(code)[source]
test_complex_font_setting()[source]
test_condition_define_new()[source]
test_condition_define_new_override()[source]
test_condition_redefine()[source]
test_condition_redefine_deep()[source]
test_condition_redefine_override()[source]
test_condition_strcomp()[source]
test_default_available()[source]
test_default_new()[source]
test_define_assignop_multi()[source]
test_define_assignop_plus()[source]
test_define_color_hex()[source]
test_define_color_hex3()[source]
test_define_color_rgb()[source]
test_define_multi()[source]
test_define_multi_mutation_begin()[source]
test_define_multi_mutation_end()[source]
test_define_multi_mutation_plex()[source]
test_define_multi_plus_operation_decl()[source]
test_define_override()[source]
test_define_unary()[source]
test_math_operation()[source]
test_math_operation_percent()[source]
test_mixed_operation()[source]
test_nonequal()[source]
test_nonequal_combined()[source]
test_nonequal_combined_human()[source]
test_nonequal_combined_parens()[source]
test_string_operation()[source]
test_unused()[source]
test_unused_operation()[source]
test_value_operator_math()[source]
test_value_simple()[source]
test_value_simple_math()[source]
test_value_simple_multi()[source]
test_value_simple_namespaced()[source]
test_value_simple_scope()[source]
test_variable_property()[source]
test_variable_selector()[source]
test_variable_selector_complex()[source]
test_variable_usedonly_in_property()[source]
test_variable_usedonly_in_selector()[source]
Module contents
Submodules
jasy.test.assettype module
class jasy.test.assettype.Tests(methodName='runTest')[source]

Bases: unittest.case.TestCase

createGIF(path)[source]
createJPG(path)[source]
createPNG(path)[source]
test_img_file_classes()[source]
test_img_info_class()[source]
test_type_correction()[source]
jasy.test.cache module
class jasy.test.cache.Tests(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_clear()[source]
test_close_and_reopen()[source]
test_overwriting()[source]
test_store_and_read()[source]
test_store_iMfalse_and_read_iMfalse()[source]
test_store_iMfalse_and_read_iMtrue()[source]
test_store_iMtrue_and_read_iMfalse()[source]
test_store_read_transient()[source]
jasy.test.config module
class jasy.test.config.Tests(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_config_object_getdata()[source]
test_config_object_getdata_withdot()[source]
test_config_object_hasdata()[source]
test_config_object_setdata()[source]
test_config_object_setdata_withdot()[source]
test_matching_types()[source]
test_write_and_read_json()[source]
test_write_and_read_yaml()[source]
test_write_json()[source]
test_write_yaml()[source]
jasy.test.giturl module
class jasy.test.giturl.Tests(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_git_urls()[source]
jasy.test.options module
class jasy.test.options.Tests(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_add()[source]
test_add_and_parse()[source]
test_getTasks()[source]
test_parse()[source]
jasy.test.project module
class jasy.test.project.Tests(methodName='runTest')[source]

Bases: unittest.case.TestCase

createCaseFour()[source]
createCaseOne()[source]
createCaseThree()[source]
createCaseTwo()[source]
createjpyaml(path)[source]
createjpyaml_withContent(path)[source]
getProjects()[source]
readFile(path, fileName)[source]
test_assets()[source]
test_fields()[source]
test_get_class_by_name()[source]
test_get_name_from_path()[source]
test_get_project()[source]
test_has_requires()[source]
test_manual_class_fusion()[source]
test_scan()[source]
test_translations()[source]
writeFile(path, fileName, content)[source]
jasy.test.requirements module
class jasy.test.requirements.Tests(methodName='runTest')[source]

Bases: unittest.case.TestCase

createProject(session, requirements)[source]
createRequirement(name, subrequirements=None, manPath=None)[source]
createSubRequirement(name, manPath=None)[source]
createjpyaml(path, requirements)[source]
readFile(path, fileName)[source]
test_classes()[source]
test_has_requires()[source]
test_requires()[source]
test_same_subrequirements()[source]
test_subrequirement()[source]
test_subrequirement_classes()[source]
writeFile(path, fileName, content)[source]
jasy.test.session module
class jasy.test.session.Tests(methodName='runTest')[source]

Bases: unittest.case.TestCase

createProject(session, requirements, onlyFileCreation=False)[source]
createRequirement(name, manPath=None)[source]
createjpyaml(path, requirements)[source]
readFile(path, fileName)[source]
test_init()[source]
test_load_library()[source]
test_locale()[source]
test_other_process()[source]
test_pause_resume()[source]
test_permutate()[source]
writeFile(path, fileName, content)[source]
jasy.test.text module
class jasy.test.text.Tests(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_markdown()[source]
Module contents

jasy.vcs package

Submodules
jasy.vcs.Git module
jasy.vcs.Git.cleanRepository()[source]

Cleans git repository from untracked files.

jasy.vcs.Git.distcleanRepository()[source]

Cleans git repository from untracked files.

Ignores the files listed in ”.gitignore”.

jasy.vcs.Git.expandVersion(version=None)[source]
jasy.vcs.Git.getBranch(path=None)[source]

Returns the name of the git branch.

jasy.vcs.Git.getRevision(path=None)[source]

Returns the last revision/hash of the git repository.

jasy.vcs.Git.getShortRevision(path=None)[source]

Returns the last shortened revision/hash of the git repository.

jasy.vcs.Git.isUrl(url)[source]

Figures out whether the given string is a valid Git repository URL.

jasy.vcs.Git.update(url, version, path, update=True, submodules=True)[source]

Clones the given repository URL (optionally with overriding/update features)

jasy.vcs.Repository module
jasy.vcs.Repository.clean(path=None)[source]

Cleans repository from untracked files.

Parameters:url (string) – Path to the local repository
jasy.vcs.Repository.distclean(path=None)[source]

Cleans repository from untracked and ignored files. This method is pretty agressive in a way that it deletes all non repository managed files e.g. external folder, uncommitted changes, unstaged files, etc.

Parameters:url (string) – Path to the local repository
jasy.vcs.Repository.getRevision(path=None)[source]

Returns the current revision of the repository in the given path.

jasy.vcs.Repository.getTargetFolder(url, version=None)[source]

Returns the target folder name based on the URL and version using SHA1 checksums.

Parameters:
  • url (string) – URL to the repository
  • version – Version to use
jasy.vcs.Repository.getType(url)[source]

Returns repository type of the given URL.

Parameters:url (string) – URL to the repository
jasy.vcs.Repository.isUrl(url)[source]

Figures out whether the given string is a valid Git repository URL.

Parameters:url (string) – URL to the repository
jasy.vcs.Repository.update(url, version=None, path=None, update=True)[source]

Clones the given repository URL (optionally with overriding/update features)

Parameters:
  • url (string) – URL to the repository
  • version – Version to clone
  • version – Destination path
  • version – Eneable/disable update functionality
jasy.vcs.Svn module
jasy.vcs.Svn.getBranch(path=None)[source]

Returns the current branch name.

jasy.vcs.Svn.getInfo(path=None)[source]
jasy.vcs.Svn.getRevision(path=None)[source]

Returns the last revision/hash of the svn.

Module contents

Module contents

Jasy - Web Tooling Framework

Jasy is a powerful Python3-based tooling framework. It makes it easy to manage heavy web projects. Its main goal is to offer an API which could be used by developers to write their custom build/deployment scripts.

exception jasy.UserError[source]

Bases: Exception

Standard Jasy error class raised whenever something happens which the system understands (somehow excepected)

jasy.info()[source]

Prints information about Jasy to the console.

Indices and tables