mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
convert some range(len()) calls for pylint
This commit is contained in:
parent
553ce808e5
commit
fe576a865d
3 changed files with 7 additions and 9 deletions
|
@ -143,12 +143,12 @@ class NoteImporter(Importer):
|
|||
dupeCount = 0
|
||||
dupes: List[str] = []
|
||||
for n in notes:
|
||||
for c in range(len(n.fields)):
|
||||
for c, field in enumerate(n.fields):
|
||||
if not self.allowHTML:
|
||||
n.fields[c] = html.escape(n.fields[c], quote=False)
|
||||
n.fields[c] = n.fields[c].strip()
|
||||
n.fields[c] = html.escape(field, quote=False)
|
||||
n.fields[c] = field.strip()
|
||||
if not self.allowHTML:
|
||||
n.fields[c] = n.fields[c].replace("\n", "<br>")
|
||||
n.fields[c] = field.replace("\n", "<br>")
|
||||
fld0 = unicodedata.normalize("NFC", n.fields[fld0idx])
|
||||
# first field must exist
|
||||
if not fld0:
|
||||
|
|
|
@ -197,8 +197,7 @@ limit %d"""
|
|||
% (self._deckLimit(), self.reportLimit),
|
||||
self.dayCutoff,
|
||||
)
|
||||
for i in range(len(self._lrnQueue)):
|
||||
self._lrnQueue[i] = (self._lrnQueue[i][0], self._lrnQueue[i][1])
|
||||
self._lrnQueue = [tuple(e) for e in self._lrnQueue]
|
||||
# as it arrives sorted by did first, we need to sort it
|
||||
self._lrnQueue.sort()
|
||||
return self._lrnQueue
|
||||
|
|
|
@ -8,7 +8,7 @@ from __future__ import annotations
|
|||
import random
|
||||
import time
|
||||
from heapq import *
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Union, cast
|
||||
|
||||
import anki # pylint: disable=unused-import
|
||||
from anki import hooks, scheduler_pb2
|
||||
|
@ -329,8 +329,7 @@ limit %d"""
|
|||
% (self._deckLimit(), self.reportLimit),
|
||||
cutoff,
|
||||
)
|
||||
for i in range(len(self._lrnQueue)):
|
||||
self._lrnQueue[i] = (self._lrnQueue[i][0], self._lrnQueue[i][1])
|
||||
self._lrnQueue = [cast(Tuple[int, CardId], tuple(e)) for e in self._lrnQueue]
|
||||
# as it arrives sorted by did first, we need to sort it
|
||||
self._lrnQueue.sort()
|
||||
return self._lrnQueue
|
||||
|
|
Loading…
Reference in a new issue