From ab231e16046302ceccd133ea6fac2999d0b679f0 Mon Sep 17 00:00:00 2001 From: Johannes Raggam Date: Tue, 12 Oct 2021 22:23:02 +0200 Subject: [PATCH] Code style. Use True instead 1. --- src/icalendar/cal.py | 10 +++++----- src/icalendar/parser.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/icalendar/cal.py b/src/icalendar/cal.py index bc4823b0..70e380a3 100644 --- a/src/icalendar/cal.py +++ b/src/icalendar/cal.py @@ -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. @@ -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. @@ -254,7 +254,7 @@ 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])] @@ -262,12 +262,12 @@ def get_inline(self, name, decode=1): 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)) ######################### diff --git a/src/icalendar/parser.py b/src/icalendar/parser.py index 5344de89..59993065 100644 --- a/src/icalendar/parser.py +++ b/src/icalendar/parser.py @@ -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)