repository Module

class pipelet.repository.Repository(lstseg, permissive=False)[source]

Location of the segment’s source code.

A reposiroty is the location where to find the segment’s source code files. It returns the full path of all files that will be used to execute the segment (code, hook, ...). By default, local repositories are used, but it can also be a version control system (git, CVS, ...).

get_all_string(seg)[source]

Return all code as a string.

get_code_string(seg)[source]

Return segment code as a string.

This is done to prevent file changes after hashkey computation.

get_deps_string(seg)[source]

Return external dependency code as a string.

This is done to prevent file changes after hashkey computation.

get_directive(Direct, seg)[source]

Initialize a directive object from segment seg.

>>> r = LocalRepository(['fourth'], "./test/first_test")
>>> print r.get_directive (Multiplex, 'fourth').__class__
pipelet.directive.Multiplex
get_docline(seg)[source]

Return the segment synopsis doc line.

static get_file_content(filename)[source]

Read content of a given file

This is the default to read dependencies of a segment.

>>> print Repository.get_file_content ('./test/first_test/third.py')[0:17]
adj = 'the_brave'
get_fns()[source]

Return filename candidates.

get_hook_list(seg)[source]

Return the list of hooks for a segment

get_hook_string(seg, hook)[source]

Return hook code as a string.

This is done to prevent file changes after hashkey computation.

class pipelet.repository.LocalRepository(lst_seg, src_path, permissive=False)[source]

Bases: pipelet.repository.Repository

A local repository is made of a main directory where to find segment’s code file.

static get_code_source(filename)[source]

Read source code from file

>>> print LocalRepository.get_code_source ('./test/first_test/third.py')[0:17]
adj = 'the_brave'
get_fns()[source]

Return filename candidates.

>>> r = LocalRepository(['first','second'], "./test/first_test", permissive=True)
>>> print r.get_fns()
['./test/first_test/second.py', './test/first_test/fourth.py', './test/first_test/third.py', './test/first_test/main.py', './test/first_test/first.py']

Table Of Contents

This Page