From 41be71f09f0194611cf4f72c25013eec64a22bb0 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Thu, 31 Aug 2017 20:35:58 -0700 Subject: [PATCH] Trim trailing whitespace --- CONTRIBUTING.rst | 2 +- bson/_cbsonmodule.c | 6 +++--- bson/max_key.py | 4 ++-- bson/min_key.py | 6 +++--- bson/time64.c | 14 +++++++------- bson/time64.h | 2 +- bson/time64_limits.h | 2 +- doc/examples/authentication.rst | 2 +- doc/examples/bulk.rst | 6 +++--- doc/tools.rst | 2 +- test/certificates/crl.pem | 2 +- test/high_availability/test_ha.py | 10 +++++----- test/mod_wsgi_test/apache22amazon.conf | 12 ++++++------ test/mod_wsgi_test/apache22ubuntu1204.conf | 12 ++++++------ test/mod_wsgi_test/apache24ubuntu161404.conf | 12 ++++++------ test/test_bson.py | 4 ++-- test/test_cursor_manager.py | 2 +- test/test_discovery_and_monitoring.py | 2 +- 18 files changed, 51 insertions(+), 51 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index a431ba8d0..21b814dd4 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -2,7 +2,7 @@ Contributing to PyMongo ======================= PyMongo has a large `community -`_ and +`_ 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. diff --git a/bson/_cbsonmodule.c b/bson/_cbsonmodule.c index 67175eb9e..a2927425c 100644 --- a/bson/_cbsonmodule.c +++ b/bson/_cbsonmodule.c @@ -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); diff --git a/bson/max_key.py b/bson/max_key.py index 4420b9049..d8afc6e9f 100644 --- a/bson/max_key.py +++ b/bson/max_key.py @@ -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) diff --git a/bson/min_key.py b/bson/min_key.py index ec40781b2..766b11746 100644 --- a/bson/min_key.py +++ b/bson/min_key.py @@ -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 diff --git a/bson/time64.c b/bson/time64.c index 6b49206b9..d9173e7f7 100644 --- a/bson/time64.c +++ b/bson/time64.c @@ -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; } diff --git a/bson/time64.h b/bson/time64.h index df9be9b0e..61d977692 100644 --- a/bson/time64.h +++ b/bson/time64.h @@ -37,7 +37,7 @@ struct TM64 { #define TM TM64 #else #define TM tm -#endif +#endif /* Declare public functions */ diff --git a/bson/time64_limits.h b/bson/time64_limits.h index fd4455f66..1d30607ba 100644 --- a/bson/time64_limits.h +++ b/bson/time64_limits.h @@ -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_* diff --git a/doc/examples/authentication.rst b/doc/examples/authentication.rst index 835821328..20c6d5ee9 100644 --- a/doc/examples/authentication.rst +++ b/doc/examples/authentication.rst @@ -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 diff --git a/doc/examples/bulk.rst b/doc/examples/bulk.rst index fb8fb1afb..f9b5a9f21 100644 --- a/doc/examples/bulk.rst +++ b/doc/examples/bulk.rst @@ -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, diff --git a/doc/tools.rst b/doc/tools.rst index 481bda0ae..bcb280e19 100644 --- a/doc/tools.rst +++ b/doc/tools.rst @@ -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 `_. - + MotorEngine `MotorEngine `_ is a port of MongoEngine to Motor, for asynchronous access with Tornado. diff --git a/test/certificates/crl.pem b/test/certificates/crl.pem index 047765726..35b5d6a22 100644 --- a/test/certificates/crl.pem +++ b/test/certificates/crl.pem @@ -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 diff --git a/test/high_availability/test_ha.py b/test/high_availability/test_ha.py index c9c120a86..1e5b17624 100644 --- a/test/high_availability/test_ha.py +++ b/test/high_availability/test_ha.py @@ -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): diff --git a/test/mod_wsgi_test/apache22amazon.conf b/test/mod_wsgi_test/apache22amazon.conf index 97ab0d997..883992c12 100644 --- a/test/mod_wsgi_test/apache22amazon.conf +++ b/test/mod_wsgi_test/apache22amazon.conf @@ -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 - + AllowOverride None Order Deny,Allow Deny from All - + AllowOverride None Order Allow,Deny diff --git a/test/mod_wsgi_test/apache22ubuntu1204.conf b/test/mod_wsgi_test/apache22ubuntu1204.conf index 9ff257bc3..281c5862c 100644 --- a/test/mod_wsgi_test/apache22ubuntu1204.conf +++ b/test/mod_wsgi_test/apache22ubuntu1204.conf @@ -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 - + AllowOverride None Order Deny,Allow @@ -25,5 +25,5 @@ CustomLog ${PWD}/access_log combined Order Allow,Deny Allow from All - + Include ${PROJECT_DIRECTORY}/test/mod_wsgi_test/mod_wsgi_test.conf diff --git a/test/mod_wsgi_test/apache24ubuntu161404.conf b/test/mod_wsgi_test/apache24ubuntu161404.conf index 24ad25f8a..f0a173437 100644 --- a/test/mod_wsgi_test/apache24ubuntu161404.conf +++ b/test/mod_wsgi_test/apache24ubuntu161404.conf @@ -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 - + AllowOverride None Require all denied @@ -24,5 +24,5 @@ CustomLog ${PWD}/access_log combined AllowOverride None Require all granted - + Include ${PROJECT_DIRECTORY}/test/mod_wsgi_test/mod_wsgi_test.conf diff --git a/test/test_bson.py b/test/test_bson.py index 6ca221422..07e892c64 100644 --- a/test/test_bson.py +++ b/test/test_bson.py @@ -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) diff --git a/test/test_cursor_manager.py b/test/test_cursor_manager.py index 9e24a6c69..ee0b97858 100644 --- a/test/test_cursor_manager.py +++ b/test/test_cursor_manager.py @@ -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): diff --git a/test/test_discovery_and_monitoring.py b/test/test_discovery_and_monitoring.py index 93f4466c5..d8021d937 100644 --- a/test/test_discovery_and_monitoring.py +++ b/test/test_discovery_and_monitoring.py @@ -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,