Asterisk - The Open Source Telephony Project  GIT-master-a24979a
Functions | Variables
make_ari_stubs Namespace Reference

Functions

def main (argv)
 
def rel (file)
 

Variables

list API_TRANSFORMS
 
 file
 
list RESOURCES_TRANSFORMS
 
 TOPDIR = os.path.dirname(os.path.abspath(__file__))
 
string WIKI_PREFIX = 'Asterisk 20'
 

Function Documentation

◆ main()

def make_ari_stubs.main (   argv)

Definition at line 69 of file make_ari_stubs.py.

69 def main(argv):
70  parser = OptionParser(usage="Usage %prog [resources.json] [destdir]")
71 
72  (options, args) = parser.parse_args(argv)
73 
74  if len(args) != 3:
75  parser.error("Wrong number of arguments")
76 
77  source = args[1]
78  dest_dir = args[2]
79  renderer = pystache.Renderer(search_dirs=[TOPDIR], missing_tags='strict')
80  processor = AsteriskProcessor(wiki_prefix=WIKI_PREFIX)
81 
82  # Build the models
83  base_dir = os.path.dirname(source)
84  resources = ResourceListing().load_file(source, processor)
85  for api in resources.apis:
86  api.load_api_declaration(base_dir, processor)
87 
88  # Render the templates
89  for api in resources.apis:
90  for transform in API_TRANSFORMS:
91  transform.render(renderer, api, dest_dir)
92  for transform in RESOURCES_TRANSFORMS:
93  transform.render(renderer, resources, dest_dir)
94 
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
def main(argv)
static int load_file(const char *filename, char **ret)
Read a TEXT file into a string and return the length.

References len(), and load_file().

◆ rel()

def make_ari_stubs.rel (   file)
Helper to get a file relative to the script's directory

@parm file: Relative file path.

Definition at line 38 of file make_ari_stubs.py.

38 def rel(file):
39  """Helper to get a file relative to the script's directory
40 
41  @parm file: Relative file path.
42  """
43  return os.path.join(TOPDIR, file)
44 

Variable Documentation

◆ API_TRANSFORMS

list API_TRANSFORMS

Definition at line 47 of file make_ari_stubs.py.

◆ file

file

Definition at line 25 of file make_ari_stubs.py.

Referenced by __adjust_lock(), __ao2_alloc(), __ao2_alloc_with_lockobj(), __ao2_callback(), __ao2_callback_data(), __ao2_cleanup_debug(), __ao2_container_alloc_hash(), __ao2_container_clone(), __ao2_find(), __ao2_get_weakproxy(), __ao2_global_obj_ref(), __ao2_global_obj_replace(), __ao2_global_obj_replace_unref(), __ao2_iterator_next(), __ao2_link(), __ao2_lock(), __ao2_ref(), __ao2_unlink(), __ao2_unlock(), __ao2_weakproxy_alloc(), __ao2_weakproxy_find(), __ao2_weakproxy_get_object(), __ao2_weakproxy_ref_object(), __ao2_weakproxy_set_object(), __ast_asprintf(), __ast_assert_failed(), __ast_bucket_scheme_register(), __ast_calloc(), __ast_calloc_cache(), __ast_calloc_with_stringfields(), __ast_cc_config_params_init(), __ast_channel_alloc(), __ast_channel_alloc_ap(), __ast_channel_internal_alloc(), __ast_datastore_alloc(), __ast_dummy_channel_alloc(), __ast_fd_set_flags(), __ast_format_cache_get(), __ast_format_cap_alloc(), __ast_format_cap_append(), __ast_frdup(), __ast_frisolate(), __ast_heap_rdlock(), __ast_heap_unlock(), __ast_heap_wrlock(), __ast_malloc(), __ast_manager_event_multichan(), __ast_module_ref(), __ast_module_running_ref(), __ast_module_shutdown_ref(), __ast_module_unref(), __ast_realloc(), __ast_sorcery_open(), __ast_str_helper(), __ast_strdup(), __ast_string_field_alloc_space(), __ast_string_field_init(), __ast_string_field_ptr_build(), __ast_string_field_ptr_build_va(), __ast_string_fields_copy(), __ast_strndup(), __ast_vasprintf(), __ast_verbose(), __ast_verbose_ap(), __ast_verbose_callid(), __container_unlink_node_debug(), __find_call(), __hash_open(), __manager_event_sessions(), __manager_event_sessions_va(), __sip_alloc(), __stasis_message_router_create(), __stasis_message_router_create_pool(), __stasis_subscribe(), __stasis_subscribe_pool(), __state_find_or_add(), _agent_lock(), _agent_unlock(), _ast_bridge_channel_lock(), _ast_bridge_channel_trylock(), _ast_bridge_channel_unlock(), _ast_bridge_lock(), _ast_bridge_trylock(), _ast_bridge_unlock(), _ast_hashtab_create(), _ast_hashtab_dup(), _ast_hashtab_insert_immediate(), _ast_hashtab_insert_immediate_bucket(), _ast_hashtab_insert_safe(), _ast_hashtab_resize(), _ast_hashtab_start_traversal(), _ast_hashtab_start_write_traversal(), _ast_heap_create(), _ast_heap_push(), _ast_odbc_request_obj(), _ast_sockaddr_from_sin(), _ast_sockaddr_port(), _ast_sockaddr_set_port(), _ast_sockaddr_to_sin(), _ast_var_assign(), _ast_variable_new(), _get_mohbyname(), _moh_class_malloc(), _moh_register(), aco_info_init(), action_playback(), action_playback_and_continue(), add_string_pool(), ael_yy_create_buffer(), ael_yy_init_buffer(), ast_bucket_file_alloc(), ast_bucket_file_clone(), ast_bucket_file_copy(), ast_bucket_file_create(), ast_bucket_file_delete(), ast_bucket_file_is_stale(), ast_bucket_file_json(), ast_bucket_file_metadata_callback(), ast_bucket_file_metadata_get(), ast_bucket_file_metadata_set(), ast_bucket_file_metadata_unset(), ast_bucket_file_temporary_create(), ast_bucket_file_temporary_destroy(), ast_bucket_file_update(), ast_control_streamfile(), ast_control_streamfile_lang(), ast_control_streamfile_w_cb(), ast_fax_log(), ast_frame_header_new(), ast_log(), ast_log_ap(), ast_log_callid(), ast_log_full(), ast_log_safe(), ast_pthread_create_detached_stack(), ast_pthread_create_stack(), ast_safe_execvp(), ast_str_thread_get(), ast_stream_and_wait(), AST_TEST_DEFINE(), ast_threadstorage_get(), ast_yy_create_buffer(), ast_yy_init_buffer(), bucket_file_alloc(), bucket_file_destroy(), bucket_file_wizard_create(), bucket_file_wizard_delete(), bucket_file_wizard_update(), config_curl(), config_ldap(), config_mysql(), config_odbc(), config_pgsql(), control_streamfile(), dbm_open(), delete_file(), find_recording(), format_log_message(), format_log_message_ap(), grow_heap(), handle_scan_file(), hash_ao2_alloc_empty_clone(), hash_ao2_insert_node(), init_hash(), internal_aco_type_find(), internal_ao2_alloc(), internal_ao2_traverse(), internal_file_types_destroy(), internal_stasis_subscribe(), is_preload(), limits_interval_playback(), log_bad_ao2(), log_caps(), make_fn(), manager_mixmonitor(), message_playback_callback_fn(), mkstemp_file(), phoneprov_callback(), play_and_wait(), pp_each_extension_helper(), process_category(), profile_destructor(), rb_ao2_alloc_empty_clone(), rb_ao2_new_node(), read_full(), set_fn(), smdi_toggle_mwi(), split_path(), stasis_app_stored_recording_find_by_name(), stasis_message_router_create_internal(), state_alloc(), vm_delete(), wait_file(), and wait_file2().

◆ RESOURCES_TRANSFORMS

list RESOURCES_TRANSFORMS

Definition at line 58 of file make_ari_stubs.py.

◆ TOPDIR

TOPDIR = os.path.dirname(os.path.abspath(__file__))

Definition at line 35 of file make_ari_stubs.py.

◆ WIKI_PREFIX

string WIKI_PREFIX = 'Asterisk 20'

Definition at line 45 of file make_ari_stubs.py.