icalcli 1.1.4__tar.gz → 1.1.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. {icalcli-1.1.4 → icalcli-1.1.6}/PKG-INFO +1 -1
  2. {icalcli-1.1.4 → icalcli-1.1.6}/icalcli/__init__.py +1 -1
  3. {icalcli-1.1.4 → icalcli-1.1.6}/icalcli/etesync_backend/etebase_interface.py +14 -2
  4. {icalcli-1.1.4 → icalcli-1.1.6}/icalcli/etesync_backend/etesync_interface.py +14 -4
  5. {icalcli-1.1.4 → icalcli-1.1.6}/icalcli.egg-info/PKG-INFO +1 -1
  6. {icalcli-1.1.4 → icalcli-1.1.6}/pyproject.toml +1 -1
  7. {icalcli-1.1.4 → icalcli-1.1.6}/LICENSE +0 -0
  8. {icalcli-1.1.4 → icalcli-1.1.6}/README.md +0 -0
  9. {icalcli-1.1.4 → icalcli-1.1.6}/icalcli/argparsers.py +0 -0
  10. {icalcli-1.1.4 → icalcli-1.1.6}/icalcli/etesync_backend/__init__.py +0 -0
  11. {icalcli-1.1.4 → icalcli-1.1.6}/icalcli/etesync_backend/etebase_crud.py +0 -0
  12. {icalcli-1.1.4 → icalcli-1.1.6}/icalcli/etesync_backend/etesync_crud.py +0 -0
  13. {icalcli-1.1.4 → icalcli-1.1.6}/icalcli/file_backend/__init__.py +0 -0
  14. {icalcli-1.1.4 → icalcli-1.1.6}/icalcli/file_backend/ics_interface.py +0 -0
  15. {icalcli-1.1.4 → icalcli-1.1.6}/icalcli/icalcli.py +0 -0
  16. {icalcli-1.1.4 → icalcli-1.1.6}/icalcli/printer.py +0 -0
  17. {icalcli-1.1.4 → icalcli-1.1.6}/icalcli/utils.py +0 -0
  18. {icalcli-1.1.4 → icalcli-1.1.6}/icalcli.egg-info/SOURCES.txt +0 -0
  19. {icalcli-1.1.4 → icalcli-1.1.6}/icalcli.egg-info/dependency_links.txt +0 -0
  20. {icalcli-1.1.4 → icalcli-1.1.6}/icalcli.egg-info/entry_points.txt +0 -0
  21. {icalcli-1.1.4 → icalcli-1.1.6}/icalcli.egg-info/requires.txt +0 -0
  22. {icalcli-1.1.4 → icalcli-1.1.6}/icalcli.egg-info/top_level.txt +0 -0
  23. {icalcli-1.1.4 → icalcli-1.1.6}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: icalcli
3
- Version: 1.1.4
3
+ Version: 1.1.6
4
4
  Summary: Icalendar Calendar Command Line Interface
5
5
  Author: Jayanth R. Varma
6
6
  Maintainer-email: "Jayanth R. Varma" <jrvarma@gmail.com>
@@ -1,5 +1,5 @@
1
1
  __program__ = 'icalcli'
2
- __version__ = 'v1.0.4'
2
+ __version__ = 'v1.1.6'
3
3
  __author__ = 'Jayanth Varma (modified gcalcli by Eric Davis et al.)'
4
4
  from icalcli.icalcli import IcalendarInterface # noqa F401
5
5
  try:
@@ -33,6 +33,18 @@ from icalendar import Calendar
33
33
  # No exception handling is done. That is left to the calling program.
34
34
 
35
35
 
36
+ def decode_if_bytes(string_or_bytes):
37
+ # Version 7 of iCalendar made a breaking change
38
+ # The return type of text properties was changed from bytes to string
39
+ # To work with both old and new versions of iCalendar and to guard
40
+ # against any future change in the return value of calendar.to_ical()
41
+ # which still returns bytes, we apply decode only after confirming that
42
+ # the value is bytes
43
+ if isinstance(string_or_bytes, bytes):
44
+ return string_or_bytes.decode()
45
+ return string_or_bytes
46
+
47
+
36
48
  class EtebaseInterface (EtebaseCRUD):
37
49
  def __init__(self, user, server_url, password, calendar_uid,
38
50
  cache_file=None, silent=True):
@@ -63,7 +75,7 @@ class EtebaseInterface (EtebaseCRUD):
63
75
  event : event to be added (iCalendar object)
64
76
  """
65
77
  ics = self.event_to_ics(event, vtimezone)
66
- uid = event.decoded('uid').decode()
78
+ uid = decode_if_bytes(event.decoded('uid'))
67
79
  EtebaseCRUD.create_event(self, ics, uid)
68
80
 
69
81
  def update_event(self, event, vtimezone=None):
@@ -73,7 +85,7 @@ class EtebaseInterface (EtebaseCRUD):
73
85
  ----------
74
86
  event : event to be added (iCalendar object)
75
87
  """
76
- uid = event.decoded('uid').decode()
88
+ uid = decode_if_bytes(event.decoded('uid'))
77
89
  ics = self.event_to_ics(event, vtimezone)
78
90
  EtebaseCRUD.update_event(self, ics, uid)
79
91
 
@@ -6,7 +6,6 @@
6
6
  from icalcli.etesync_backend.etesync_crud import EtesyncCRUD
7
7
  from icalendar import Calendar
8
8
 
9
-
10
9
  # The EtesyncInterface class is basically a wrapper around the
11
10
  # EtesyncCRUD class from which it is derived
12
11
  # The CRUD operations (Create, Retrieve, Update and Delete)
@@ -37,6 +36,18 @@ from icalendar import Calendar
37
36
  # No exception handling is done. That is left to the calling program.
38
37
 
39
38
 
39
+ def decode_if_bytes(string_or_bytes):
40
+ # Version 7 of iCalendar made a breaking change
41
+ # The return type of text properties was changed from bytes to string
42
+ # To work with both old and new versions of iCalendar and to guard
43
+ # against any future change in the return value of calendar.to_ical()
44
+ # which still returns bytes, we apply decode only after confirming that
45
+ # the value is bytes
46
+ if isinstance(string_or_bytes, bytes):
47
+ return string_or_bytes.decode()
48
+ return string_or_bytes
49
+
50
+
40
51
  class EtesyncInterface (EtesyncCRUD):
41
52
  def __init__(self, email, userPassword, remoteUrl, uid, authToken,
42
53
  cipher_key=None, silent=True):
@@ -76,7 +87,7 @@ class EtesyncInterface (EtesyncCRUD):
76
87
  ----------
77
88
  event : event to be added (iCalendar object)
78
89
  """
79
- uid = event.decoded('uid').decode()
90
+ uid = decode_if_bytes(event.decoded('uid'))
80
91
  ics = self.event_to_ics(event, vtimezone)
81
92
  EtesyncCRUD.update_event(self, ics, uid)
82
93
 
@@ -91,7 +102,7 @@ class EtesyncInterface (EtesyncCRUD):
91
102
  cal.add_component(event)
92
103
  if vtimezone:
93
104
  cal.add_component(vtimezone)
94
- ics = cal.to_ical().decode()
105
+ ics = decode_if_bytes(cal.to_ical())
95
106
  return ics
96
107
 
97
108
  def sync(self, vtimezone=None):
@@ -99,4 +110,3 @@ class EtesyncInterface (EtesyncCRUD):
99
110
  """
100
111
  EtesyncCRUD.sync(self)
101
112
  self.all_events()
102
-
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: icalcli
3
- Version: 1.1.4
3
+ Version: 1.1.6
4
4
  Summary: Icalendar Calendar Command Line Interface
5
5
  Author: Jayanth R. Varma
6
6
  Maintainer-email: "Jayanth R. Varma" <jrvarma@gmail.com>
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "icalcli"
7
- version = "1.1.4"
7
+ version = "1.1.6"
8
8
  authors = [
9
9
  {name = "Jayanth R. Varma"}
10
10
  ]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes