Trim trailing whitespace

This commit is contained in:
Anthony Sottile 2017-08-31 20:35:58 -07:00 committed by Bernie Hackett
parent ff81fbb938
commit 41be71f09f
18 changed files with 51 additions and 51 deletions

View File

@ -2,7 +2,7 @@ Contributing to PyMongo
=======================
PyMongo has a large `community
<http://api.mongodb.org/python/current/contributors.html>`_ and
<http://api.mongodb.org/python/current/contributors.html>`_ and
contributions are always encouraged. Contributions can be as simple as
minor tweaks to the documentation. Please read these guidelines before
sending a pull request.

View File

@ -1189,8 +1189,8 @@ static int _write_element_to_buffer(PyObject* self, buffer_t buffer,
} else if (PyObject_TypeCheck(value, state->REType)) {
return _write_regex_to_buffer(buffer, type_byte, value);
}
/*
/*
* Try Mapping and UUID last since we have to import
* them if we're in a sub-interpreter.
*/
@ -1982,7 +1982,7 @@ static PyObject* get_value(PyObject* self, PyObject* name, const char* buffer,
}
if ((PyDict_SetItemString(kwargs, "bytes", data)) == -1)
goto uuiderror;
}
if ((type_to_create = _get_object(state->UUID, "uuid", "UUID"))) {
value = PyObject_Call(type_to_create, args, kwargs);

View File

@ -36,13 +36,13 @@ class MaxKey(object):
def __le__(self, other):
return isinstance(other, MaxKey)
def __lt__(self, dummy):
return False
def __ge__(self, dummy):
return True
def __gt__(self, other):
return not isinstance(other, MaxKey)

View File

@ -33,16 +33,16 @@ class MinKey(object):
def __ne__(self, other):
return not self == other
def __le__(self, dummy):
return True
def __lt__(self, other):
return not isinstance(other, MinKey)
def __ge__(self, other):
return isinstance(other, MinKey)
def __gt__(self, dummy):
return False

View File

@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2007-2010 Michael G Schwern
@ -30,7 +30,7 @@ THE SOFTWARE.
Programmers who have available to them 64-bit time values as a 'long
long' type can use localtime64_r() and gmtime64_r() which correctly
converts the time even on 32-bit systems. Whether you have 64-bit time
converts the time even on 32-bit systems. Whether you have 64-bit time
values will depend on the operating system.
localtime64_r() is a 64-bit equivalent of localtime_r().
@ -278,7 +278,7 @@ static int check_tm(struct TM *tm)
assert(tm->tm_wday >= 0);
assert(tm->tm_wday <= 6);
assert(tm->tm_yday >= 0);
assert(tm->tm_yday <= length_of_year[IS_LEAP(tm->tm_year)]);
@ -354,7 +354,7 @@ static int safe_year(const Year year)
year_cycle += 17;
year_cycle %= SOLAR_CYCLE_LENGTH;
if( year_cycle < 0 )
if( year_cycle < 0 )
year_cycle = SOLAR_CYCLE_LENGTH + year_cycle;
assert( year_cycle >= 0 );
@ -651,7 +651,7 @@ struct TM *gmtime64_r (const Time64_T *in_time, struct TM *p)
p->tm_hour = v_tm_hour;
p->tm_mon = v_tm_mon;
p->tm_wday = v_tm_wday;
assert(check_tm(p));
return p;
@ -735,7 +735,7 @@ struct TM *localtime64_r (const Time64_T *time, struct TM *local_tm)
local_tm->tm_year++;
}
/* GMT is Jan 1st, xx01 year, but localtime is still Dec 31st
/* GMT is Jan 1st, xx01 year, but localtime is still Dec 31st
in a non-leap xx00. There is one point in the cycle
we can't account for which the safe xx00 year is a leap
year. So we need to correct for Dec 31st comming out as
@ -745,7 +745,7 @@ struct TM *localtime64_r (const Time64_T *time, struct TM *local_tm)
local_tm->tm_yday--;
assert(check_tm(local_tm));
return local_tm;
}

View File

@ -37,7 +37,7 @@ struct TM64 {
#define TM TM64
#else
#define TM tm
#endif
#endif
/* Declare public functions */

View File

@ -1,4 +1,4 @@
/*
/*
Maximum and minimum inputs your system's respective time functions
can correctly handle. time64.h will use your system functions if
the input falls inside these ranges and corresponding USE_SYSTEM_*

View File

@ -141,7 +141,7 @@ To authenticate using GSSAPI you must first install the python `kerberos`_ or
using the following authentication methods::
$ kinit mongodbuser@EXAMPLE.COM
mongodbuser@EXAMPLE.COM's Password:
mongodbuser@EXAMPLE.COM's Password:
$ klist
Credentials cache: FILE:/tmp/krb5cc_1000
Principal: mongodbuser@EXAMPLE.COM

View File

@ -99,7 +99,7 @@ the failure.
... db.test.bulk_write(requests)
... except BulkWriteError as bwe:
... pprint(bwe.details)
...
...
{'nInserted': 0,
'nMatched': 1,
'nModified': 1,
@ -137,7 +137,7 @@ and fourth operations succeed.
... db.test.bulk_write(requests, ordered=False)
... except BulkWriteError as bwe:
... pprint(bwe.details)
...
...
{'nInserted': 0,
'nMatched': 1,
'nModified': 1,
@ -170,7 +170,7 @@ after all operations are attempted, regardless of execution order.
... coll.bulk_write([InsertOne({'a': i}) for i in range(4)])
... except BulkWriteError as bwe:
... pprint(bwe.details)
...
...
{'nInserted': 4,
'nMatched': 0,
'nModified': 0,

View File

@ -89,7 +89,7 @@ Manga
layer on top of PyMongo. The syntax for defining schema is inspired by the
Django ORM, but Pymongo's query language is maintained. The source `is on
github <http://github.com/wladston/manga>`_.
MotorEngine
`MotorEngine <https://motorengine.readthedocs.io/>`_ is a port of
MongoEngine to Motor, for asynchronous access with Tornado.

View File

@ -5,7 +5,7 @@ Certificate Revocation List (CRL):
Last Update: Jan 31 23:00:50 2017 GMT
Next Update: Jan 30 23:00:50 2022 GMT
CRL extensions:
X509v3 CRL Number:
X509v3 CRL Number:
4096
Revoked Certificates:
Serial Number: 051740

View File

@ -53,10 +53,10 @@ def partition_nodes(nodes):
class HATestCase(unittest.TestCase):
"""A test case for connections to replica sets or mongos."""
# Override default 10-second interval for faster testing...
heartbeat_frequency = 0.5
# ... or disable it by setting "enable_heartbeat" to False.
enable_heartbeat = True
@ -180,7 +180,7 @@ class TestDirectConnection(HATestCase):
self.assertEqual(arbiter_port, client.port)
self.assertFalse(client.is_primary)
# See explanation above
try:
client.get_database(
@ -192,7 +192,7 @@ class TestDirectConnection(HATestCase):
self.fail(
'Unacknowledged insert into arbiter client %s should'
'have raised exception' % (client,))
class TestPassiveAndHidden(HATestCase):
@ -262,7 +262,7 @@ class TestMonitorRemovesRecoveringMember(HATestCase):
class TestTriggeredRefresh(HATestCase):
# Verify that if a secondary goes into RECOVERING mode or if the primary
# changes, the next exception triggers an immediate refresh.
enable_heartbeat = False
def setUp(self):

View File

@ -1,27 +1,27 @@
# This is a minimal httpd.conf file written for Apache 2.2 on Amazon Linux
# The modules directory is here by default.
# ServerRoot "/etc/httpd"
DocumentRoot ${PWD}
PidFile ${PWD}/apache2.pid
# Bind to localhost only, don't require sudo.
Listen 127.0.0.1:8080
# Required modules.
LoadModule authz_host_module modules/mod_authz_host.so
# Needed so we can set a custom log location.
LoadModule log_config_module modules/mod_log_config.so
ErrorLog ${PWD}/error_log
CustomLog ${PWD}/access_log combined
<Directory "/">
AllowOverride None
Order Deny,Allow
Deny from All
</Directory>
<Directory ${PWD}>
AllowOverride None
Order Allow,Deny

View File

@ -1,19 +1,19 @@
# This is a minimal httpd.conf file written for Apache 2.2 on Ubuntu 12.04
# The modules directory is here on Ubuntu.
ServerRoot "/usr/lib/apache2"
DocumentRoot ${PWD}
PidFile ${PWD}/apache2.pid
# Bind to localhost only, don't require sudo.
Listen 127.0.0.1:8080
# Required modules.
LoadModule authz_host_module modules/mod_authz_host.so
ErrorLog ${PWD}/error_log
CustomLog ${PWD}/access_log combined
<Directory "/">
AllowOverride None
Order Deny,Allow
@ -25,5 +25,5 @@ CustomLog ${PWD}/access_log combined
Order Allow,Deny
Allow from All
</Directory>
Include ${PROJECT_DIRECTORY}/test/mod_wsgi_test/mod_wsgi_test.conf

View File

@ -1,20 +1,20 @@
# This is a minimal httpd.conf file written for Apache 2.4 on Ubuntu 14.04/16.04
# The modules directory is here on Ubuntu.
ServerRoot "/usr/lib/apache2"
DocumentRoot ${PWD}
PidFile ${PWD}/apache2.pid
# Bind to localhost only, don't require sudo.
Listen 127.0.0.1:8080
# Required modules.
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
LoadModule authz_core_module modules/mod_authz_core.so
ErrorLog ${PWD}/error_log
CustomLog ${PWD}/access_log combined
<Directory "/">
AllowOverride None
Require all denied
@ -24,5 +24,5 @@ CustomLog ${PWD}/access_log combined
AllowOverride None
Require all granted
</Directory>
Include ${PROJECT_DIRECTORY}/test/mod_wsgi_test/mod_wsgi_test.conf

View File

@ -814,7 +814,7 @@ class TestBSON(unittest.TestCase):
self.assertTrue(MinKey() != 1)
self.assertFalse(MinKey() == 1)
self.assertTrue(MinKey() == MinKey())
# MinKey compared to MaxKey.
self.assertTrue(MinKey() < MaxKey())
self.assertTrue(MinKey() <= MaxKey())
@ -822,7 +822,7 @@ class TestBSON(unittest.TestCase):
self.assertFalse(MinKey() >= MaxKey())
self.assertTrue(MinKey() != MaxKey())
self.assertFalse(MinKey() == MaxKey())
# MaxKey's <, <=, >, >=, !=, and ==.
self.assertFalse(MaxKey() < None)
self.assertFalse(MaxKey() < 1)

View File

@ -49,7 +49,7 @@ class TestCursorManager(IntegrationTest):
@classmethod
def tearDownClass(cls):
cls.warn_context.__exit__()
cls.warn_context = None
cls.warn_context = None
cls.collection.drop()
def test_cursor_manager_validation(self):

View File

@ -178,7 +178,7 @@ def check_outcome(self, topology, outcome):
def create_test(scenario_def):
def run_scenario(self):
c = create_mock_topology(scenario_def['uri'])
for phase in scenario_def['phases']:
for response in phase['responses']:
got_ismaster(c,