"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/lib/io.py" between
revelation-0.5.3.tar.xz and revelation-0.5.4.tar.xz

About: Revelation is a password manager for the GNOME 3 desktop.

io.py  (revelation-0.5.3.tar.xz):io.py  (revelation-0.5.4.tar.xz)
skipping to change at line 29 skipping to change at line 29
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# #
from . import datahandler from . import datahandler
import os.path, re import os.path, re
import gi
from gi.repository import Gio, GObject, GLib from gi.repository import Gio, GObject, GLib
class DataFile(GObject.GObject): class DataFile(GObject.GObject):
"Handles data files" "Handles data files"
def __init__(self, handler): def __init__(self, handler):
GObject.GObject.__init__(self) GObject.GObject.__init__(self)
self.__uri = None self.__uri = None
self.__handler = None self.__handler = None
skipping to change at line 95 skipping to change at line 94
"Gets the current password" "Gets the current password"
return self.__password return self.__password
def load(self, file, password = None, pwgetter = None): def load(self, file, password = None, pwgetter = None):
"Loads a file" "Loads a file"
file = file_normpath(file) file = file_normpath(file)
data = file_read(file) data = file_read(file)
if self.__handler == None: if self.__handler is None:
self.__handler = datahandler.detect_handler(data)() self.__handler = datahandler.detect_handler(data)()
self.__handler.check(data) self.__handler.check(data)
if self.__handler.encryption == True and password is None and pwgetter ! = None: if self.__handler.encryption == True and password is None and pwgetter ! = None:
password = pwgetter() password = pwgetter()
entrystore = self.__handler.import_data(data, password) entrystore = self.__handler.import_data(data, password)
self.set_password(password) self.set_password(password)
skipping to change at line 144 skipping to change at line 143
"Sets and initializes the current data handler" "Sets and initializes the current data handler"
self.__handler = handler is not None and handler() or None self.__handler = handler is not None and handler() or None
def set_password(self, password): def set_password(self, password):
"Sets the password for the current file" "Sets the password for the current file"
self.__password = password self.__password = password
GObject.type_register(DataFile) GObject.type_register(DataFile)
GObject.signal_new("changed", DataFile, GObject.SIGNAL_ACTION, GObject.TYPE_BOOL GObject.signal_new("changed", DataFile, GObject.SignalFlags.ACTION,
EAN, (str,)) GObject.TYPE_BOOLEAN, (str,))
GObject.signal_new("content-changed", DataFile, GObject.SIGNAL_ACTION, GObject.T GObject.signal_new("content-changed", DataFile, GObject.SignalFlags.ACTION,
YPE_BOOLEAN, (str,)) GObject.TYPE_BOOLEAN, (str,))
def file_exists(file): def file_exists(file):
"Checks if a file exists" "Checks if a file exists"
if file is None: if file is None:
return False return False
return Gio.File.new_for_path(file).query_exists() return Gio.File.new_for_path(file).query_exists()
def file_is_local(file): def file_is_local(file):
 End of changes. 3 change blocks. 
6 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)