From 39e59acbf993f624c180e54b44a8100bf7ab1577 Mon Sep 17 00:00:00 2001 From: Daniel Ching Date: Fri, 12 Nov 2021 13:16:19 -0600 Subject: [PATCH 1/3] STY: Remove deadcode --- punx/github_handler.py | 1 - 1 file changed, 1 deletion(-) diff --git a/punx/github_handler.py b/punx/github_handler.py index 5f007568..7e54dc73 100644 --- a/punx/github_handler.py +++ b/punx/github_handler.py @@ -197,7 +197,6 @@ def _get_last_modified(self): """get the ``last_modified`` date from the SHA's commit""" if self.sha is not None: commit = self.repo.get_commit(self.sha) - mod_date_time = commit.last_modified # Tue, 20 Dec 2016 18:30:29 GMT fmt = "%a, %d %b %Y %H:%M:%S %Z" # --> 2016-11-19 01:04:28 mod_date_time = datetime.datetime.strptime(commit.last_modified, fmt) self.last_modified = str(mod_date_time) From 445fd67e05ee59364b7f618ed2006634102b07ea Mon Sep 17 00:00:00 2001 From: Daniel Ching Date: Fri, 12 Nov 2021 13:17:32 -0600 Subject: [PATCH 2/3] STY: Removed deadcode --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 76e15a4b..8153fc5d 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ # The full license is in the file LICENSE, distributed with this software. # ----------------------------------------------------------------------------- -from setuptools import setup, find_packages +from setuptools import setup import os import versioneer From 4d2db637d5b541c8e8bac6b01852a7cea8897cbe Mon Sep 17 00:00:00 2001 From: Daniel Ching Date: Fri, 12 Nov 2021 13:19:54 -0600 Subject: [PATCH 3/3] API: Remove dead `key` from item_name.verify --- punx/validate.py | 4 ++-- punx/validations/item_name.py | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/punx/validate.py b/punx/validate.py index ed1853cc..a5f85a49 100644 --- a/punx/validate.py +++ b/punx/validate.py @@ -298,10 +298,10 @@ def get_subject(parent, o): else: get_subject(parent, group[item]) - def validate_item_name(self, v_item, key=None): + def validate_item_name(self, v_item): from .validations import item_name - item_name.verify(self, v_item, key) + item_name.verify(self, v_item) def validate_attribute(self, v_item): from .validations import attribute diff --git a/punx/validations/item_name.py b/punx/validations/item_name.py index 7d55ffbd..ef4eac54 100644 --- a/punx/validations/item_name.py +++ b/punx/validations/item_name.py @@ -40,14 +40,13 @@ def isNeXusLinkTarget(v_item): return False # no @target attribute at all -def verify(validator, v_item, key=None): +def verify(validator, v_item): """ check :class:`ValidationItem` *v_item* using *validItemName* regular expression This is used for the names of groups, fields, links, and attributes. :param obj v_item: instance of :class:`ValidationItem` - :param str key: named key to search, default: None (``validItemName``) This method will test the object's name for validation, comparing with the strict or relaxed regular expressions for @@ -72,8 +71,6 @@ def verify(validator, v_item, key=None): if "name" in v_item.validations: return # do not repeat this - key = key or "validItemName" - if v_item.h5_address is not None and v_item.h5_address.endswith("@NX_class"): handle_NX_class(validator, v_item)