Skip to content

Commit

Permalink
Merge pull request #87 from MeggyCal/master
Browse files Browse the repository at this point in the history
remove six
  • Loading branch information
da4089 authored Dec 19, 2024
2 parents f7d9a5a + 501e8b2 commit 72ad96c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ dependencies = [
"python-dateutil >= 2.5.0; python_version < '3.10'",
"python-dateutil >= 2.7.0; python_version >= '3.10'",
"pytz >= 2019.1",
"six",
]
requires-python = ">= 3.8"
authors = [
Expand Down
12 changes: 6 additions & 6 deletions vobject/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import codecs
import logging
import re
import six
import io
import sys

# Package version
Expand Down Expand Up @@ -858,7 +858,7 @@ def getLogicalLines(fp, allowQP=True):
Quoted-printable data will be decoded in the Behavior decoding phase.
# We're leaving this test in for awhile, because the unittest was ugly and dumb.
>>> from six import StringIO
>>> from io import StringIO
>>> f=StringIO(testLines)
>>> for n, l in enumerate(getLogicalLines(f)):
... print("Line %s: %s" % (n, l[0]))
Expand All @@ -881,7 +881,7 @@ def getLogicalLines(fp, allowQP=True):

else:
quotedPrintable = False
newbuffer = six.StringIO
newbuffer = io.StringIO
logicalLine = newbuffer()
lineNumber = 0
lineStartNumber = 0
Expand Down Expand Up @@ -996,7 +996,7 @@ def defaultSerialize(obj, buf, lineLength):
"""
Encode and fold obj and its children, write to buf or return a string.
"""
outbuf = buf or six.StringIO()
outbuf = buf or io.StringIO()

if isinstance(obj, Component):
if obj.group is None:
Expand All @@ -1018,7 +1018,7 @@ def defaultSerialize(obj, buf, lineLength):
if obj.behavior and not startedEncoded:
obj.behavior.encode(obj)

s = six.StringIO()
s = io.StringIO()

if obj.group is not None:
s.write(obj.group + '.')
Expand Down Expand Up @@ -1082,7 +1082,7 @@ def readComponents(streamOrString, validate=False, transform=True,
Generate one Component at a time from a stream.
"""
if isinstance(streamOrString, basestring):
stream = six.StringIO(streamOrString)
stream = io.StringIO(streamOrString)
else:
stream = streamOrString

Expand Down
4 changes: 2 additions & 2 deletions vobject/hcalendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</span>
"""

import six
import io

from datetime import date, datetime, timedelta

Expand All @@ -45,7 +45,7 @@ def serialize(cls, obj, buf=None, lineLength=None, validate=True):
Serialize iCalendar to HTML using the hCalendar microformat (http://microformats.org/wiki/hcalendar)
"""

outbuf = buf or six.StringIO()
outbuf = buf or io.StringIO()
level = 0 # holds current indentation level
tabwidth = 3

Expand Down
10 changes: 5 additions & 5 deletions vobject/icalendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import base64

from dateutil import rrule, tz
import six
import io

try:
import pytz
Expand Down Expand Up @@ -56,7 +56,7 @@ def toUnicode(s):
"""
Take a string or unicode, turn it into unicode, decoding as utf-8
"""
if isinstance(s, six.binary_type):
if isinstance(s, bytes):
s = s.decode('utf-8')
return s

Expand Down Expand Up @@ -135,7 +135,7 @@ def gettzinfo(self):
good_lines = ('rdate', 'rrule', 'dtstart', 'tzname', 'tzoffsetfrom',
'tzoffsetto', 'tzid')
# serialize encodes as utf-8, cStringIO will leave utf-8 alone
buffer = six.StringIO()
buffer = io.StringIO()
# allow empty VTIMEZONEs
if len(self.contents) == 0:
return None
Expand Down Expand Up @@ -569,7 +569,7 @@ def setrruleset(self, rruleset):
self.add(name).value = setlist
elif name in RULENAMES:
for rule in setlist:
buf = six.StringIO()
buf = io.StringIO()
buf.write('FREQ=')
buf.write(FREQUENCIES[rule._freq])

Expand Down Expand Up @@ -1010,7 +1010,7 @@ def serialize(cls, obj, buf, lineLength, validate=True):
transformed = obj
undoTransform = False
out = None
outbuf = buf or six.StringIO()
outbuf = buf or io.StringIO()
if obj.group is None:
groupString = ''
else:
Expand Down

0 comments on commit 72ad96c

Please sign in to comment.