aboutsummaryrefslogtreecommitdiff
path: root/sgdfi/_dbs/_funcs.py
diff options
context:
space:
mode:
Diffstat (limited to 'sgdfi/_dbs/_funcs.py')
-rwxr-xr-xsgdfi/_dbs/_funcs.py23
1 files changed, 8 insertions, 15 deletions
diff --git a/sgdfi/_dbs/_funcs.py b/sgdfi/_dbs/_funcs.py
index 9440c38..f152a57 100755
--- a/sgdfi/_dbs/_funcs.py
+++ b/sgdfi/_dbs/_funcs.py
@@ -27,17 +27,17 @@ class FunctionRawData:
""" Raw data from a function for importation of the autocomplete file
from the intranet. """
- def __init__(self, iid, code, nm, nf, cname, srcorder):
+ def __init__(self, iid, code, nm, nf, cnames, srcorder):
self.__iid = iid
self.__code = code
self.__nm = nm
self.__nf = nf
- self.__cname = cname
+ self.__cnames = tuple(cnames)
self.__srcorder = srcorder
def __repr__(self):
p = []
- p.append(f"cname = {repr(self.__cname)}")
+ p.append(f"cnames = {repr(self.__cnames)}")
p.append(f"iid = {repr(self.__iid)}")
p.append(f"code = {repr(self.__code)}")
p.append(f"nm = {repr(self.__nm)}")
@@ -47,10 +47,10 @@ class FunctionRawData:
return f"{self.__class__.__name__}({', '.join(p)})"
@property
- def cname(self):
+ def cnames(self):
""" The canonical/constant name for the function. """
- return self.__cname
+ return self.__cnames
@property
def iid(self):
@@ -85,17 +85,10 @@ class FunctionRawData:
return self.__nf
- def replace(self, **kwargs):
- cname = self.__cname
-
- if 'cname' in kwargs:
- cname = kwargs['cname']
- del kwargs['cname']
- if kwargs:
- raise ValueError(f"Invalid keyword {repr(kwargs.keys()[0])}")
-
+ def add_cname_suffix(self, suffix):
+ cnames = [cn + suffix for cn in self.__cnames]
return FunctionRawData(self.__iid, self.__code, self.__nm, self.__nf,
- cname, self.__srcorder)
+ cnames, self.__srcorder)
@property
def srcorder(self):