Skip to content

Commit 396699b

Browse files
authored
Merge pull request #2651 from pyrevitlabs/fix/commitf81f483
fixes commit f81f483 + formatting
2 parents 5c41294 + 07bbd22 commit 396699b

File tree

1 file changed

+27
-31
lines changed

1 file changed

+27
-31
lines changed

pyrevitlib/pyrevit/forms/__init__.py

Lines changed: 27 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import string
1616
from collections import OrderedDict, namedtuple
1717
import threading
18-
from functools import wraps
1918
import datetime
2019
import webbrowser
2120

@@ -47,7 +46,7 @@
4746
from pyrevit import versionmgr
4847
from pyrevit.userconfig import user_config
4948

50-
import pyevent # pylint: disable=import-error
49+
import pyevent
5150

5251
import Autodesk.Windows.ComponentManager # pylint: disable=import-error
5352
import Autodesk.Internal.InfoCenter # pylint: disable=import-error
@@ -696,7 +695,7 @@ def show(
696695
title="User Input",
697696
width=DEFAULT_INPUTWINDOW_WIDTH,
698697
height=DEFAULT_INPUTWINDOW_HEIGHT,
699-
**kwargs
698+
**kwargs,
700699
):
701700
"""Show user input window.
702701
@@ -1182,29 +1181,26 @@ def clear_search(self, sender, args): # pylint: disable=W0613
11821181
self.search_tb.Focus()
11831182

11841183
@classmethod
1185-
def show(
1186-
cls,
1187-
context,
1188-
title='User Input',
1189-
width=DEFAULT_INPUTWINDOW_WIDTH,
1190-
height=DEFAULT_INPUTWINDOW_HEIGHT,
1191-
exitscript=False
1192-
**kwargs
1193-
):
1194-
"""Show user input window.
1195-
1196-
Args:
1197-
context (any): window context element(s)
1198-
width: ...
1199-
height: ...
1200-
exitscript: exit the script if the user cancels the dialog. Defaults to False
1201-
"""
1202-
dlg = cls(context, title, width, height, **kwargs)
1203-
dlg.ShowDialog()
1204-
1205-
if exitscript and not dlg.response:
1206-
sys.exit()
1207-
1184+
def show(
1185+
cls,
1186+
context,
1187+
title="User Input",
1188+
width=DEFAULT_INPUTWINDOW_WIDTH,
1189+
height=DEFAULT_INPUTWINDOW_HEIGHT,
1190+
exitscript=False,
1191+
**kwargs,
1192+
):
1193+
"""Show user input window.
1194+
Args:
1195+
context (any): window context element(s)
1196+
width: ...
1197+
height: ...
1198+
exitscript: exit the script if the user cancels the dialog. Defaults to False
1199+
"""
1200+
dlg = cls(context, title, width, height, **kwargs)
1201+
dlg.ShowDialog()
1202+
if exitscript and not dlg.response:
1203+
sys.exit()
12081204
return dlg.response
12091205

12101206

@@ -2011,7 +2007,7 @@ def show(
20112007
search_db, # pylint: disable=W0221
20122008
width=DEFAULT_SEARCHWND_WIDTH,
20132009
height=DEFAULT_SEARCHWND_HEIGHT,
2014-
**kwargs
2010+
**kwargs,
20152011
):
20162012
"""Show search prompt."""
20172013
dlg = cls(search_db, width, height, **kwargs)
@@ -2851,7 +2847,7 @@ def select_family_parameters(
28512847
if not include_labeled and family_param.Id in label_param_ids:
28522848
continue
28532849

2854-
associated_to_others = not (family_param.AssociatedParameters.IsEmpty)
2850+
associated_to_others = not family_param.AssociatedParameters.IsEmpty
28552851
if not include_associated and associated_to_others:
28562852
continue
28572853

@@ -3556,7 +3552,7 @@ def ask_for_unique_string(
35563552
prompt=prompt,
35573553
title=title,
35583554
reserved_values=reserved_values,
3559-
**kwargs
3555+
**kwargs,
35603556
)
35613557

35623558

@@ -3593,7 +3589,7 @@ def ask_for_one_item(items, default=None, prompt=None, title=None, **kwargs):
35933589
default=default,
35943590
prompt=prompt,
35953591
title=title,
3596-
**kwargs
3592+
**kwargs,
35973593
)
35983594

35993595

@@ -3667,7 +3663,7 @@ def ask_for_number_slider(
36673663
max=max,
36683664
min=min,
36693665
interval=interval,
3670-
**kwargs
3666+
**kwargs,
36713667
)
36723668

36733669

0 commit comments

Comments
 (0)