Commit 4e6f9596 authored by Jonathan Hanks's avatar Jonathan Hanks

Changing the python module name

Changing from completion to ligo_channels.
Also changed the function names from complete to completion.
parent ff20ba61
Pipeline #46297 passed with stage
in 11 minutes and 51 seconds
......@@ -16,8 +16,8 @@ file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
add_subdirectory(../third_party ${CMAKE_CURRENT_BINARY_DIR}/third_party)
add_subdirectory(../lib ${CMAKE_CURRENT_BINARY_DIR}/lib)
pybind11_add_module(completion MODULE python_completion.cc)
target_link_libraries(completion PRIVATE libcompletion)
pybind11_add_module(ligo_channels MODULE python_completion.cc)
target_link_libraries(ligo_channels PRIVATE libcompletion)
#--------------------------------------------------------------------
# Determine where packages should be installed
......@@ -30,7 +30,7 @@ execute_process(
OUTPUT_STRIP_TRAILING_WHITESPACE
)
install(TARGETS completion
install(TARGETS ligo_channels
DESTINATION ${pyexecdir})
MESSAGE("Ending config for ${PYTHON_EXECUTABLE}")
......@@ -6,14 +6,14 @@
namespace py = pybind11;
completion::string_list
complete( const std::string& db_path, const std::string& key )
py_completion( const std::string& db_path, const std::string& key )
{
auto db = completion::load_database( db_path );
return completion::search( db.channels.begin( ), db.channels.end( ), key );
}
completion::string_list
complete_iterator( py::iterator it, const std::string& key )
py_completion_iterator( py::iterator it, const std::string& key )
{
completion::Database db;
......@@ -39,16 +39,20 @@ complete_iterator( py::iterator it, const std::string& key )
return completion::search( db.channels.begin( ), db.channels.end( ), key );
}
PYBIND11_PLUGIN( completion )
PYBIND11_PLUGIN( ligo_channels )
{
py::module m( "completion", "LIGO channel name completion" );
m.def( "complete", &complete, "Given a filename return the next possible "
"completions for the given key" );
m.def( "complete_iterator", &complete_iterator, "Given an iterator of "
"channel names, return the "
"next possibly completions "
"for the given key" );
py::module m( "ligo_channels", "LIGO channel name completion" );
m.def( "completion",
&py_completion,
"Given a filename return the next possible "
"completions for the given key" );
m.def( "completion_iterator",
&py_completion_iterator,
"Given an iterator of "
"channel names, return the "
"next possibly completions "
"for the given key" );
return m.ptr( );
}
\ No newline at end of file
......@@ -61,7 +61,7 @@ class CMakeBuild(build_ext):
subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp)
setup(
name='completion',
name='ligo_channels',
version='0.3',
author='Jonathan Hanks',
author_email='jonathan.hanks@ligo.org',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment