json attribute checker added

This commit is contained in:
Volkan Şahin 2016-07-01 16:57:12 +03:00
parent 719d2275de
commit 411460058a
1 changed files with 7 additions and 0 deletions

View File

@ -248,3 +248,10 @@ class Util:
@staticmethod
def set_permission(path, permission_code):
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