Skip to content

Commit 96e6be2

Browse files
committed
docs: say debug flags log rather than print
- 11 docstrings in wtsite, wiki_tools, import_utility and wikitext - the flags now gate _logger.debug, directly or via a forwarded param - parallelize replays task stdout as log records, nothing hits stdout - core.ExportJsonLdParams.debug left as is, the flag is never read
1 parent 665e0e8 commit 96e6be2

4 files changed

Lines changed: 11 additions & 11 deletions

File tree

‎src/osw/data/import_utility.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ def get_entities_from_osw(
779779
osw_obj:
780780
OSW instance to use. If None, a new instance is created.
781781
debug:
782-
If True, prints debug information.
782+
If True, logs debug information.
783783
784784
Returns
785785
-------

‎src/osw/utils/wikitext.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def find_dependencies(wikitext, debug=False):
233233
----------
234234
wikitext : str
235235
debug : bool
236-
Whether to print debugging messages
236+
Whether to log debugging messages
237237
238238
Returns
239239
-------
@@ -318,7 +318,7 @@ def find_dependencies_recursively(title, site, dependencies=None, debug=False):
318318
dependencies
319319
List of already found dependent titles
320320
debug : bool
321-
Whether to print debugging messages
321+
Whether to log debugging messages
322322
323323
Returns
324324
-------

‎src/osw/wiki_tools.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ def search_redirection_sources(
592592
target_title :
593593
Title of the target wiki page
594594
debug:
595-
Whether to print debugging messages
595+
Whether to log debugging messages
596596
597597
Returns
598598
-------

‎src/osw/wtsite.py‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ class GetPageParam(OswBaseModel):
352352
retry_delay_s: Optional[int] = 5
353353
"""Retry delay in seconds"""
354354
debug: Optional[bool] = False
355-
"""Whether to print debug messages"""
355+
"""Whether to log debug messages"""
356356
raise_exception: Optional[bool] = False
357357
"""Whether to raise an exception if an error occurs"""
358358
raise_warning: Optional[bool] = True
@@ -667,7 +667,7 @@ class UploadPageParam(OswBaseModel):
667667
parallel: Optional[bool] = False
668668
"""If True, uploads the pages in parallel."""
669669
debug: Optional[bool] = False
670-
"""If True, debug messages will be printed."""
670+
"""If True, debug messages will be logged."""
671671
comment: Optional[str] = None
672672
"""Edit comment for the page history, applied to every uploaded page."""
673673

@@ -783,7 +783,7 @@ class DeletePageParam(OswBaseModel):
783783
page: Union["WtPage", List["WtPage"], str, List[str]]
784784
comment: Optional[str] = None
785785
debug: Optional[bool] = True
786-
"""If True, debug messages will be printed."""
786+
"""If True, debug messages will be logged."""
787787
parallel: Optional[bool] = None
788788
"""If true, processes the pages in parallel."""
789789

@@ -861,7 +861,7 @@ class CreatePagePackageParam(OswBaseModel):
861861
dump_config: Optional["WtPage.PageDumpConfig"] = None
862862
"""Configuration object for the page dump"""
863863
debug: Optional[bool] = True
864-
"""If True, debug messages will be printed."""
864+
"""If True, debug messages will be logged."""
865865
parallel: Optional[bool] = None
866866
"""If true, processes the pages in parallel."""
867867
offline_pages: Optional[Dict[str, "WtPage"]] = None
@@ -1021,7 +1021,7 @@ class ReadPagePackageParam(OswBaseModel):
10211021
selected_slots: Optional[List[str]] = None
10221022
"""A list of slots that should be read. If None, all slots are read."""
10231023
debug: Optional[bool] = False
1024-
"""If True, debug information is printed to the console."""
1024+
"""If True, debug information is logged."""
10251025
offline: Optional[bool] = True
10261026
"""Skip reading the page content from the webserver
10271027
before reading the local content, if True."""
@@ -1214,7 +1214,7 @@ class UploadPagePackageParam(OswBaseModel):
12141214
"""A list of WtPage objects.
12151215
If 'pages' is not given, 'storage_path' must be given."""
12161216
debug: Optional[bool] = False
1217-
"""If True, prints debug information."""
1217+
"""If True, logs debug information."""
12181218

12191219
class Config:
12201220
arbitrary_types_allowed = True
@@ -2167,7 +2167,7 @@ def get_file_info_and_usage(
21672167
Parameters
21682168
----------
21692169
debug
2170-
Whether to print debug information, by default False
2170+
Whether to log debug information, by default False
21712171
21722172
Returns
21732173
-------

0 commit comments

Comments
 (0)