Skip to content

Commit

Permalink
Merge "[doc] Capitalize TODOs"
Browse files Browse the repository at this point in the history
  • Loading branch information
xqt authored and Gerrit Code Review committed Nov 2, 2024
2 parents 192c430 + aaf0bce commit 35b39b7
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions pywikibot/page/_wikibase.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ def get(self, force: bool = False, *args, **kwargs) -> dict:
f'{args!r} and {kwargs!r}'
)

# todo: this variable is specific to ItemPage
# TODO: this variable is specific to ItemPage
lazy_loading_id = not hasattr(self, 'id') and hasattr(self, '_site')
try:
data = WikibaseEntity.get(self, force=force)
Expand All @@ -737,7 +737,7 @@ def get(self, force: bool = False, *args, **kwargs) -> dict:
p = pywikibot.Page(self._site, self._title)
if not p.exists():
raise NoPageError(p)
# todo: raise a nicer exception here (T87345)
# TODO: raise a nicer exception here (T87345)
raise NoPageError(self)

if 'pageid' in self._content:
Expand Down Expand Up @@ -1511,7 +1511,7 @@ def get(self, force: bool = False, *args, **kwargs) -> dict:

def newClaim(self, *args, **kwargs) -> Claim:
"""Helper function to create a new claim object for this property."""
# todo: raise when self.id is -1
# TODO: raise when self.id is -1
return Claim(self.site, self.getID(), *args, datatype=self.type,
**kwargs)

Expand Down Expand Up @@ -2097,7 +2097,7 @@ def _formatValue(self) -> dict:
:return: JSON value
"""
# todo: eventually unify the following two groups
# TODO: eventually unify the following two groups
if self.type in ('wikibase-item', 'wikibase-property'):
value = {'entity-type': self.getTarget().entity_type,
'numeric-id': self.getTarget().getID(numeric=True)}
Expand Down Expand Up @@ -2305,7 +2305,7 @@ def remove_form(self, form, **kwargs) -> None:
form.on_lexeme = None
form.id = '-1'

# todo: senses
# TODO: senses

def mergeInto(self, lexeme, **kwargs):
"""Merge the lexeme into another lexeme.
Expand Down
2 changes: 1 addition & 1 deletion scripts/coordinate_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def try_import_coordinates_from_page(self, page, item) -> bool:
pywikibot.info(
f'Adding {coordinate.lat}, {coordinate.lon} to {item.title()}')

# todo: handle exceptions using self.user_add_claim
# TODO: handle exceptions using self.user_add_claim
try:
item.addClaim(newclaim)
except CoordinateGlobeUnknownError as e:
Expand Down
4 changes: 2 additions & 2 deletions scripts/harvest_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,9 @@ def treat_field(self,
if not field or field not in self.fields:
return

# todo: extend the list of tags to ignore
# TODO: extend the list of tags to ignore
value = textlib.removeDisabledParts(
# todo: eventually we may want to import the references
# TODO: eventually we may want to import the references
value, tags=['ref'], site=site).strip()

if not value:
Expand Down
4 changes: 2 additions & 2 deletions scripts/interwiki.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ def __init__(self, origin=None, hints=None, conf=None) -> None:

super().__init__(origin)

# todo is a list of all pages that still need to be analyzed.
# TODO is a list of all pages that still need to be analyzed.
# Mark the origin page as todo.
self.todo = SizedKeyCollection('site')
if origin:
Expand Down Expand Up @@ -1274,7 +1274,7 @@ def batchLoaded(self, counter) -> None:
counter.minus(page.site)

# Now check whether any interwiki links should be added to the
# todo list.
# TODO list.
self.check_page(page, counter)

# These pages are no longer 'in progress'
Expand Down
2 changes: 1 addition & 1 deletion scripts/interwikidata.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def try_to_merge(self, item) -> pywikibot.ItemPage | bool | None:
"""Merge two items."""
wd_data = self.get_items()
if not wd_data:
# todo: add links to item
# TODO: add links to item
return None

if len(wd_data) > 1:
Expand Down
2 changes: 1 addition & 1 deletion scripts/parser_function_count.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
from pywikibot.bot import ExistingPageBot, SingleSiteBot


# Todo:
# TODO:
# * Using xml and xmlstart
# * Using categories
# * Error handling for uploading (anyway, that's the last action, it's only
Expand Down

0 comments on commit 35b39b7

Please sign in to comment.