Esempio n. 1
0
 def __init__(self, name: str):
     super().__init__(name)
     self.stop_on_close: BoolOption = \
         BoolOption('stop_on_close', "Stop service when pipe is closed", default=True)
     self.data_pipe: StrOption = \
         StrOption('data_pipe', "Data Pipe Identification", required=True,
                   default='readfile')
     self.pipe_address: ZMQAddressOption = \
         ZMQAddressOption('pipe_address', "Data Pipe endpoint address",
                          required=True)
     self.pipe_mode: EnumOption = \
         EnumOption('pipe_mode', SocketMode, "Data Pipe Mode", required=True,
                    default=SocketMode.BIND)
     self.pipe_format: MIMEOption = \
         MIMEOption('pipe_format', "Pipe data format specification", required=True,
                    default=MIME('text/plain;charset=utf-8'))
     self.pipe_batch_size: IntOption = \
         IntOption('pipe_batch_size', "Data batch size", required=True, default=50)
     self.filename: StrOption = \
         StrOption('filename', "File specification", required=True)
     self.file_mode: EnumOption = \
         EnumOption('file_mode', FileOpenMode, "File I/O mode", required=False)
     self.file_format: MIMEOption = \
         MIMEOption('file_format', "File data format specification",
                    required=True, default=MIME('text/plain;charset=utf-8'))
Esempio n. 2
0
 def __init__(self, name: str):
     super().__init__(name)
     # Adjust default batch_size to compensate default 64K messages
     self.batch_size.default = 5
     #: Firebird server indetification (in driver configuration)
     self.server: StrOption = \
         StrOption('server', "Firebird server identification", required=True)
     #: Max. number of characters transmitted in one message
     self.max_chars: IntOption = \
         IntOption('max_chars', "Max. number of characters transmitted in one message",
                   required=True, default=65535)
     #: Trace session configuration
     self.trace: StrOption = \
         StrOption('trace', "Trace session configuration", required=True)
     #: Trace session name
     self.session_name: StrOption = \
         StrOption('session_name', "Trace session name")
Esempio n. 3
0
 def __init__(self, name: str):
     super().__init__(name)
     #: File specification
     self.filename: StrOption = StrOption('filename',
                                          "File specification",
                                          required=True)
     #: Data block size
     self.block_size: IntOption = \
         (IntOption('block_size',
                    "Data block size in bytes (-1 when size is stored before the data)",
                    required=True, signed=True))
Esempio n. 4
0
 def __init__(self, name: str):
     super().__init__(name)
     #
     self.output_pipe_format.default = MIME('text/plain;charset=utf-8')
     self.output_pipe_format.set_value(MIME('text/plain;charset=utf-8'))
     #
     self.template: StrOption = \
         StrOption('template', "Text formatting template")
     self.func: PyCallableOption = \
         PyCallableOption('func',
                          "Function that returns text representation of data",
                          'def f(data: Any, utils: TransformationUtilities) -> str:\n  ...\n')
Esempio n. 5
0
 def __init__(self, name: str):
     super().__init__(name)
     #: File specification
     self.filename: StrOption = StrOption('filename',
                                          "File specification",
                                          required=True)
     #: File I/O mode
     self.file_mode: EnumOption = \
         (EnumOption('file_mode', FileOpenMode, "File I/O mode", required=False,
                     default=FileOpenMode.WRITE))
     #: File storage type
     self.file_type: EnumOption = \
         (EnumOption('file_type', FileStorageType, "File data storage type", required=True))
Esempio n. 6
0
 def __init__(self, name: str):
     super().__init__(name)
     self.propagate_input_error: BoolOption = \
         BoolOption('propagate_input_error',
                    "When input pipe is closed with error, close output with error as well",
                    default=True)
     # Input pipe
     self.input_pipe: StrOption = \
         StrOption('input_pipe', "Data Pipe Identification", required=True)
     self.input_pipe_address: ZMQAddressOption = \
         ZMQAddressOption('input_pipe_address', "Data Pipe endpoint address", required=True)
     self.input_pipe_mode: EnumOption = \
         EnumOption('input_pipe_mode', SocketMode, "Data Pipe Mode", required=True)
     self.input_pipe_format: MIMEOption = \
         MIMEOption('input_pipe_format', "Pipe data format specification")
     self.input_batch_size: IntOption = \
         IntOption('input_batch_size', "Data batch size", required=True, default=50)
     self.input_ready_schedule_interval: IntOption = \
         IntOption('input_ready_schedule_interval',
                   "READY message schedule interval in milliseconds", required=True,
                   default=1000)
     # Output pipe
     self.output_pipe: StrOption = \
         StrOption('output_pipe', "Data Pipe Identification", required=True)
     self.output_pipe_address: ZMQAddressOption = \
         ZMQAddressOption('output_pipe_address', "Data Pipe endpoint address", required=True)
     self.output_pipe_mode: EnumOption = \
         EnumOption('output_pipe_mode', SocketMode, "Data Pipe Mode", required=True)
     self.output_pipe_format: MIMEOption = \
         MIMEOption('output_pipe_format', "Pipe data format specification")
     self.output_batch_size: IntOption = \
         IntOption('output_batch_size', "Data batch size", required=True, default=50)
     self.output_ready_schedule_interval: IntOption = \
         IntOption('output_ready_schedule_interval',
                   "READY message schedule interval in milliseconds", required=True,
                   default=1000)
Esempio n. 7
0
 def __init__(self, name: str):
     super().__init__(name)
     #: Max. number of characters transmitted in one message
     self.max_chars: IntOption = \
         IntOption('max_chars',
                   "Max. number of characters transmitted in one message",
                   required=True, default=65535)
     #: Filter by regular expression
     self.regex: StrOption = StrOption('regex', "Regular expression")
     #: Filter by Python expression
     self.expr: PyExprOption = PyExprOption('expr', "Python expression")
     #: Filter by Python function
     self.func: PyCallableOption = \
         PyCallableOption('func',
                          "Python function with signature: def fname(line: str) -> bool",
                          'def f(line: str) -> bool:\n  ...\n')
Esempio n. 8
0
 def __init__(self, name: str):
     super().__init__(name)
     # Adjust default batch_size to compensate default 64K messages in producers
     self.batch_size.default = 5
     #: File specification
     self.filename: StrOption = StrOption('filename',
                                          "File specification",
                                          required=True)
     #: File data format specification
     self.file_format: MIMEOption = \
         MIMEOption('file_format', "File data format specification", required=True,
                    default=MIME('text/plain;charset=utf-8'))
     #: File I/O mode
     self.file_mode: EnumOption = \
         (EnumOption('file_mode', FileOpenMode, "File I/O mode", required=False,
                     default=FileOpenMode.WRITE))
Esempio n. 9
0
 def __init__(self, name: str):
     super().__init__(name)
     # Adjust default batch_size to compensate default 64K messages
     self.batch_size.default = 5
     #: File specification
     self.filename: StrOption = StrOption('filename',
                                          "File specification",
                                          required=True)
     #: File data format specification
     self.file_format: MIMEOption = \
         MIMEOption('file_format', "File data format specification", required=True,
                    default=MIME('text/plain;charset=utf-8'))
     #: Max. number of characters transmitted in one message
     self.max_chars: IntOption = \
         IntOption('max_chars',
                   "Max. number of characters transmitted in one message",
                   required=True, default=65535)
Esempio n. 10
0
 def __init__(self, name: str):
     super().__init__(name)
     self.stop_on_close: BoolOption = \
         BoolOption('stop_on_close', "Stop service when pipe is closed", default=True)
     self.pipe: StrOption = \
         StrOption('pipe', "Data Pipe Identification", required=True)
     self.pipe_address: ZMQAddressOption = \
         ZMQAddressOption('pipe_address', "Data Pipe endpoint address", required=True)
     self.pipe_mode: EnumOption = \
         EnumOption('pipe_mode', SocketMode, "Data Pipe Mode", required=True)
     self.pipe_format: MIMEOption = \
         MIMEOption('pipe_format', "Pipe data format specification")
     self.batch_size: IntOption = \
         IntOption('batch_size', "Data batch size", required=True, default=50)
     self.ready_schedule_interval: IntOption = \
         IntOption('ready_schedule_interval',
                   "READY message schedule interval in milliseconds", required=True,
                   default=1000)
Esempio n. 11
0
 def __init__(self):
     super().__init__('saturnin')
     self.editor: StrOption = StrOption('editor',
                                        "External editor",
                                        default=os.getenv('EDITOR'))
Esempio n. 12
0
 def __init__(self, name: str):
     super().__init__(name)
     self.logging_id: StrOption = \
         StrOption('logging_id', "Logging ID for this component instance")