Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Commit

Permalink
Format files with yapf (PEP8).
Browse files Browse the repository at this point in the history
  • Loading branch information
creachadair committed Jul 22, 2020
1 parent 99d059f commit 9dc1629
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
11 changes: 4 additions & 7 deletions dnd.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ class DNDProtocolError(DNDError):
error code, the `value' field gives the descriptive text returned
by the server.
"""

def __init__(self, key, value=''):
self.key = key
self.value = value
Expand Down Expand Up @@ -316,7 +315,6 @@ class DNDRecord(dict):
were an attribute as well, provided it is syntactically legal to
do so (e.g., a field named "class" would not work).
"""

def __init__(self, session, query, pw=None):
self._session = weakref.ref(session)
self._query = query
Expand Down Expand Up @@ -347,7 +345,6 @@ class RecordSet(set):
tell whether the query from which this record set was generated
had additional records that were not returned by the server.
"""

def __init__(self, itms=()):
super(RecordSet, self).__init__(itms)
self.more = False
Expand Down Expand Up @@ -489,15 +486,15 @@ def readable_fields(self, bywhom='any'):
"""Return a set of the field names available on the DND which
are readable by the specified category.
"""
return set(
elt.name for elt in self.fieldinfo() if elt.is_readable(bywhom))
return set(elt.name for elt in self.fieldinfo()
if elt.is_readable(bywhom))

def writable_fields(self, bywhom='user'):
"""Return a set of the field names available on the DND which
are writable by the specified category.
"""
return set(
elt.name for elt in self.fieldinfo() if elt.is_writable(bywhom))
return set(elt.name for elt in self.fieldinfo()
if elt.is_writable(bywhom))

def keep_alive(self):
"""Send a NOOP command to the DND. This prevents an idle
Expand Down
5 changes: 2 additions & 3 deletions test_dnd.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class PseudoDND(object):
which sends a default response to the client. Your method may
call .h_default() explicitly if desired for the default behaviour.
"""

def __init__(self, port):
"""Creates a new PseudoDND listening at the specified port.
Expand Down Expand Up @@ -352,8 +351,8 @@ def tearDown(self):

def runTest(self):
try:
self._dnd = dnd.DNDSession(
server=self.host_name, port=self.host_port)
self._dnd = dnd.DNDSession(server=self.host_name,
port=self.host_port)
d = self._dnd
except dnd.DNDError, e:
self.fail('unable to create test DNDSession: %s' % e)
Expand Down

0 comments on commit 9dc1629

Please sign in to comment.