def get_tvpl_formatted_doc(self): text = common.select_lang(self.get_doc_text()) constants = {'en': 'symbols', 'de': 'Symbole'} text = self.get_device().replace_tvpl_function_links(text) def format_parameter(name): return '``{0}``'.format(name) # FIXME text = common.handle_rst_param(text, format_parameter) text = common.handle_rst_word(text) text = common.handle_rst_substitutions(text, self) def format_element_name(element, index): if index == None: return element.get_name().space return '{0} [{1}]'.format(element.get_name().space, index) text += common.format_constants('', self, format_element_name, constants_name=constants) text += common.format_since_firmware(self.get_device(), self) return common.shift_right(text, 1)
def get_java_formatted_doc(self, shift_right): text = common.select_lang(self.get_doc_text()) text = self.get_device().specialize_java_doc_function_links(text) text = text.replace('Callback ', 'Listener ') text = text.replace(' Callback', ' Listener') text = text.replace('callback ', 'listener ') text = text.replace(' callback', ' listener') def format_parameter(name): return '``{0}``'.format(name) # FIXME text = common.handle_rst_param(text, format_parameter) text = common.handle_rst_word(text) text = common.handle_rst_substitutions(text, self) prefix = self.get_device().get_java_class_name() + '.' def format_element_name(element, index): if index == None: return element.get_name().headless return '{0}[{1}]'.format(element.get_name().headless, index) text += common.format_constants(prefix, self, format_element_name) text += common.format_since_firmware(self.get_device(), self) return common.shift_right(text, shift_right)
def get_mathematica_formatted_doc(self): text = common.select_lang(self.get_doc_text()) text = self.get_device().specialize_mathematica_doc_function_links( text) def format_parameter(name): return '``{0}``'.format(name) # FIXME text = common.handle_rst_param(text, format_parameter) text = common.handle_rst_word(text) text = common.handle_rst_substitutions(text, self) prefix = self.get_device().get_mathematica_class_name() + '`' def format_element_name(element, index): if index == None: return element.get_name().headless return '{0}[[{1}]]'.format(element.get_name().headless, index) def format_constant(prefix, constant_group, constant, value): return '* {0}\\ **{1}**\\ U{2} = {3}\n'.format( prefix, constant_group.get_name().upper.replace('_', 'U'), constant.get_name().upper.replace('_', 'U'), value) text += common.format_constants(prefix, self, format_element_name, constant_format_func=format_constant) text += common.format_since_firmware(self.get_device(), self) return common.shift_right(text, 1)
def get_rust_formatted_doc(self): text = common.select_lang(self.get_doc_text()) text = self.get_device().specialize_rust_doc_function_links(text) callback_parameter = {'en': 'received variable', 'de': 'empfangene Variable'} callback_parameters = {'en': 'members of the received struct', 'de': 'Felder der empfangenen Struktur'} def format_parameter(name): return '``{0}``'.format(name) # FIXME text = common.handle_rst_param(text, format_parameter) if self.get_type() == 'callback': text = common.handle_rst_word(text, parameter=callback_parameter, parameters=callback_parameters) else: text = common.handle_rst_word(text) text = common.handle_rst_substitutions(text, self) prefix = self.get_device().get_rust_module_name().upper() + '_' def format_element_name(element, index): if index == None: return element.get_name().under return '{0}[{1}]'.format(element.get_name().under, index) text += common.format_constants(prefix, self, format_element_name) text += common.format_since_firmware(self.get_device(), self) return common.shift_right(text, 1)
def get_tcpip_formatted_doc(self): text = common.select_lang(self.get_doc_text()) constants = {'en': 'meanings', 'de': 'Bedeutungen'} constants_intro = { 'en': """ The following **{0}** are defined for the elements of this function: """, 'de': """ Die folgenden **{0}** sind für die Elemente dieser Funktion definiert: """ } parameter = {'en': 'response value', 'de': 'Rückgabewert'} parameters = {'en': 'response values', 'de': 'Rückgabewerte'} text = self.get_device().specialize_tcpip_doc_function_links(text) def format_parameter(name): return '``{0}``'.format(name) # FIXME text = common.handle_rst_param(text, format_parameter) text = common.handle_rst_word(text, parameter, parameters) text = common.handle_rst_substitutions(text, self) def format_element_name(element, index): if index == None: return element.get_name().under return '{0}[{1}]'.format(element.get_name().under, index) def format_constant(prefix, constant_group, constant, value): text = '' for word in constant.get_name().space.split(' '): if len(text) > 0: if word[0] in '0123456789' and text[-1] in '0123456789': text += common.select_lang({'en': '.', 'de': ','}) else: text += ' ' text += word return '* {0} = {1}\n'.format(value, text) text += common.format_constants('', self, format_element_name, constants_intro=constants_intro, constants_name=constants, constant_format_func=format_constant) text += common.format_since_firmware(self.get_device(), self) return common.shift_right(text, 1)
def get_mqtt_formatted_doc(self): text = common.select_lang(self.get_doc_text()) text = self.get_device().specialize_mqtt_doc_function_links(text) constants = {'en': 'symbols', 'de': 'Symbole'} callback_parameter = { 'en': 'callback payload', 'de': 'Payload des Callbacks' } callback_parameters = { 'en': 'callback payload members', 'de': 'Payload-Member des Callbacks' } def format_parameter(name): return '``{0}``'.format(name) # FIXME text = common.handle_rst_param(text, format_parameter) if self.get_type() == 'callback': text = common.handle_rst_word(text, parameter=callback_parameter, parameters=callback_parameters, constants=constants) else: text = common.handle_rst_word(text, constants=constants) text = common.handle_rst_substitutions(text, self) def format_element_name(element, index): if index == None: return element.get_name().under return '{0}[{1}]'.format(element.get_name().under, index) def format_constant(prefix, constant_group, constant, value): return '* "{0}" = {1}\n'.format(constant.get_name().under, value) text += common.format_constants('', self, format_element_name, constants_name=constants, constant_format_func=format_constant) text += common.format_since_firmware(self.get_device(), self) text = text.replace('|device_identifier_constant|\n', '') return common.shift_right(text, 1)
def get_go_formatted_doc(self): text = common.select_lang(self.get_doc_text()) text = self.get_device().specialize_go_doc_function_links(text) callback_parameter = { 'en': 'callback parameter', 'de': 'Parameter des Callbacks' } callback_parameters = { 'en': 'callback parameters', 'de': 'Parameter des Callbacks' } def format_parameter(name): return '``{0}``'.format(name) # FIXME text = common.handle_rst_param(text, format_parameter) if self.get_type() == 'callback': text = common.handle_rst_word(text, parameter=callback_parameter, parameters=callback_parameters) else: text = common.handle_rst_word(text) text = common.handle_rst_substitutions(text, self) prefix = self.get_device().get_go_package() + '.' def format_element_name(element, index): if index == None: return element.get_name().headless return '{0}[{1}]'.format(element.get_name().headless, index) def format_constant(prefix, constant_group, constant, value): return '* {0}\\ **{1}**\\ {2} = {3}\n'.format( prefix, constant_group.get_name().camel, constant.get_name().camel_constant_safe, value) text += common.format_constants(prefix, self, format_element_name, constant_format_func=format_constant) text += common.format_since_firmware(self.get_device(), self) return common.shift_right(text, 1)
def get_shell_formatted_doc(self): text = common.select_lang(self.get_doc_text()) text = self.get_device().specialize_shell_doc_function_links(text) constants = {'en': 'symbols', 'de': 'Symbole'} def format_parameter(name): return '``{0}``'.format(name) # FIXME text = common.handle_rst_param(text, format_parameter) text = common.handle_rst_word(text) text = common.handle_rst_substitutions(text, self) def format_element_name(element, index): if element.get_direction() == 'in': template = '<{0}>' else: template = '{0}' if index == None: return template.format(element.get_name().dash) return template.format( element.get_name().dash) + '[{0}]'.format(index) def format_constant(prefix, constant_group, constant, value): return '* **{0}**-{1} = {2}\n'.format( constant_group.get_name().dash, constant.get_name().dash, value) text += common.format_constants('', self, format_element_name, constants_name=constants, constant_format_func=format_constant) text += common.format_since_firmware(self.get_device(), self) return common.shift_right(text, 1)
def get_php_formatted_doc(self): text = common.select_lang(self.get_doc_text()) text = self.get_device().specialize_php_doc_function_links(text) def format_parameter(name): return '``${0}``'.format(name) text = common.handle_rst_param(text, format_parameter) text = common.handle_rst_word(text) text = common.handle_rst_substitutions(text, self) prefix = self.get_device().get_php_class_name() + '::' def format_element_name(element, index): if index == None: return '$' + element.get_name().under return '${0}[{1}]'.format(element.get_name().under, index) text += common.format_constants(prefix, self, format_element_name) text += common.format_since_firmware(self.get_device(), self) return common.shift_right(text, 1)
def get_c_formatted_doc(self): text = common.select_lang(self.get_doc_text()) text = self.get_device().specialize_c_doc_function_links(text) def format_parameter(name): return '``{0}``'.format(name) # FIXME text = common.handle_rst_param(text, format_parameter) text = common.handle_rst_word(text) text = common.handle_rst_substitutions(text, self) prefix = 'TF_' + self.get_device().get_name().upper + '_' def format_element_name(element, index): if index == None: return element.get_c_name() return '{0}[{1}]'.format(element.get_c_name(), index) text += common.format_constants(prefix, self, format_element_name) text += common.format_since_firmware(self.get_device(), self) return common.shift_right(text, 1)
def get_vbnet_formatted_doc(self): text = common.select_lang(self.get_doc_text()) text = self.get_device().specialize_vbnet_doc_function_links(text) # FIXME: add something similar for :char:`c` def format_parameter(name): return '``{0}``'.format(name) # FIXME text = common.handle_rst_param(text, format_parameter) text = common.handle_rst_word(text) text = common.handle_rst_substitutions(text, self) prefix = self.get_device().get_vbnet_class_name() + '.' def format_element_name(element, index): if index == None: return element.get_name().headless return '{0}({1})'.format(element.get_name().headless, index) text += common.format_constants(prefix, self, format_element_name) text += common.format_since_firmware(self.get_device(), self) return common.shift_right(text, 1)