diff src/memory/memory.py @ 1015:fee00f2e11c2

memory, jp: added jp commands to load/save parameters template
author souliane <souliane@mailoo.org>
date Sun, 04 May 2014 18:43:54 +0200
parents a7d33c7a8277
children f6182f6418ea
line wrap: on
line diff
--- a/src/memory/memory.py	Mon May 05 20:16:14 2014 +0200
+++ b/src/memory/memory.py	Sun May 04 18:43:54 2014 +0200
@@ -207,8 +207,12 @@
         return value
 
     def load_xml(self, filename):
-        """Load parameters template from xml file"""
-        if filename is None:
+        """Load parameters template from xml file
+
+        @param filename (str): input file
+        @return bool: True in case of success
+        """
+        if not filename:
             return False
         filename = os.path.expanduser(filename)
         if os.path.exists(filename):
@@ -246,9 +250,13 @@
         except KeyError:
             log.error(_("Trying to purge roster status cache for a profile not in memory: [%s]") % profile)
 
-    def save_xml(self, filename=None):
-        """Save parameters template to xml file"""
-        if filename is None:
+    def save_xml(self, filename):
+        """Save parameters template to xml file
+
+        @param filename (str): output file
+        @return bool: True in case of success
+        """
+        if not filename:
             return False
         #TODO: need to encrypt files (at least passwords !) and set permissions
         filename = os.path.expanduser(filename)