ADCT Python
Python client API implementation for publishing ADCT data
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Protected Attributes | List of all members
adctk.none_publisher.NonePublisher Class Reference

The no-op publisher. More...

Inheritance diagram for adctk.none_publisher.NonePublisher:
Inheritance graph
[legend]
Collaboration diagram for adctk.none_publisher.NonePublisher:
Collaboration graph
[legend]

Public Member Functions

 __init__ (self)
 
int config (self, **kwargs)
 Configure the plugin with the options given.
 
int initialize (self)
 Set up any resources needed for reuse in publish().
 
int publish (self, builder.Builder b)
 Publish json extracted from builder.
 
None finalize (self)
 Clean up any resources set up in initialize (files, pipes, etc).
 
- Public Member Functions inherited from adctk.publisher.Publisher
str name (self)
 Get the name which a factory or error message should use.
 
str version (self)
 
dict[str, str] get_option_defaults (self)
 
None pause (self)
 Cause publish calls to be ignored until resume is called.
 
None resume (self)
 Cancel an prior calls to pause.
 
int publish_str (self, str json_string)
 
int publish_obj (self, obj)
 

Public Attributes

 defaults
 
 plugin_prefix
 
 paused
 
- Public Attributes inherited from adctk.publisher.Publisher
 defaults
 
 plugin_prefix
 
 paused
 
 state
 
 mode
 

Static Protected Attributes

str _name = "none"
 
str _version = "1.0.0"
 
- Static Protected Attributes inherited from adctk.publisher.Publisher
str _name = "unknown"
 
str _version = "0.0.0"
 

Additional Inherited Members

- Static Public Member Functions inherited from adctk.publisher.Publisher
tuple[float] get_timeout_defaults ()
 Get the adc server connect and response timeouts defined in the environment ADC_SERVER_CONNECT_TIMEOUT and ADC_SERVER_POST_TIMEOUT as a tuple or default values if not defined.
 
str get_url_default ()
 Get the alleged adc server url base from environment ADC_SERVER_URL or the default if it is not present.
 
str get_port_default ()
 Get the adc server port number to use if it is properly defined in the environment ADC_SERVER_PORT or the default if it is not.
 
- Static Public Attributes inherited from adctk.publisher.Publisher
 API_VERSION = adc_version.AdcVersion()._dict()
 
- Protected Member Functions inherited from adctk.publisher.Publisher
str _get (self, dict[str, str] opts, str field)
 
bool _get_bool (self, dict[str, str] opts, str field)
 

Detailed Description

The no-op publisher.

Silently ignores all calls. No environment variables.

Constructor & Destructor Documentation

◆ __init__()

adctk.none_publisher.NonePublisher.__init__ (   self)

Reimplemented from adctk.publisher.Publisher.

17 def __init__(self):
18 super().__init__()
19 self.defaults = None
20 self.plugin_prefix = "ADC_NONE_PLUGIN_"
21 self.paused = False
22

Member Function Documentation

◆ config()

int adctk.none_publisher.NonePublisher.config (   self,
**  kwargs 
)

Configure the plugin with the options given.

For plugin QQQ, Environment variables ADC_QQQ_PLUGIN_<key> will override the plugin default for any key not defined in kwargs. Here QQQ is plugin.name().upper(). Generic options:

Parameters
kwargsIf env_prefix is included in kwargs, replaces plugin environment variables with those which are prefixed using env_prefix.
env_prefixTypically, env_prefix is set to "PPP_ADC_QQQ_PLUGIN_" if application PPP wants to override the defaults of adctk plugin QQQ. Here QQQ is plugin.name().upper(). If no prefixed version of the variable is present, the plugin default is used. kwargs takes precedence over environment variables. Plugin defaults are used if not overridden by kwargs or an environment variable.
Returns
int non-zero if configuration cannot be completed using the arguments, environment, and default.

Reimplemented from adctk.publisher.Publisher.

23 def config(self, **kwargs) -> int:
24 return 0
25

◆ finalize()

None adctk.none_publisher.NonePublisher.finalize (   self)

Clean up any resources set up in initialize (files, pipes, etc).

Reimplemented from adctk.publisher.Publisher.

32 def finalize(self) -> None:
33 return None

◆ initialize()

int adctk.none_publisher.NonePublisher.initialize (   self)

Set up any resources needed for reuse in publish().

Reimplemented from adctk.publisher.Publisher.

26 def initialize(self) -> int:
27 return 0
28

◆ publish()

int adctk.none_publisher.NonePublisher.publish (   self,
builder.Builder  b 
)

Publish json extracted from builder.

Reimplemented from adctk.publisher.Publisher.

29 def publish(self, b: builder.Builder) -> int:
30 return 0
31

Member Data Documentation

◆ _name

str adctk.none_publisher.NonePublisher._name = "none"
staticprotected

◆ _version

str adctk.none_publisher.NonePublisher._version = "1.0.0"
staticprotected

◆ defaults

adctk.none_publisher.NonePublisher.defaults

◆ paused

adctk.none_publisher.NonePublisher.paused

◆ plugin_prefix

adctk.none_publisher.NonePublisher.plugin_prefix

The documentation for this class was generated from the following file: