Skip to content

Commit

Permalink
Replace Args with args for using config (#242)
Browse files Browse the repository at this point in the history
* Replace Args with args for using config

* Linting fixes

* Updating version

Co-authored-by: Pete Bryan <[email protected]>
Co-authored-by: Ian Hellen <[email protected]>
  • Loading branch information
3 people authored Dec 24, 2021
1 parent 8406e87 commit 8c0c602
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion msticpy/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""Version file."""
VERSION = "1.5.1"
VERSION = "1.5.2"
2 changes: 1 addition & 1 deletion msticpy/data/drivers/splunk_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ def _get_config_settings() -> Dict[Any, Any]:
"""Get config from msticpyconfig."""
data_provs = get_provider_settings(config_section="DataProviders")
splunk_settings: Optional[ProviderSettings] = data_provs.get("Splunk")
return getattr(splunk_settings, "Args", {})
return getattr(splunk_settings, "args", {})

@staticmethod
def _create_not_connected_err():
Expand Down
2 changes: 1 addition & 1 deletion msticpy/datamodel/entities/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ def make_pivot_shortcut(cls, func_name: str, target: str, overwrite: bool = Fals
func_path = func_name.split(".") if "." in func_name else [func_name]
curr_attr: Optional[Any] = cls
for path in func_path:
curr_attr = getattr(curr_attr, path, None)
curr_attr = getattr(curr_attr, path, None) # type: ignore
if not curr_attr:
raise AttributeError(f"No function found for {func_name}")
if not hasattr(curr_attr, "pivot_properties"):
Expand Down
10 changes: 5 additions & 5 deletions msticpy/nbtools/nbwidgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def __init__(
id_vals: Optional[List[Any]] = None,
val_attrs: Optional[List[str]] = None,
nb_params: Optional[Dict[str, str]] = None,
ns: Dict[str, Any] = globals(), # pylint: disable=invalid-name
name_space: Dict[str, Any] = globals(),
register: bool = True,
**kwargs,
):
Expand All @@ -102,7 +102,7 @@ def __init__(
attribute currently has no value (i.e. restoring a value from
the registry takes priority over this),
by default None
ns : Dict[str, Any], optional
name_space : Dict[str, Any], optional
Namespace to look for global variables, by default None
register : bool
Do not register the widget or retrieve values from previously-
Expand All @@ -125,13 +125,13 @@ def __init__(
_WIDGET_REG[self._id] = self

# if there are any notebook params relevant to this control
if nb_params and ns:
if nb_params and name_space:
for attr, nb_param in nb_params.items():
# if this doesn't have a value set explicitly or
# one that was recovered from the widget registry
# set it from the nb_param value
if nb_param in ns and not getattr(self, attr, None):
setattr(self, attr, ns[nb_param])
if nb_param in name_space and not getattr(self, attr, None):
setattr(self, attr, name_space[nb_param])


# pylint: enable=too-few-public-methods
Expand Down
2 changes: 1 addition & 1 deletion msticpy/nbtools/timeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,7 @@ def _get_ref_event_time(**kwargs) -> Tuple[Optional[Any], Union[Any, str]]:
else:
ref_time = kwargs.get("ref_time", None)
ref_label = "Ref time"
return ref_time, kwargs.get("ref_label", ref_label)
return ref_time, kwargs.get("ref_label", ref_label) # type: ignore


def _get_datetime_tooltip(col: str, dataset: pd.DataFrame):
Expand Down
2 changes: 1 addition & 1 deletion msticpy/sectools/tilookup.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def list_available_providers(
print(provider_name)
providers.append(provider_name)
if show_query_types and provider_class:
provider_class.usage()
provider_class.usage() # type: ignore
if as_list:
return providers
return None
Expand Down

0 comments on commit 8c0c602

Please sign in to comment.