@@ -314,16 +314,16 @@ cdef class _Creator:
314314 self.c_creator.configIndexing(indexing , language.encode('UTF-8'))
315315 return self
316316
317- def config_nbworkers(self , int nbWorkers : pyint ) -> Creator:
317+ def config_nbworkers(self , int nb_workers : pyint ) -> Creator:
318318 """Number of thread to use for internal worker"""
319319 if self._started:
320320 raise RuntimeError("Creator started")
321- self.c_creator.configNbWorkers(nbWorkers )
321+ self.c_creator.configNbWorkers(nb_workers )
322322 return self
323323
324- def set_mainpath(self , str mainPath : str ) -> Creator:
324+ def set_mainpath(self , str main_path : str ) -> Creator:
325325 """Set path of the main entry"""
326- self.c_creator.setMainPath(mainPath .encode('UTF-8'))
326+ self.c_creator.setMainPath(main_path .encode('UTF-8'))
327327 return self
328328
329329 def add_illustration(self , int size: pyint , content: bytes ):
@@ -381,7 +381,7 @@ cdef class _Creator:
381381 with nogil:
382382 self .c_creator.addMetadata(_name, _content, _mimetype)
383383
384- def add_redirection (self , str path: str , str title: str , str targetPath : str , dict hints: Dict[Hint , pyint]):
384+ def add_redirection (self , str path: str , str title: str , str target_path : str , dict hints: Dict[Hint , pyint]):
385385 """ Add redirection entry to Archive
386386
387387 https://wiki.openzim.org/wiki/ZIM_file_format#Redirect_Entry
@@ -396,25 +396,25 @@ cdef class _Creator:
396396
397397 cdef string _path = path.encode(' UTF-8' )
398398 cdef string _title = title.encode(' UTF-8' )
399- cdef string _targetPath = targetPath .encode(' UTF-8' )
399+ cdef string _targetPath = target_path .encode(' UTF-8' )
400400 cdef map [zim.HintKeys, uint64_t] _hints = convertToCppHints(hints)
401401 with nogil:
402402 self .c_creator.addRedirection(_path, _title, _targetPath, _hints)
403403
404- def add_alias (self , str path: str , str title: str , str targetPath : str , dict hints: Dict[Hint , pyint]):
405- """ Alias the (existing) entry `targetPath ` as a new entry `path`.
404+ def add_alias (self , str path: str , str title: str , str target_path : str , dict hints: Dict[Hint , pyint]):
405+ """ Alias the (existing) entry `target_path ` as a new entry `path`.
406406
407407 Raises
408408 ------
409409 RuntimeError
410- If `targetPath ` entry doesn't exist.
410+ If `target_path ` entry doesn't exist.
411411 """
412412 if not self ._started:
413413 raise RuntimeError (" Creator not started" )
414414
415415 cdef string _path = path.encode(' UTF-8' )
416416 cdef string _title = title.encode(' UTF-8' )
417- cdef string _targetPath = targetPath .encode(' UTF-8' )
417+ cdef string _targetPath = target_path .encode(' UTF-8' )
418418 cdef map [zim.HintKeys, uint64_t] _hints = convertToCppHints(hints)
419419 with nogil:
420420 self .c_creator.addAlias(_path, _title, _targetPath, _hints)
@@ -1110,11 +1110,11 @@ cdef class Search:
11101110 search.c_search = move(_search)
11111111 return search
11121112
1113- def getEstimatedMatches (self ) -> pyint:
1113+ def get_estimated_matches (self ) -> pyint:
11141114 """Estimated number of results in Archive for the search"""
11151115 return self.c_search.getEstimatedMatches()
11161116
1117- def getResults (self , start: pyint , count: pyint ) -> SearchResultSet:
1117+ def get_results (self , start: pyint , count: pyint ) -> SearchResultSet:
11181118 """Iterator over Entry paths found in Archive for the search"""
11191119 return SearchResultSet.from_resultset(move(self.c_search.getResults(start , count )))
11201120
@@ -1155,7 +1155,7 @@ archive = libzim.reader.Archive(fpath)
11551155searcher = Searcher(archive)
11561156query = Query().set_query("foo")
11571157search = searcher.search(query)
1158- for path in search.getResults (10, 10) # get result from 10 to 20 (10 results)
1158+ for path in search.get_results (10, 10) # get result from 10 to 20 (10 results)
11591159 print(path, archive.get_entry_by_path(path).title)"""
11601160search_public_objects = [
11611161 Query,
@@ -1212,11 +1212,11 @@ cdef class SuggestionSearch:
12121212 search.c_search = move(_search)
12131213 return search
12141214
1215- def getEstimatedMatches (self ) -> pyint:
1215+ def get_estimated_matches (self ) -> pyint:
12161216 """Estimated number of results in Archive for the suggestion search"""
12171217 return self.c_search.getEstimatedMatches()
12181218
1219- def getResults (self , start: pyint , count: pyint ) -> SuggestionResultSet:
1219+ def get_results (self , start: pyint , count: pyint ) -> SuggestionResultSet:
12201220 """Iterator over Entry paths found in Archive for the suggestion search"""
12211221 return SuggestionResultSet.from_resultset(move(self.c_search.getResults(start , count )))
12221222
@@ -1255,7 +1255,7 @@ Usage:
12551255archive = Archive(fpath)
12561256suggestion_searcher = SuggestionSearcher(archive)
12571257suggestions = suggestion_searcher.suggest("foo")
1258- for path in suggestion.getResults (10, 10) # get result from 10 to 20 (10 results)
1258+ for path in suggestion.get_results (10, 10) # get result from 10 to 20 (10 results)
12591259 print(path, archive.get_entry_by_path(path).title)"""
12601260suggestion_public_objects = [
12611261 SuggestionSearcher
@@ -1334,4 +1334,3 @@ class ModuleFinder(importlib.abc.MetaPathFinder):
13341334sys.meta_path.insert(0 , ModuleFinder())
13351335
13361336__all__ = [" writer" , " reader" , " search" , " suggestion" , " version" ]
1337-
0 commit comments