[gedit-plugins] SessionSaver. Fix constructor and filename



commit fd500628e47a959260c0f6e50e254d312c5158ef
Author: Jordi Mas <jmas softcatala org>
Date:   Fri Jul 5 00:43:13 2019 +0200

    SessionSaver. Fix constructor and filename

 .gitlab-ci.yml                                               |  2 +-
 plugins/sessionsaver/sessionsaver/__init__.py                |  2 +-
 .../sessionsaver/{appactivable.py => appactivatable.py}      |  0
 plugins/sessionsaver/sessionsaver/store/xmlsessionstore.py   | 12 ++++++------
 plugins/sessionsaver/sessionsaver/windowactivable.py         |  2 +-
 5 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 9c73b51..782eaf3 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -31,5 +31,5 @@ static_analysis:
 
   script:
     - cd plugins
-    - flake8 --select=F --ignore=F401,F841,F811
+    - flake8 --select=F --ignore=F401,F841
 
diff --git a/plugins/sessionsaver/sessionsaver/__init__.py b/plugins/sessionsaver/sessionsaver/__init__.py
index 790a3ef..c27a6d2 100644
--- a/plugins/sessionsaver/sessionsaver/__init__.py
+++ b/plugins/sessionsaver/sessionsaver/__init__.py
@@ -22,5 +22,5 @@ gi.require_version('Gtk', '3.0')
 gi.require_version('GtkSource', '4')
 gi.require_version('PeasGtk', '1.0')
 
-from .appactivable import SessionSaverAppActivatable
+from .appactivatable import SessionSaverAppActivatable
 from .windowactivable import SessionSaverWindowActivatable
diff --git a/plugins/sessionsaver/sessionsaver/appactivable.py 
b/plugins/sessionsaver/sessionsaver/appactivatable.py
similarity index 100%
rename from plugins/sessionsaver/sessionsaver/appactivable.py
rename to plugins/sessionsaver/sessionsaver/appactivatable.py
diff --git a/plugins/sessionsaver/sessionsaver/store/xmlsessionstore.py 
b/plugins/sessionsaver/sessionsaver/store/xmlsessionstore.py
index 2b824f4..0022271 100644
--- a/plugins/sessionsaver/sessionsaver/store/xmlsessionstore.py
+++ b/plugins/sessionsaver/sessionsaver/store/xmlsessionstore.py
@@ -27,14 +27,14 @@ from .sessionstore import SessionStore
 from .session import Session
 
 class XMLSessionStore(SessionStore):
-    def __init__(self):
+    def __init__(self, filename = None):
         super(XMLSessionStore, self).__init__()
-        self.filename = os.path.join(GLib.get_user_config_dir(), 'gedit/saved-sessions.xml')
-        self.load()
 
-    def __init__(self, filename):
-        super(XMLSessionStore, self).__init__()
-        self.filename = filename
+        if filename is None:
+            self.filename = os.path.join(GLib.get_user_config_dir(), 'gedit/saved-sessions.xml')
+        else:
+            self.filename = filename
+
         self.load()
 
     def _escape(self, string):
diff --git a/plugins/sessionsaver/sessionsaver/windowactivable.py 
b/plugins/sessionsaver/sessionsaver/windowactivable.py
index 60f8469..6015743 100644
--- a/plugins/sessionsaver/sessionsaver/windowactivable.py
+++ b/plugins/sessionsaver/sessionsaver/windowactivable.py
@@ -20,7 +20,7 @@
 from gi.repository import GObject, Gio, Gedit
 from .dialogs import SaveSessionDialog, SessionManagerDialog
 from .store.xmlsessionstore import XMLSessionStore
-from .appactivable import SessionSaverAppActivatable
+from .appactivatable import SessionSaverAppActivatable
 
 try:
     import gettext


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]