Enhance the coding style and consistency.

Bug #1084747 reported by Tobias Schlauch
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Python WebDAV Library
New
Medium
Tobias Schlauch

Bug Description

There are a lot of small coding style issue in the code base which shloud be fixed:
- Create a adapted pylint configuration: Basically, change to camel case!
- Run pylint over the code base.

Here are some example issues (Special thanks to Mark!):
- A few lines still finish with a semicolon:

src/webdav/WebdavClient.py:235: self.connection.logger.debug("Copy to " + repr(toUrl));
src/webdav/WebdavClient.py:266: self.connection.logger.debug("Move to " + repr(toUrl));
tests/AuthentificationTestCase.py:53: self.testListResources();
tests/ClientTestCase.py:94: child= self.resource.addCollection("new");
tests/ClientTestCase.py:117: child= self.resource.addResource("new", "Binary Content", {('TENT:', 'feature') : "X4711"});
tests/ClientTestCase.py:137: child= self.resource.addResource("new");
tests/ClientTestCase.py:154: child= self.resource.addResource("new", "Binary Content");
tests/ClientTestCase.py:177: child= self.resource.addCollection("new", token);
tests/ClientTestCase.py:219: child= self.resource.addResource("new", "Binary Content", {('TENT:', 'feature') : "X4711"});
tests/ClientTestCase.py:239: child= self.resource.addResource("new", "Binary Content", {('TENT:', 'feature') : "X4711"});
tests/setAcls.py:39: '</D:%s>\n' % TAG_ACE;

- Many lines also finish with whitespace

Tags: code style

Related branches

Revision history for this message
Tobias Schlauch (tobias-schlauch) wrote :

Added pylint build target and corresponding pylint definition.
Created a CI build.

Revision history for this message
Tobias Schlauch (tobias-schlauch) wrote :
Revision history for this message
Tobias Schlauch (tobias-schlauch) wrote :

Problems in 'webdav.Connection':
- There's still a spurious space at the end of
self.logger.debug("Exception occurred! Retry... "

- "# The following switch activates a workaround for the Tamino webdav
server:" -- err, which switch?

- The canonical form is "UTF-8" (not "Utf-8") -- I mean this for
your comments, not for variables etc. (more generally the case of
abbreviations/proper names does not seem to be very consistent)

- Similarly there should be a space after "ISO" and "RFC", except
in variables etc.

Changed in python-webdav-lib:
importance: Undecided → Medium
assignee: nobody → Tobias Schlauch (tobias-schlauch)
milestone: none → 0.5.0
Revision history for this message
Tobias Schlauch (tobias-schlauch) wrote :

self.logger.debug("Exception occurred! Retry...", exc_info=True)
raise WebdavError("Cannot perform request.")

Surely this is not retrying, as it immediately raises an exception?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.