Module azcam.tools.console_tools

azcam.tools.console_tools contains the ConsoleTools base tool class.

Functions

def create_console_tools() ‑> None

Creates the console tools.

Classes

class ConsoleTools (name: str)

Common methods included in most console tools.

Args

name : str
name of this tool.

Subclasses

Instance variables

var verbosity

verbosity for debug, > 0 is more verbose

Methods

def delete_keyword(self, keyword: str) ‑> Optional[str]

Delete a keyword from a header.

Args

keyword
name of keyword
def get_keyword(self, keyword: str) ‑> str

Return a keyword value, its comment string, and type. Comment always returned in double quotes, even if empty.

Args

keyword
name of keyword

Returns

list of [keyword, comment, type]

def get_keywords(self) ‑> list

Return a list of all keyword names.

Returns

list of all keywords

def get_string(self) ‑> str

Returns the entire header as a formatted string.

Returns

single formatted string of keywords, values, and comments.

def initialize(self) ‑> None

Initialize this tool.

def read_header(self)

Returns the current header.

Returns

list of header lines
[Header[]]: Each element Header[i] contains the sublist (keyword, value, comment, and type).
def reset(self) ‑> None

Reset this tool.

def set_keyword(self, keyword: str, value: str, comment: str = 'none', typestring: str = 'none') ‑> Optional[str]

Set a keyword value, comment, and type.

Args

keyword
keyword
value
value of keyword
comment
comment string
typestring
one of 'str', 'int', 'float, 'none'
def update_header(self)

Update the header of a tool. This command usually reads hardware to get the lastest keyword values.

class ServerConnection

Server connection tool for consoles. Usually implemented as the "server" tool.

Methods

def command(self, command)

Send a command to a server process using the 'server' object in the database. This command traps all errors and returns exceptions and as error string.

Returns None or a string.

def connect(self, host='localhost', port=2402)

Connect to azcamserver.