Repository: data-for-change/anyway

Issue:
Run pylint in Travis
I ran pylint on the code and found numerous bad indentations and other bad conventions. In order to keep the code tidy I suggest creating a `.pylintrc` configuration for the project and run it in Travis. I can start making progress in this if my suggestion is accepted.

<!---
@huboard:{"custom_state":"archived"}
-->



Discussion:
Hi Roey, thank you for your contribution. I think it will be a good idea to discuss your suggestion a bit before you implement it, especially since we do not ha an automatic regression test to cover us after the modifications. We usually meet on Mondays after seven pm at Electra tower floor 34 in Tel Aviv, on Goole Camus. It will be great if you can attend, then we can discuss your suggestion, and other potential contribution. If it is inconvenient we can discuss online. Looking forward to meet you.
We have some tests on Travis, but they are quite minimal and don't really
check interaction with the site at all. A contribution in that area would
be most welcome.

On Tue, Aug 29, 2017, 23:06 Simona Holstein <notifications@github.com>
wrote:

> Hi Roey, thank you for your contribution. I think it will be a good idea
> to discuss your suggestion a bit before you implement it, especially since
> we do not ha an automatic regression test to cover us after the
> modifications. We usually meet on Mondays after seven pm at Electra tower
> floor 34 in Tel Aviv, on Goole Camus. It will be great if you can attend,
> then we can discuss your suggestion, and other potential contribution. If
> it is inconvenient we can discuss online. Looking forward to meet you.
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/hasadna/anyway/issues/690#issuecomment-325784398>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/AAQEwzqkDbUh9o_LbvgGLAcikYFU9q78ks5sdG9NgaJpZM4PGdFT>
> .
>


Resolving patch:
diff --git a/globalmaptiles.py b/globalmaptiles.py
--- a/globalmaptiles.py
+++ b/globalmaptiles.py
@@ -336,6 +336,7 @@ def Resolution(self, zoom ):
 		return 180 / 256.0 / 2**zoom
 		#return 180 / float( 1 << (8+zoom) )
 
+	@staticmethod
 	def TileBounds(tx, ty, zoom):
 		"Returns bounds of the given tile"
 		res = 180 / 256.0 / 2**zoom
diff --git a/importmail.py b/importmail.py
--- a/importmail.py
+++ b/importmail.py
@@ -64,7 +64,7 @@ def main(username=None, password=None, lastmail=False):
         typ, message_parts = imapsession.fetch(msgId, '(RFC822)')
         if typ != 'OK':
             logging.error('Error fetching mail.')
-            raise
+            raise Exception('Error fetching mail')
 
         email_body = message_parts[0][1]
         mail = email.message_from_string(email_body)
diff --git a/main.py b/main.py
--- a/main.py
+++ b/main.py
@@ -734,7 +734,7 @@ class ExtendedLoginForm(LoginForm):
     username = StringField('User Name', [validators.DataRequired()])
 
     def validate(self):
-        if not super(LoginForm, self).validate():
+        if not super(ExtendedLoginForm, self).validate():
             return False
         if self.username.data.strip() == '':
             return False


Test patch: