Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __getitem__(self, name):
item = gv.agget(self.handle, name.encode(self.encoding))
if item is None:
ah = gv.agattr(self.handle, self.type,
name.encode(self.encoding),
None)
item = gv.agattrdefval(ah)
return item.decode(self.encoding)
def __getitem__(self, name):
item=gv.agget(self.handle,name.encode(self.encoding))
if item is None:
ah=gv.agattr(self.handle,self.type,
name,
None)
item=gv.agattrdefval(ah)
return item.decode(self.encoding)
def __delitem__(self, name):
gv.agattr(self.handle,self.type,name,'')
def __init__(self, handle, atype):
self.handle = handle
self.type = atype
self.ghandle = gv.agraphof(handle)
# get the encoding
root_handle = gv.agroot(self.ghandle) # get root graph
try:
ah = gv.agattr(root_handle, 0, b'charset', None)
self.encoding = gv.agattrdefval(ah)
except KeyError:
self.encoding = _DEFAULT_ENCODING
def __init__(self,handle,atype):
self.handle=handle
self.type=atype
# get the encoding
ghandle=gv.agraphof(handle)
root_handle=gv.agroot(ghandle) # get root graph
try:
ah=gv.agattr(root_handle,0,'charset',None)
self.encoding=gv.agattrdefval(ah)
except KeyError:
self.encoding=_DEFAULT_ENCODING
def __delitem__(self, name):
gv.agattr(self.handle, self.type, name.encode(self.encoding), b'')