Skip to content

Commit

Permalink
Fix some grammar issues PyCharm was complaining about too.
Browse files Browse the repository at this point in the history
  • Loading branch information
da4089 committed Jan 31, 2025
1 parent ea1d9d4 commit 7d811f9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions vobject/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ def str_(s):


def to_unicode(value):
"""Converts a string argument to a unicode string.
"""Converts a string argument to a Unicode string.
If the argument is already a unicode string, it is returned unchanged.
Otherwise it must be a byte string and is decoded as utf8.
If the argument is already a Unicode string, it is returned unchanged.
Otherwise, it must be a byte string and is decoded as utf8.
"""
return value if isinstance(value, unicode_type) else value.decode("utf-8")

Expand All @@ -32,7 +32,7 @@ def to_basestring(s):
"""Converts a string argument to a byte string.
If the argument is already a byte string, it is returned unchanged.
Otherwise it must be a unicode string and is encoded as utf8.
Otherwise, it must be a Unicode string and is encoded as utf8.
"""
return s if isinstance(s, bytes) else s.encode("utf-8")

Expand Down Expand Up @@ -419,7 +419,7 @@ class Component(VBase):
are the lowercased names of child ContentLines or Components.
Note that BEGIN and END ContentLines are not included in contents.
@ivar name:
Uppercase string used to represent this Component, i.e VCARD if the
Uppercase string used to represent this Component, i.e. VCARD if the
serialized object starts with BEGIN:VCARD.
@ivar useBegin:
A boolean flag determining whether BEGIN: and END: lines should
Expand Down Expand Up @@ -897,7 +897,7 @@ def dquoteEscape(param):

def foldOneLine(outbuf, input_, lineLength=75):
"""
Folding line procedure that ensures multi-byte utf-8 sequences are not
Folding line procedure that ensures multibyte utf-8 sequences are not
broken across lines
TO-DO: This all seems odd. Is it still needed, especially in python3?
Expand Down
10 changes: 5 additions & 5 deletions vobject/behavior.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Behavior:
@cvar sortFirst:
The lower-case list of children which should come first when sorting.
@cvar allowGroup:
Whether or not vCard style group prefixes are allowed.
Whether vCard style group prefixes are allowed.
"""

name = ""
Expand Down Expand Up @@ -69,10 +69,10 @@ def validate(cls, obj, raiseException=False, complainUnrecognized=False):
L{Component<base.Component>} to be validated.
@param raiseException:
If True, raise a L{base.ValidateError} on validation failure.
Otherwise return a boolean.
Otherwise, return a boolean.
@param complainUnrecognized:
If True, fail to validate if an uncrecognized parameter or child is
found. Otherwise log the lack of recognition.
If True, fail to validate if an unrecognized parameter or child is
found. Otherwise, log the lack of recognition.
"""
if not cls.allowGroup and obj.group is not None:
Expand Down Expand Up @@ -139,7 +139,7 @@ def generateImplicitParameters(cls, obj):
@classmethod
def serialize(cls, obj, buf, lineLength, validate=True, *args, **kwargs):
"""
Set implicit parameters, do encoding, return unicode string.
Set implicit parameters, do encoding, return Unicode string.
If validate is True, raise VObjectError if the line doesn't validate
after implicit parameters are generated.
Expand Down

0 comments on commit 7d811f9

Please sign in to comment.