diff sat/plugins/plugin_misc_welcome.py @ 2624:56f94936df1e

code style reformatting using black
author Goffi <goffi@goffi.org>
date Wed, 27 Jun 2018 20:14:46 +0200
parents 26edcf3a30eb
children 003b8b4b56a7
line wrap: on
line diff
--- a/sat/plugins/plugin_misc_welcome.py	Wed Jun 27 07:51:29 2018 +0200
+++ b/sat/plugins/plugin_misc_welcome.py	Wed Jun 27 20:14:46 2018 +0200
@@ -20,6 +20,7 @@
 from sat.core.i18n import _, D_
 from sat.core.constants import Const as C
 from sat.core.log import getLogger
+
 log = getLogger(__name__)
 from sat.tools import xml_tools
 
@@ -30,7 +31,9 @@
     C.PI_TYPE: C.PLUG_TYPE_MISC,
     C.PI_MAIN: "Welcome",
     C.PI_HANDLER: "no",
-    C.PI_DESCRIPTION: _("""Plugin which manage welcome message and things to to on first connection.""")
+    C.PI_DESCRIPTION: _(
+        """Plugin which manage welcome message and things to to on first connection."""
+    ),
 }
 
 
@@ -40,7 +43,8 @@
 WELCOME_MSG_TITLE = D_(u"Welcome to Libervia/Salut à Toi")
 # XXX: this message is mainly targetting libervia new users for now
 #      (i.e.: it may look weird on other frontends)
-WELCOME_MSG = D_(u"""Welcome to a free (as in freedom) network!
+WELCOME_MSG = D_(
+    u"""Welcome to a free (as in freedom) network!
 
 If you have any trouble, or you want to help us for the bug hunting, you can contact us in real time chat by using the “Help / Official chat room”  menu.
 
@@ -49,7 +53,8 @@
 We hope that you'll enjoy using this project.
 
 The Libervia/Salut à Toi Team
-""")
+"""
+)
 
 
 PARAMS = """
@@ -60,11 +65,12 @@
     </category>
     </individual>
     </params>
-    """.format(category=WELCOME_PARAM_CATEGORY, name=WELCOME_PARAM_NAME, label=WELCOME_PARAM_LABEL)
+    """.format(
+    category=WELCOME_PARAM_CATEGORY, name=WELCOME_PARAM_NAME, label=WELCOME_PARAM_LABEL
+)
 
 
 class Welcome(object):
-
     def __init__(self, host):
         log.info(_("plugin Welcome initialization"))
         self.host = host
@@ -73,7 +79,12 @@
     def profileConnected(self, client):
         # XXX: if you wan to try first_start again, you'll have to remove manually
         #      the welcome value from your profile params in sat.db
-        welcome = self.host.memory.params.getParamA(WELCOME_PARAM_NAME, WELCOME_PARAM_CATEGORY, use_default=False, profile_key=client.profile)
+        welcome = self.host.memory.params.getParamA(
+            WELCOME_PARAM_NAME,
+            WELCOME_PARAM_CATEGORY,
+            use_default=False,
+            profile_key=client.profile,
+        )
         if welcome is None:
             first_start = True
             welcome = True
@@ -82,12 +93,12 @@
 
         if welcome:
             xmlui = xml_tools.note(WELCOME_MSG, WELCOME_MSG_TITLE)
-            self.host.actionNew({'xmlui': xmlui.toXml()}, profile=client.profile)
-            self.host.memory.setParam(WELCOME_PARAM_NAME, C.BOOL_FALSE, WELCOME_PARAM_CATEGORY, profile_key=client.profile)
+            self.host.actionNew({"xmlui": xmlui.toXml()}, profile=client.profile)
+            self.host.memory.setParam(
+                WELCOME_PARAM_NAME,
+                C.BOOL_FALSE,
+                WELCOME_PARAM_CATEGORY,
+                profile_key=client.profile,
+            )
 
         self.host.trigger.point("WELCOME", first_start, welcome, client.profile)
-
-
-
-
-