Example #1
0
  @task
  def wrapper():
    """Calls nut_shell.simple with some arguments, the args that aren't provided will be collected.
    """
    call(simple, arg1=1, arg2=2)

  @task
  def get():
    """Get user input through utils.get.
    """
    print get(desc='Email id', type=regex.email)

  def log(message):
    """A helper method.
    """
    print message

  name = 'intro' # Groups could even have variables.

# importing other modules
import simple
member(simple) # member() is used to expose imported members as the children of the current module

@exit_hook
def clean_up(): # exit hooks are called when ec exits. There may be more than one hook.
  print ':)'

module(desc='A module to test decorator based configuration.') # module is an optional call, used to configure the group that wraps current module.

settings(dev_mode=True) # settings for ec
Example #2
0
File: nester.py Project: Laufire/ec
"""
nester
======

Used to test nested modules.
"""
from ec.ec import member, task

import simple

member(simple) # add the imported member to the script

@task
def task1():
  print 'task1'