Package default_cfg_fkie :: Module screen_handler :: Class ScreenHandler
[frames] | no frames]

Class ScreenHandler

source code

object --+
         |
        ScreenHandler

The class to handle the running screen sessions and create new sessions on start of the ROS nodes.

Instance Methods

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods
str
createSessionName(cls, node=None)
Creates a name for the screen session.
source code
str, str
splitSessionName(cls, session)
Splits the screen session name into PID and session name generated by createSessionName().
source code
 
testScreen(cls)
Tests for whether the SCREEN binary exists and raise an exception if not.
source code
str
getScreenLogFile(cls, session=None, node=None)
Generates a log file name of the ROS log.
source code
str
getROSLogFile(cls, node)
Generates a log file name for the ROS log
source code
str
getScreenCfgFile(cls, session=None, node=None)
Generates a configuration file name for the screen session.
source code
str
getScreenPidFile(cls, session=None, node=None)
Generates a PID file name for the screen session.
source code
str
getSceenCmd(cls, node)
Generates a configuration file and return the command prefix to start the given node in a screen terminal.
source code
Class Variables
  LOG_PATH = '/home/buildfarm/.ros/log/'
  SCREEN = '/usr/bin/screen'
  SLASH_SEP = '_'
Properties

Inherited from object: __class__

Method Details

createSessionName(cls, node=None)
Class Method

source code 

Creates a name for the screen session. All slash separators are replaced by SLASH_SEP

Parameters:
  • node (str) - the name of the node
Returns: str
name for the screen session.

splitSessionName(cls, session)
Class Method

source code 

Splits the screen session name into PID and session name generated by createSessionName().

Parameters:
  • session (str) - the screen session name
Returns: str, str
PID, session name generated by createSessionName(). Not presented values are coded as empty strings. Not valid session names have an empty PID string.

testScreen(cls)
Class Method

source code 

Tests for whether the SCREEN binary exists and raise an exception if not.

Raises:

getScreenLogFile(cls, session=None, node=None)
Class Method

source code 

Generates a log file name of the ROS log.

Parameters:
  • node (str) - the name of the node
Returns: str
the ROS log file name

To Do: get the run_id from the ROS parameter server and search in this log folder for the log file (handle the node started using a launch file).

getROSLogFile(cls, node)
Class Method

source code 

Generates a log file name for the ROS log

Parameters:
  • node (str) - the name of the node
Returns: str
the log file name

getScreenCfgFile(cls, session=None, node=None)
Class Method

source code 

Generates a configuration file name for the screen session.

Parameters:
  • session (str) - the name of the screen session
Returns: str
the configuration file name

getScreenPidFile(cls, session=None, node=None)
Class Method

source code 

Generates a PID file name for the screen session.

Parameters:
  • session (str) - the name of the screen session
Returns: str
the PID file name

getSceenCmd(cls, node)
Class Method

source code 

Generates a configuration file and return the command prefix to start the given node in a screen terminal.

Parameters:
  • node (str) - the name of the node
Returns: str
the command prefix