json attribute checker added

This commit is contained in:
Volkan Şahin 2016-07-01 16:57:12 +03:00
parent 719d2275de
commit 411460058a

View file

@ -248,3 +248,10 @@ class Util:
@staticmethod @staticmethod
def set_permission(path, permission_code): def set_permission(path, permission_code):
Util.execute('chmod {} {}'.format(permission_code, path)) Util.execute('chmod {} {}'.format(permission_code, path))
@staticmethod
def has_attr_json(arg, attr_name):
for j in json.loads(json.dumps(arg)):
if attr_name in j:
return True
return False