Skip to content

Commit e59d9f5

Browse files
committed
Fix bad merge.
1 parent b5400b4 commit e59d9f5

1 file changed

Lines changed: 2 additions & 38 deletions

File tree

vobject/change_tz.py

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,12 @@
11
"""Translate an ics file's events to a different timezone."""
22

3-
<<<<<<< HEAD
4-
from optparse import OptionParser
5-
import vobject
6-
7-
try:
8-
import PyICU
9-
except:
10-
PyICU = None
11-
12-
=======
13-
>>>>>>> master
143
from datetime import datetime
154
from optparse import OptionParser
165

176
import pytz
187
from dateutil import tz
198

20-
from vobject import base, icalendar
9+
import vobject
2110

2211
version = "0.1"
2312

@@ -57,7 +46,7 @@ def convert_events(utc_only, args):
5746
_tzone = args[1] if len(args) > 1 else 'UTC'
5847

5948
print("... Reading {}".format(ics_file))
60-
cal = base.readOne(open(ics_file))
49+
cal = vobject.readOne(open(ics_file))
6150
change_tz(cal, new_timezone=tz.gettz(_tzone), default=tz.gettz('UTC'), utc_only=utc_only)
6251

6352
out_name = "{}.converted".format(ics_file)
@@ -74,32 +63,7 @@ def main():
7463
if options.list:
7564
show_timezones()
7665
elif args:
77-
<<<<<<< HEAD
78-
utc_only = options.utc
79-
if utc_only:
80-
which = "only UTC"
81-
else:
82-
which = "all"
83-
print("Converting {0!s} events".format(which))
84-
ics_file = args[0]
85-
if len(args) > 1:
86-
timezone = PyICU.ICUtzinfo.getInstance(args[1])
87-
else:
88-
timezone = PyICU.ICUtzinfo.default
89-
print("... Reading {0!s}".format(ics_file))
90-
cal = vobject.readOne(open(ics_file))
91-
change_tz(cal, timezone, PyICU.ICUtzinfo.default, utc_only)
92-
93-
out_name = ics_file + '.converted'
94-
print("... Writing {0!s}".format(out_name))
95-
96-
with open(out_name, 'wb') as out:
97-
cal.serialize(out)
98-
99-
print("Done")
100-
=======
10166
convert_events(utc_only=options.utc, args=args)
102-
>>>>>>> master
10367

10468

10569
def get_options():

0 commit comments

Comments
 (0)