Mercurial > hg > Feedworm
changeset 246:7c719c4f5655
Fix all remaining code style bugs
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Tue, 09 Jun 2015 02:45:29 +0200 |
parents | 8e73a8ae863f |
children | ea6fa9568515 |
files | backend/couchdb/Preferences.py backend/sqlalchemy/Mapping.py feedworm.py prettyprint.py tests/FeedUpdaterTests.py tests/couchdb/FeedTests.py tests/couchdb/ListDateTimeFieldTests.py |
diffstat | 7 files changed, 11 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/backend/couchdb/Preferences.py Tue Jun 09 02:30:55 2015 +0200 +++ b/backend/couchdb/Preferences.py Tue Jun 09 02:45:29 2015 +0200 @@ -22,7 +22,7 @@ self.document = self.database[row.id] except StopIteration: empty = {"doctype": "preferences"} - doc_id, doc_rev = self.database.save(empty) #@UnusedVariable + doc_id, doc_rev = self.database.save(empty) self.document = self.database[doc_id] def _documentValue(self, key, defaultValue=None):
--- a/backend/sqlalchemy/Mapping.py Tue Jun 09 02:30:55 2015 +0200 +++ b/backend/sqlalchemy/Mapping.py Tue Jun 09 02:45:29 2015 +0200 @@ -71,7 +71,7 @@ mapper(FeedEntry, feedEntryTable) mapper(Feed, feedTable, properties = { - "entries" : relation(FeedEntry, backref="feed", lazy=True, cascade="delete, delete-orphan") + 'entries': relation(FeedEntry, backref="feed", lazy=True, cascade="delete, delete-orphan") } ) mapper(Preference, preferencesTable)
--- a/feedworm.py Tue Jun 09 02:30:55 2015 +0200 +++ b/feedworm.py Tue Jun 09 02:45:29 2015 +0200 @@ -30,7 +30,7 @@ if __name__ == '__main__': filterWarnings() configureLogging() - + backend = BackendFactory.createBackend() preferences = backend.preferences() setupProxy(preferences)
--- a/prettyprint.py Tue Jun 09 02:30:55 2015 +0200 +++ b/prettyprint.py Tue Jun 09 02:45:29 2015 +0200 @@ -2,7 +2,7 @@ import sys newlineAfter = ['{', '[', ','] -newlineBefore = [ '}', ']' ] +newlineBefore = ['}', ']'] def prettyPrint(file): indent = 0 @@ -25,7 +25,7 @@ printCommand(char) if doIndent: - for x in range(indent): #@UnusedVariable + for x in range(indent): sys.stdout.write(" ") doIndent = False @@ -35,7 +35,7 @@ def p_nl(char): sys.stdout.write(char) sys.stdout.write("\n") - + def nl_p(char): sys.stdout.write("\n") sys.stdout.write(char) @@ -44,7 +44,7 @@ if len(sys.argv) < 2: print("usage: %s <file>" % (sys.argv[0])) sys.exit(1) - + filename = sys.argv[1] with open(filename) as file: prettyPrint(file)
--- a/tests/FeedUpdaterTests.py Tue Jun 09 02:30:55 2015 +0200 +++ b/tests/FeedUpdaterTests.py Tue Jun 09 02:45:29 2015 +0200 @@ -13,12 +13,12 @@ except FeedUpdateException: # this one was expected pass - + def testFeedContainsValidUrl(self): feed = Feed("valid", "http://www.joelonsoftware.com/rss.xml") result = FeedUpdater(None, feed).getFeed() self.assertEqual("Joel on Software", result["feed"].title) if __name__ == "__main__": - #import sys;sys.argv = ['', 'Test.testName'] + # import sys;sys.argv = ['', 'Test.testName'] unittest.main()
--- a/tests/couchdb/FeedTests.py Tue Jun 09 02:30:55 2015 +0200 +++ b/tests/couchdb/FeedTests.py Tue Jun 09 02:45:29 2015 +0200 @@ -33,5 +33,5 @@ self.database = self.server.create(DATABASE_NAME) if __name__ == "__main__": - #import sys;sys.argv = ['', 'Test.testName'] + # import sys;sys.argv = ['', 'Test.testName'] unittest.main()
--- a/tests/couchdb/ListDateTimeFieldTests.py Tue Jun 09 02:30:55 2015 +0200 +++ b/tests/couchdb/ListDateTimeFieldTests.py Tue Jun 09 02:45:29 2015 +0200 @@ -60,5 +60,5 @@ return database if __name__ == "__main__": - #import sys;sys.argv = ['', 'Test.testName'] + # import sys;sys.argv = ['', 'Test.testName'] unittest.main()