Skip to content

Commit

Permalink
🚨(ozi-new interactive): run lint
Browse files Browse the repository at this point in the history
Signed-off-by: rjdbcm <[email protected]>
  • Loading branch information
rjdbcm committed Jun 28, 2024
1 parent 1fed840 commit c334f68
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions ozi/new/interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
from __future__ import annotations

import curses
from itertools import chain
import os
import re
import sys
from functools import lru_cache
from itertools import chain
from typing import TYPE_CHECKING
from typing import Any
from typing import Sequence
Expand Down Expand Up @@ -779,7 +779,7 @@ def header_input( # noqa: C901
_default = ''
for n, i in enumerate(output):
if i.startswith(f'--{label.lower()}'):
_default = output.pop(n+1)
_default = output.pop(n + 1)
header = input_dialog(
title='ozi-new interactive prompt',
text='\n'.join(args),
Expand All @@ -800,7 +800,9 @@ def header_input( # noqa: C901
prefix.update({label: f'{label}: {header}'})
if split_on:
header = header.rstrip(split_on).split(split_on) # type: ignore
output += chain.from_iterable([[f'--{label.lower()}', i] for i in header])
output += chain.from_iterable(
[[f'--{label.lower()}', i] for i in header],
)
else:
output += [f'--{label.lower()}', header]
return True, output, prefix
Expand Down Expand Up @@ -932,9 +934,11 @@ def menu_loop(
):
classifier = classifier_checkboxlist(x)
output += chain.from_iterable(
[[f'--{x}', c] for c in classifier]
if classifier
else [],
(
[[f'--{x}', c] for c in classifier]
if classifier
else []
),
)
prefix.update(
(
Expand Down Expand Up @@ -999,7 +1003,7 @@ def menu_loop(
_default = None
for n, i in enumerate(output):
if i == '--copyright-head':
_default = output.pop(n+1)
_default = output.pop(n + 1)
output.remove('--copyright-head')
_default = (
_default
Expand All @@ -1021,7 +1025,7 @@ def menu_loop(
_default = None
for n, i in enumerate(output):
if i == '--allow-file':
_default = output.pop(n+1).split(',')
_default = output.pop(n + 1).split(',')
output.remove('--allow-file')
_default = (
_default
Expand All @@ -1043,7 +1047,7 @@ def menu_loop(
_default = None
for n, i in enumerate(output):
if i.startswith('--ci-provider'):
_default = output.pop(n+1)
_default = output.pop(n + 1)
output.remove('--ci-provider')
_default = _default if _default else 'github'
result = radiolist_dialog(
Expand Down

0 comments on commit c334f68

Please sign in to comment.