Skip to content

Commit

Permalink
Code style. Use True instead 1.
Browse files Browse the repository at this point in the history
  • Loading branch information
thet committed Oct 13, 2021
1 parent a567368 commit ab231e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/icalendar/cal.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def is_broken(self):
#############################
# handling of property values

def _encode(self, name, value, parameters=None, encode=1):
def _encode(self, name, value, parameters=None, encode=True):
"""Encode values to icalendar property values.
:param name: Name of the property.
Expand Down Expand Up @@ -161,7 +161,7 @@ def _encode(self, name, value, parameters=None, encode=1):
obj.params = parameters
return obj

def add(self, name, value, parameters=None, encode=1):
def add(self, name, value, parameters=None, encode=True):
"""Add a property.
:param name: Name of the property.
Expand Down Expand Up @@ -254,20 +254,20 @@ def decoded(self, name, default=_marker):
# Inline values. A few properties have multiple values inlined in in one
# property line. These methods are used for splitting and joining these.

def get_inline(self, name, decode=1):
def get_inline(self, name, decode=True):
"""Returns a list of values (split on comma).
"""
vals = [v.strip('" ') for v in q_split(self[name])]
if decode:
return [self._decode(name, val) for val in vals]
return vals

def set_inline(self, name, values, encode=1):
def set_inline(self, name, values, encode=True):
"""Converts a list of values into comma seperated string and sets value
to that.
"""
if encode:
values = [self._encode(name, value, encode=1) for value in values]
values = [self._encode(name, value, encode=True) for value in values]
self[name] = types_factory['inline'](q_join(values))

#########################
Expand Down
2 changes: 1 addition & 1 deletion src/icalendar/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def params(self):
# TODO?
# Later, when I get more time... need to finish this off now. The last major
# thing missing.
# def _encode(self, name, value, cond=1):
# def _encode(self, name, value, cond=True):
# # internal, for conditional convertion of values.
# if cond:
# klass = types_factory.for_property(name)
Expand Down

0 comments on commit ab231e1

Please sign in to comment.