Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ptg committed Oct 9, 2024
1 parent 5bbb12b commit 111ac2b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions ptgctl/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
from . import util
log = util.getLogger("ptgctl", level='info')

from .core import *
7 changes: 4 additions & 3 deletions ptgctl/util/cli.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import inspect
import functools
import warnings
from typing import Type, TypeVar



class CachedProperty:
def __init__(self, getattr):
super().__init__()
Expand Down Expand Up @@ -63,6 +63,7 @@ def greetings(self):
__file__ = None
__package__ = None
def __init__(self, parent, get_module, lazy=True):
self.__name__ = get_module.__name__
self._self = parent
self._get_module = get_module
self._loaded = False
Expand All @@ -76,7 +77,7 @@ def _load_module(self, reload=False):
try:
self._wrapped = wrapped = self._get_module(self._self)
except ImportError as e:
log.warning(f"{e}")
warnings.warn(f'Error Importing {self.__name__}: {e}')
self._wrapped = None
keys = (
getattr(wrapped, '__bind__', None) or
Expand All @@ -94,7 +95,7 @@ def _load_module(self, reload=False):
self._dir = list(self._public)
# mimic - idk
for k in self._COPY_OVER:
setattr(self, k, getattr(self._wrapped, k))
setattr(self, k, getattr(self._wrapped, k, getattr(self, k, None)))
self._loaded = self._wrapped is not None

def _is_public(self, func):
Expand Down

0 comments on commit 111ac2b

Please sign in to comment.