Skip to content

Commit f952a14

Browse files
authored
fix(collector): fix fetch exception during awesome-neovim (#212)
chore(commons): upgrade 'commons' (#212)
1 parent d37e3d8 commit f952a14

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+531
-1471
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- uses: actions/checkout@v4
19-
- uses: ytanikin/[email protected]
20-
with:
21-
task_types: '["feat","fix","docs","test","ci","refactor","perf","chore","revert","break"]'
19+
- uses: amannn/action-semantic-pull-request@v5
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2222
lint:
2323
name: Lint
2424
runs-on: ubuntu-latest

COLORSCHEMES.md

Lines changed: 59 additions & 59 deletions
Large diffs are not rendered by default.

autoload/db.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

collect.py

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -446,18 +446,25 @@ class AwesomeNeovimColorScheme:
446446
def __init__(self) -> None:
447447
self.counter = 0
448448

449-
def _parse_spec(self, element: WebElement, source: str) -> ColorSpec:
450-
a = element.find_element(By.XPATH, "./a").text
451-
a_splits = a.split("(")
452-
handle = a_splits[0]
453-
github_stars = parse_number(a_splits[1])
454-
return ColorSpec(
455-
handle,
456-
github_stars,
457-
last_git_commit=None,
458-
priority=100,
459-
source=source,
460-
)
449+
def _parse_spec(
450+
self, element: WebElement, source: str
451+
) -> typing.Optional[ColorSpec]:
452+
try:
453+
a = element.find_element(By.XPATH, "./a").text
454+
a_splits = a.split("(")
455+
logging.debug(f"parse asn element.a:{a}, a_splits:{a_splits}")
456+
handle = a_splits[0]
457+
github_stars = parse_number(a_splits[1]) if len(a_splits) > 1 else 0
458+
return ColorSpec(
459+
handle,
460+
github_stars,
461+
last_git_commit=None,
462+
priority=100,
463+
source=source,
464+
)
465+
except Exception as e:
466+
logging.exception(f"failed to fetch asn element: {element}", e)
467+
return None
461468

462469
def _parse_colors_list(self, driver: Chrome, tag_id: str) -> list[ColorSpec]:
463470
repos = []
@@ -472,6 +479,11 @@ def _parse_colors_list(self, driver: Chrome, tag_id: str) -> list[ColorSpec]:
472479
)
473480
self.counter = self.counter + 1
474481
logging.debug(f"asn repo-{self.counter}:{spec}")
482+
if spec is None:
483+
logging.info(
484+
f"skip for parsing failure - (asn) spec-{self.counter}:{spec}"
485+
)
486+
continue
475487
if len(spec.handle.split("/")) != 2:
476488
logging.info(
477489
f"skip for invalid handle - (asn) spec-{self.counter}:{spec}"

collect.py.log

Lines changed: 338 additions & 335 deletions
Large diffs are not rendered by default.

lua/colorbox.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
local logging = require("colorbox.commons.logging")
22
local LogLevels = require("colorbox.commons.logging").LogLevels
3-
local strings = require("colorbox.commons.strings")
4-
local tables = require("colorbox.commons.tables")
3+
local str = require("colorbox.commons.str")
4+
local tbl = require("colorbox.commons.tbl")
55

66
local configs = require("colorbox.configs")
77
local timing = require("colorbox.timing")
@@ -69,7 +69,7 @@ local function setup(opts)
6969
complete = function(ArgLead, CmdLine, CursorPos)
7070
local complete_args = {}
7171
for k, v in pairs(controller) do
72-
if not strings.startswith(k, "_") and vim.is_callable(v) then
72+
if not str.startswith(k, "_") and vim.is_callable(v) then
7373
table.insert(complete_args, k)
7474
end
7575
end
@@ -80,7 +80,7 @@ local function setup(opts)
8080

8181
vim.api.nvim_create_autocmd("ColorSchemePre", {
8282
callback = function(event)
83-
loader.load(tables.tbl_get(event, "match"), false)
83+
loader.load(tbl.tbl_get(event, "match"), false)
8484
end,
8585
})
8686

0 commit comments

Comments
 (0)