Bases: plainbox.abc.ITextSource
A ITextSource describing text that originated arguments to main()
Attr arg_name: | The optional name of the argument that describes the arg_value |
---|---|
Attr arg_value: | The argument that was passed on command line (the actual text) |
Bases: plainbox.abc.ITextSource
A ITextSource subclass indicating that text came from a file.
Variables: | filename – name of the file something comes from |
---|
Bases: plainbox.abc.ITextSource
A ITextSource subclass indicating that text came from job output.
This class is used by SessionState._gen_rfc822_records_from_io_log() to allow such (generated) jobs to be traced back to the job that generated them.
Variables: | job – plainbox.impl.job.JobDefinition instance that generated the text |
---|
Bases: builtins.object
Simple class for tracking where something came from
This class supports “pinpointing” something in a block of text. The block is described by the source attribute. The actual range is described by line_start (inclusive) and line_end (exclusive).
Variables: |
|
---|
Create an Origin instance pointing at the call site of this method.
create a new Origin that points to the whole file
Returns: | A new Origin with line_end and line_start both set to None. |
---|
Create a new Origin that points to the start line
Returns: | A new Origin with the end_line equal to start_line. This effectively makes the origin describe a single line. |
---|
Compute the “mode” of this origin instance.
Returns: | OriginMode.whole_file, OriginMode.single_line or OriginMode.line_range. |
---|
The mode tells if this instance is describing the whole file, a range of lines or just a single line. It is mostly used internally by the implementation.
Create a Origin with source relative to the specified base directory.
Parameters: | base_dir – A base directory name |
---|---|
Returns: | A new Origin with source replaced by the result of calling relative_to(base_dir) on the current source iff the current source has that method, self otherwise. |
This method is useful for obtaining user friendly Origin objects that have short, understandable filenames.
Bases: plainbox.impl.symbol.SymbolDef
A symbol definition (which will become an enumeration in the near future) that describes all the possible “modes” an Origin can operate in.
Get all symbols defined by this symbol definition block
Bases: plainbox.impl.secure.origin.FileTextSource
A FileTextSource subclass indicating the file was a python file.
It implements no differences but in some context it might be helpful to differentiate on the type of the source field in the origin of a job definition record.
Variables: | filename – name of the python filename that something comes from |
---|
Compute a FileTextSource with the filename being a realtive path from the specified base directory.
Parameters: | base_dir – A base directory name |
---|---|
Returns: | A new FileTextSource with filename relative to that base_dir |
Bases: plainbox.abc.ITextSource
A ITextSource subclass indicating that the source of text is unknown.
This instances of this class are constructed by gen_rfc822_records() when no explicit source is provided and the stream has no name. The serve as non-None values to prevent constructing PythonFileTextSource with origin computed from Origin.get_caller_origin()