Skip to content

Commit

Permalink
Use doble quotes everywhere and lint for this on travis
Browse files Browse the repository at this point in the history
  • Loading branch information
clopez committed May 22, 2017
1 parent 9c08d1f commit b48ca03
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 16 deletions.
1 change: 1 addition & 0 deletions .flake8
Expand Up @@ -3,3 +3,4 @@
filename = *.py
hang-closing = False
max-line-length = 110
inline-quotes = double
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -3,7 +3,7 @@ language: python
python:
- 3.5
install:
- pip install flake8
- pip install flake8 flake8-quotes
script:
- ln -s revolt revolt.py
- flake8 .
6 changes: 3 additions & 3 deletions revolt/__init__.py
Expand Up @@ -7,9 +7,9 @@
# Distributed under terms of the GPLv3 license.

import gi
gi.require_versions(dict(WebKit2='4.0',
Gtk='3.0',
GLib='2.0'))
gi.require_versions(dict(WebKit2="4.0",
Gtk="3.0",
GLib="2.0"))


def main(program_path):
Expand Down
14 changes: 7 additions & 7 deletions revolt/statusicon.py
Expand Up @@ -183,15 +183,15 @@ def __on_popup_menu(self, icon, button, time):

def __on_icon_size_change(self, statusicon, size):
if size > 31:
icon_size = '32'
icon_size = "32"
elif size > 23:
icon_size = '24'
icon_size = "24"
else:
icon_size = '16'
if desktop_is('kde'): # KDE: see gajim bug #5476
icon_size = '32'
if desktop_is('mate'):
icon_size = '16'
icon_size = "16"
if desktop_is("kde"): # KDE: see gajim bug #5476
icon_size = "32"
if desktop_is("mate"):
icon_size = "16"
self.__load_icons(icon_size)
self.__draw_icon()

Expand Down
8 changes: 4 additions & 4 deletions revolt/util.py
Expand Up @@ -44,12 +44,12 @@ def cachedproperty(f, doc=None):

def desktop_is(desktopname):
desktopname = desktopname.lower()
if desktopname == 'kde' and os.environ.get('KDE_FULL_SESSION') == 'true':
if desktopname == "kde" and os.environ.get("KDE_FULL_SESSION") == "true":
return True
if desktopname == 'mate' and os.environ.get('MATE_DESKTOP_SESSION_ID'):
if desktopname == "mate" and os.environ.get("MATE_DESKTOP_SESSION_ID"):
return True
for desktopvarname in ['XDG_SESSION_DESKTOP', 'DESKTOP_SESSION', 'XDG_CURRENT_DESKTOP',
'XDG_SESSION_DESKTOP', 'XDG_MENU_PREFIX', 'GDMSESSION', 'XDG_DATA_DIRS']:
for desktopvarname in ["XDG_SESSION_DESKTOP", "DESKTOP_SESSION", "XDG_CURRENT_DESKTOP",
"XDG_SESSION_DESKTOP", "XDG_MENU_PREFIX", "GDMSESSION", "XDG_DATA_DIRS"]:
desktopvarvalue = os.environ.get(desktopvarname)
if desktopvarvalue and desktopname in desktopvarvalue.lower():
return True
Expand Down
2 changes: 1 addition & 1 deletion revolt/window.py
Expand Up @@ -188,7 +188,7 @@ def __on_show_notification(self, webview, notification):
notif.set_body(notification.get_body())
# TODO: Use the avatar of the contact, if available.
notif.set_icon(self._notification_icon)
if not desktop_is('xfce'): # Workaround for XFCE bug #13586
if not desktop_is("xfce"): # Workaround for XFCE bug #13586
notif.set_priority(Gio.NotificationPriority.HIGH)
# use title as notification id:
# allows to reuse one notification for the same conversation
Expand Down

0 comments on commit b48ca03

Please sign in to comment.