Skip to content

Commit

Permalink
SCTE35Base.has() checks if an instance has a var and if it's set.
Browse files Browse the repository at this point in the history
  • Loading branch information
futzu authored Nov 25, 2024
1 parent 26204eb commit 547a417
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion threefive/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,11 @@ def b2l(val):
def has(self, what):
"""
has runs hasattr with self and what
and checks if it's set.
"""
if hasattr(self, what):
return True
if vars(self)[what]:
return True
return False

def xml(self, ns="scte35"):
Expand Down

0 comments on commit 547a417

Please sign in to comment.