Public Member Functions | Public Attributes | Private Attributes | List of all members
ros_introspection.package_xml.PackageXML Class Reference

Public Member Functions

def __init__ (self, fn)
 
def add_packages (self, build_depends, run_depends, test_depends=None, prefer_depend_tag=True)
 
def add_plugin_export (self, pkg_name, xml_path)
 
def build_type (self)
 
def format (self)
 
def get_child_indexes (self)
 
def get_elements_by_tags (self, tags)
 
def get_export_tag (self)
 
def get_insertion_index (self, tag, tag_value=None)
 
def get_license (self)
 
def get_license_element (self)
 
def get_packages (self, mode='build')
 
def get_packages_by_tag (self, tag)
 
def get_people (self)
 
def get_plugin_xmls (self)
 
def get_tab_element (self, tabs=1)
 
def insert_new_packages (self, tag, values)
 
def insert_new_tag (self, tag)
 
def insert_new_tag_inside_another (self, parent, tag, depth=2)
 
def insert_new_tags (self, tags)
 
def is_metapackage (self)
 
def name (self)
 
def remove_dependencies (self, name, pkgs, quiet=False)
 
def remove_element (self, element)
 
def set_license (self, license_str)
 
def std_tab (self)
 
def update_people (self, target_name, target_email=None, search_name=None, search_email=None)
 
def upgrade (self, new_format=2, quiet=True)
 
def write (self, new_fn=None)
 

Public Attributes

 changed
 
 fn
 
 format
 
 header
 
 root
 
 tree
 

Private Attributes

 _build_type
 
 _format
 
 _name
 
 _std_tab
 

Detailed Description

Definition at line 64 of file package_xml.py.

Constructor & Destructor Documentation

◆ __init__()

def ros_introspection.package_xml.PackageXML.__init__ (   self,
  fn 
)

Definition at line 65 of file package_xml.py.

Member Function Documentation

◆ add_packages()

def ros_introspection.package_xml.PackageXML.add_packages (   self,
  build_depends,
  run_depends,
  test_depends = None,
  prefer_depend_tag = True 
)

Definition at line 293 of file package_xml.py.

◆ add_plugin_export()

def ros_introspection.package_xml.PackageXML.add_plugin_export (   self,
  pkg_name,
  xml_path 
)
Add the plugin configuration if not found. Add export tag as needed. Return the surrounding export tag.

Definition at line 415 of file package_xml.py.

◆ build_type()

def ros_introspection.package_xml.PackageXML.build_type (   self)

Definition at line 99 of file package_xml.py.

◆ format()

def ros_introspection.package_xml.PackageXML.format (   self)

Definition at line 89 of file package_xml.py.

◆ get_child_indexes()

def ros_introspection.package_xml.PackageXML.get_child_indexes (   self)
Return a dictionary based on which children span which indexes.

The keys are the types of nodes in the xml (build_depend, maintainer, etc).
The values are arrays marking the range of elements in the xml root that match that tag.

For example, tags[build_depend] = [(5, 9), (11, 50)] means that elements [5, 9) and [11, 50) are
either build_depend elements (or the strings between them)

Definition at line 159 of file package_xml.py.

◆ get_elements_by_tags()

def ros_introspection.package_xml.PackageXML.get_elements_by_tags (   self,
  tags 
)

Definition at line 343 of file package_xml.py.

◆ get_export_tag()

def ros_introspection.package_xml.PackageXML.get_export_tag (   self)
Get the export tag. Create it if it doesn't exist.

Definition at line 405 of file package_xml.py.

◆ get_insertion_index()

def ros_introspection.package_xml.PackageXML.get_insertion_index (   self,
  tag,
  tag_value = None 
)
Return the index where to insert a new element with the given tag type.

If there are already elements of that type, then either insert after the last matching element,
or if the list is alphabetized, insert it in the correct place alphabetically using the tag_value.
Otherwise, look at the existing elements, and find ones that are supposed to come the closest
before the given tag, and insert after them. If none found, add at the end.

Definition at line 191 of file package_xml.py.

◆ get_license()

def ros_introspection.package_xml.PackageXML.get_license (   self)

Definition at line 374 of file package_xml.py.

◆ get_license_element()

def ros_introspection.package_xml.PackageXML.get_license_element (   self)

Definition at line 368 of file package_xml.py.

◆ get_packages()

def ros_introspection.package_xml.PackageXML.get_packages (   self,
  mode = 'build' 
)

Definition at line 139 of file package_xml.py.

◆ get_packages_by_tag()

def ros_introspection.package_xml.PackageXML.get_packages_by_tag (   self,
  tag 
)

Definition at line 133 of file package_xml.py.

◆ get_people()

def ros_introspection.package_xml.PackageXML.get_people (   self)

Definition at line 349 of file package_xml.py.

◆ get_plugin_xmls()

def ros_introspection.package_xml.PackageXML.get_plugin_xmls (   self)
Return a mapping from the package name to a list of the relative path(s) for the plugin xml(s).

Definition at line 392 of file package_xml.py.

◆ get_tab_element()

def ros_introspection.package_xml.PackageXML.get_tab_element (   self,
  tabs = 1 
)

Definition at line 156 of file package_xml.py.

◆ insert_new_packages()

def ros_introspection.package_xml.PackageXML.insert_new_packages (   self,
  tag,
  values 
)

Definition at line 286 of file package_xml.py.

◆ insert_new_tag()

def ros_introspection.package_xml.PackageXML.insert_new_tag (   self,
  tag 
)

Definition at line 248 of file package_xml.py.

◆ insert_new_tag_inside_another()

def ros_introspection.package_xml.PackageXML.insert_new_tag_inside_another (   self,
  parent,
  tag,
  depth = 2 
)

Definition at line 275 of file package_xml.py.

◆ insert_new_tags()

def ros_introspection.package_xml.PackageXML.insert_new_tags (   self,
  tags 
)

Definition at line 271 of file package_xml.py.

◆ is_metapackage()

def ros_introspection.package_xml.PackageXML.is_metapackage (   self)

Definition at line 384 of file package_xml.py.

◆ name()

def ros_introspection.package_xml.PackageXML.name (   self)

Definition at line 78 of file package_xml.py.

◆ remove_dependencies()

def ros_introspection.package_xml.PackageXML.remove_dependencies (   self,
  name,
  pkgs,
  quiet = False 
)

Definition at line 335 of file package_xml.py.

◆ remove_element()

def ros_introspection.package_xml.PackageXML.remove_element (   self,
  element 
)
Remove the given element AND the text element before it if it is just an indentation.

Definition at line 324 of file package_xml.py.

◆ set_license()

def ros_introspection.package_xml.PackageXML.set_license (   self,
  license_str 
)

Definition at line 378 of file package_xml.py.

◆ std_tab()

def ros_introspection.package_xml.PackageXML.std_tab (   self)

Definition at line 119 of file package_xml.py.

◆ update_people()

def ros_introspection.package_xml.PackageXML.update_people (   self,
  target_name,
  target_email = None,
  search_name = None,
  search_email = None 
)

Definition at line 357 of file package_xml.py.

◆ upgrade()

def ros_introspection.package_xml.PackageXML.upgrade (   self,
  new_format = 2,
  quiet = True 
)

Definition at line 432 of file package_xml.py.

◆ write()

def ros_introspection.package_xml.PackageXML.write (   self,
  new_fn = None 
)

Definition at line 458 of file package_xml.py.

Member Data Documentation

◆ _build_type

ros_introspection.package_xml.PackageXML._build_type
private

Definition at line 74 of file package_xml.py.

◆ _format

ros_introspection.package_xml.PackageXML._format
private

Definition at line 72 of file package_xml.py.

◆ _name

ros_introspection.package_xml.PackageXML._name
private

Definition at line 71 of file package_xml.py.

◆ _std_tab

ros_introspection.package_xml.PackageXML._std_tab
private

Definition at line 73 of file package_xml.py.

◆ changed

ros_introspection.package_xml.PackageXML.changed

Definition at line 75 of file package_xml.py.

◆ fn

ros_introspection.package_xml.PackageXML.fn

Definition at line 66 of file package_xml.py.

◆ format

ros_introspection.package_xml.PackageXML.format

Definition at line 143 of file package_xml.py.

◆ header

ros_introspection.package_xml.PackageXML.header

Definition at line 70 of file package_xml.py.

◆ root

ros_introspection.package_xml.PackageXML.root

Definition at line 68 of file package_xml.py.

◆ tree

ros_introspection.package_xml.PackageXML.tree

Definition at line 67 of file package_xml.py.


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


ros_introspection
Author(s):
autogenerated on Tue Jun 21 2022 03:01:38