Package libxyz :: Package core :: Module dsl :: Class XYZ

[hide private]
[frames] | no frames]

# Class XYZ

source code

    object --+
             |
            XYZ

XYZ DSL implementation object

Instance Methods | [hide private]

a new object with type S, a subtype of T

__new__(cls, xyz) | source code

Inherited from `object`: `__delattr__`, `__getattribute__`, `__hash__`, `__init__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__str__`

Class Methods | [hide private]

init_macros(cls) | source code

_clear(cls) | source code

let(cls, var, val, sect=u"local") Set variable. | source code

val(cls, var, sect=u"local") Return variable value or None if undefined | source code

section(cls, sect=u"local") Return whole configuration section contents as a dictionary or None if undefined | source code

unlet(cls, var, sect=u"local") Unset variable | source code

load(cls, plugin) Load method[s] from plugin | source code

bind(cls, method, shortcut, context="DEFAULT") Bind method to shortcut | source code

kbd(cls, *args) Create keyboard shortcut | source code

exec_file(cls, filename) Execute DSL in file | source code

action(cls, rule, fn) Set up an action to be taken upon pressing action key on file | source code

macro(cls, macroname) Expand macro name. | source code

call(cls, method, *args, **kwargs) Call plugin method | source code

env(cls, var, default=None) Return environment variable or default if is not set | source code

shell(cls, cmd, *args, **kwargs) Execute command via :core:shell plugin Optional boolean argument 'current' can be provided to indicate that cmd is to be run from current directory. | source code

alias(cls, alias, replace) Set an alias which will be expanded in command line before execution | source code

icmd(cls, command, obj) Set an internal command. | source code

plugins_on(cls, *plugins) Enable plugin[s] | source code

plugins_off(cls, *plugins) Disable plugin[s] | source code

plugin_conf(cls, plugin, opts) Configure plugin. | source code

prefix(cls, shortcut) Set new prefix key | source code

help(cls, obj=None) Help | source code

vfs(cls, prefix, vfsclass) Set prefix and VFSObject class for VFS dispatching | source code

vfs_path(cls, path, driver) Construct path using provided VFS driver | source code

hook(cls, event, proc) Register a new hook. | source code

unhook(cls, event) Remove all hooks for the event | source code

fsrule(cls, rule) Return libxyz.core.FSRule instance | source code

palette(cls, config) Create internal palette object | source code

skin(cls, **kwargs) Make and register new skin | source code

execute(cls, source) Execute DSL statements | source code

get_env(cls) Return copy of global dsl environment | source code

Class Variables | [hide private]

| api = `["let", "val", "section", "unlet", "load", "bind", "exec`...``
| EVENT_CONF_UPDATE = `u"event:conf_update"`
| macros = `{}`
| _instance = `None`
| _env = `{}`

Properties | [hide private]

Inherited from `object`: `__class__`

Method Details | [hide private]

### __new__(cls, xyz)

source code

Returns: a new object with type S, a subtype of T
Overrides: object.__new__
  (inherited documentation)

### let(cls, var, val, sect=u"local")
Class Method

source code

Set variable. Variable will be available in xyz.conf[section][varname] If section is not provided - local will be used

Decorators:
  - `@instantiated`

### val(cls, var, sect=u"local")
Class Method

source code

Return variable value or None if undefined

Decorators:
  - `@instantiated`

### section(cls, sect=u"local")
Class Method

source code

Return whole configuration section contents as a dictionary or None if undefined

Decorators:
  - `@instantiated`

### unlet(cls, var, sect=u"local")
Class Method

source code

Unset variable

Decorators:
  - `@instantiated`

### load(cls, plugin)
Class Method

source code

Load method[s] from plugin

Decorators:
  - `@instantiated`

### bind(cls, method, shortcut, context="DEFAULT")
Class Method

source code

Bind method to shortcut

Decorators:
  - `@instantiated`

### kbd(cls, *args)
Class Method

source code

Create keyboard shortcut

Decorators:
  - `@instantiated`

### exec_file(cls, filename)
Class Method

source code

Execute DSL in file

Decorators:
  - `@instantiated`

### action(cls, rule, fn)
Class Method

source code

Set up an action to be taken upon pressing action key on file

Decorators:
  - `@instantiated`

### macro(cls, macroname)
Class Method

source code

Expand macro name.

Availbale macros: * ACT_CWD -- Working directory in active panel * INACT_CWD -- Working directory in inactive panel * ACT_PATH -- Full selected object path in active panel * INACT_PATH -- Full selected object path in inactive panel * ACT_BASE -- Parent directory in active panel * INACT_BASE -- Parent directory in inactive panel * ACT_TAGGED -- List of tagged files in active panel * INACT_TAGGED -- List of tagged files in inactive panel * ACT_UNTAGGED -- List of not tagged files in active panel * INACT_UNTAGGED -- List of not tagged files in inactive panel

Decorators:
  - `@instantiated`

### call(cls, method, *args, **kwargs)
Class Method

source code

Call plugin method

Decorators:
  - `@instantiated`

### env(cls, var, default=None)
Class Method

source code

Return environment variable or default if is not set

Decorators:
  - `@instantiated`

### shell(cls, cmd, *args, **kwargs)
Class Method

source code

Execute command via :core:shell plugin Optional boolean argument 'current' can be provided to indicate that cmd is to be run from current directory. Optional boolean argument 'bg' can be provided to indicate that cmd must be executed in background Optional boolean argument 'reload' can be provided to indicate that panel content should/should not be reloaded after execution Optional boolean argument 'wait' can be provided to indicate that shell should/should not wait for user input after command executed The wait flag has higher priority than :core:shell's `wait` configuration flag.

Decorators:
  - `@instantiated`

### alias(cls, alias, replace)
Class Method

source code

Set an alias which will be expanded in command line before execution

Parameters:
  - `replace` - Either string or function
Decorators:
  - `@instantiated`

### icmd(cls, command, obj)
Class Method

source code

Set an internal command.

Decorators:
  - `@instantiated`

### plugins_on(cls, *plugins)
Class Method

source code

Enable plugin[s]

Decorators:
  - `@instantiated`

### plugins_off(cls, *plugins)
Class Method

source code

Disable plugin[s]

Decorators:
  - `@instantiated`

### plugin_conf(cls, plugin, opts)
Class Method

source code

Configure plugin.

Parameters:
  - `plugin` - Plugin name
  - `opts` - dict {var1: val1, var2: var2,..}
Decorators:
  - `@instantiated`

### prefix(cls, shortcut)
Class Method

source code

Set new prefix key

Decorators:
  - `@instantiated`

### help(cls, obj=None)
Class Method

source code

Help

Decorators:
  - `@instantiated`

### vfs(cls, prefix, vfsclass)
Class Method

source code

Set prefix and VFSObject class for VFS dispatching

Decorators:
  - `@instantiated`

### vfs_path(cls, path, driver)
Class Method

source code

Construct path using provided VFS driver

Decorators:
  - `@instantiated`

### hook(cls, event, proc)
Class Method

source code

Register a new hook. Event is an event string and proc is a procedure to be called

Decorators:
  - `@instantiated`

### unhook(cls, event)
Class Method

source code

Remove all hooks for the event

Decorators:
  - `@instantiated`

### fsrule(cls, rule)
Class Method

source code

Return libxyz.core.FSRule instance

Decorators:
  - `@instantiated`

### palette(cls, config)
Class Method

source code

    Create internal palette object

    @param config: Dictionary of form:
    {
       'foreground': COLOR,
       'background': COLOR,
       'fg_attributes': [ATTR],
       'mono': [ATTR],
       'foreground_high': HG_COLOR,
       'background_high': HG_COLOR
    }

Decorators:
  - `@instantiated`

### skin(cls, **kwargs)
Class Method

source code

Make and register new skin

Decorators:
  - `@instantiated`

### execute(cls, source)
Class Method

source code

Execute DSL statements

Parameters:
  - `source` - Either string or open file-object or code object
Decorators:
  - `@instantiated`

### get_env(cls)
Class Method

source code

Return copy of global dsl environment

Decorators:
  - `@instantiated`

Class Variable Details | [hide private]

### api

Value:

      ["let", "val", "section", "unlet", "load", "bind", "exec_file", "kbd",
       "action", "macro", "call", "env", "shell", "alias", "plugins_on", "pl
      ugins_off", "plugin_conf", "icmd", "prefix", "help", "vfs", "vfs_path"
      , "hook", "unhook", "fsrule", "palette", "skin"]