Skip to content

Commit

Permalink
Fix bug: AttributeError with python-keyring>1.6.1 (fixed https://laun…
Browse files Browse the repository at this point in the history
  • Loading branch information
Germar committed Oct 9, 2013
1 parent 9730258 commit 78ffd4d
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 57 deletions.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Back In Time

Version 1.0.28
* Fix bug: AttributeError with python-keyring>1.6.1 [#1234024](https://bugs.launchpad.net/backintime/+bug/1234024)
* Fix bug: TypeError: KDirModel.removeColumns() is a private method in kde4/app.py [#1232694](https://bugs.launchpad.net/backintime/+bug/1232694)
* add '--checksum' commandline option [#886021](https://bugs.launchpad.net/backintime/+bug/886021)
* Fix bug: sshfs mount disconnect after a while due to some firewalls (add ServerAliveInterval) [#235685](https://answers.launchpad.net/backintime/+question/235685)
Expand Down
30 changes: 21 additions & 9 deletions README
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Back In Time

Copyright (C) 2008-2009 Oprea Dan, Bart de Koning, Richard Bailey
Copyright (C) 2008-2013 Oprea Dan, Bart de Koning, Richard Bailey, Germar Reitze

1. About

Expand All @@ -25,44 +25,54 @@ Copyright (C) 2008-2009 Oprea Dan, Bart de Koning, Richard Bailey

2. INSTALL

2.1. Ubuntu packages
2.1. Debian/Ubuntu packages

GNOME:

./makedeb.sh
sudo dpkg -i backintime-common-<version>.deb
sudo dpkg -i backintime-gnome-<version>.deb
sudo dpkg -i backintime-notify-<version>.deb

KDE4: (KDE4 >= 4.1)

./makedeb.sh
sudo dpkg -i backintime-common-<version>.deb
sudo dpkg -i backintime-kde4-<version>.deb

NOTE:
Ubuntu 8.04: to install KDE4 4.1 check this link:
http://news.softpedia.com/news/How-To-Install-KDE-4-1-On-Ubuntu-8-04-91034.shtml
sudo dpkg -i backintime-notify-<version>.deb

2.2. From sources

Common (dependencies: python, rsync, cron):
Common (dependencies: python, rsync, cron, openssh-client,
python-keyring
recomended: powermgmt-base, sshfs, encfs):

cd common
./configure
make
sudo make install

GNOME (dependencies: python-glade2, python-gnome2, meld):
GNOME (dependencies: x11-utils, python-glade2, python-gnome2, meld,
gksu, libnotify-bin, python-gnomekeyring):
cd gnome
./configure
make
sudo make install

KDE4 (dependencies: x11-utils, python-kde4 (>= 4.1), kompare):
KDE4 (dependencies: x11-utils, python-kde4 (>= 4.1), kompare, kdesudo,
libnotify-bin, python-keyring-kwallet):
cd kde4
./configure
make
sudo make install

NOTIFY (dependencies: libnotify-bin):
cd notify
./configure
make
sudo make install


NOTE: if want to run configure without check (gnome or kde), just run:
./configure --no-check

Expand All @@ -83,3 +93,5 @@ Copyright (C) 2008-2009 Oprea Dan, Bart de Koning, Richard Bailey
* Press OK and you will see the new actions called "Open with Back In Time" when you
right-click an item

Oct 2013

8 changes: 0 additions & 8 deletions common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,14 +582,6 @@ def mode_need_password(self, mode, pw_id = 1):
return False
return True

def get_keyring_backend(self):
#?Backend used for \fIprofile<N>.snapshots.<MODE>.password.save\fR
#?;gnomekeyring|kwallet
return self.get_str_value('keyring.backend', '')

def set_keyring_backend(self, value):
self.set_str_value('keyring.backend', value)

def get_keyring_service_name( self, profile_id = None, mode = None, pw_id = 1 ):
if mode is None:
mode = self.get_snapshots_mode(profile_id)
Expand Down
5 changes: 3 additions & 2 deletions common/create-manpage-backintime-config.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import re
import os
import sys
from time import strftime, gmtime

PATH = os.path.join(os.getcwd(), os.path.dirname(sys.argv[0]))

Expand All @@ -29,7 +30,7 @@
SORT = True #True = sort by alphabet; False = sort by line numbering
c = re.compile(r'.*?self\.get((?:_profile)?)_(.*?)_value ?\( ?[\'"](.*?)[\'"] ?(%?[^,]*?), ?[\'"]?([^\'",\)]*)[\'"]?')

HEADER = '''.TH backintime-config 1 "July 2013" "version %s" "USER COMMANDS"
HEADER = '''.TH backintime-config 1 "%s" "version %s" "USER COMMANDS"
.SH NAME
config \- BackInTime configuration files.
.SH SYNOPSIS
Expand Down Expand Up @@ -58,7 +59,7 @@
.br
0 */2 * * * nice -n 19 ionice -c2 -n7 /usr/bin/backintime --backup-job >/dev/null 2>&1
.SH POSSIBLE KEYWORDS
''' % VERSION
''' % (strftime('%b %Y', gmtime()), VERSION)

FOOTER = '''.SH SEE ALSO
backintime, backintime-gnome, backintime-kde4.
Expand Down
11 changes: 1 addition & 10 deletions common/man/C/backintime-config.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH backintime-config 1 "July 2013" "version 1.0.27" "USER COMMANDS"
.TH backintime-config 1 "Oct 2013" "version 1.0.27" "USER COMMANDS"
.SH NAME
config \- BackInTime configuration files.
.SH SYNOPSIS
Expand Down Expand Up @@ -36,15 +36,6 @@ Internal value used to prevent hash collisions on mountpoints. Do not change thi
Default: 0
.RE

.IP "\fIkeyring.backend\fR" 6
.RS
Type: str Allowed Values: gnomekeyring|kwallet
.br
Backend used for \fIprofile<N>.snapshots.<MODE>.password.save\fR
.PP
Default: ''
.RE

.IP "\fIprofile<N>.name\fR" 6
.RS
Type: str Allowed Values: text
Expand Down
2 changes: 1 addition & 1 deletion common/man/C/backintime.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH backintime 1 "June 2013" "version 1.0.27" "USER COMMANDS"
.TH backintime 1 "Oct 2013" "version 1.0.27" "USER COMMANDS"
.SH NAME
backintime \- a simple backup tool for Linux.
.PP
Expand Down
6 changes: 2 additions & 4 deletions common/password.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,7 @@ def __init__(self, cfg = None, *args, **kwargs):
self.db_usr = {}
self.fifo = password_ipc.FIFO(self.config.get_password_cache_fifo())

backend = self.config.get_keyring_backend()
self.keyring_supported = tools.set_keyring(backend)
self.keyring_supported = tools.keyring_supported()

def run(self):
"""
Expand Down Expand Up @@ -354,8 +353,7 @@ def __init__(self, cfg = None):
self.fifo = password_ipc.FIFO(self.config.get_password_cache_fifo())
self.db = {}

backend = self.config.get_keyring_backend()
self.keyring_supported = tools.set_keyring(backend)
self.keyring_supported = tools.keyring_supported()

def get_password(self, parent, profile_id, mode, pw_id = 1, only_from_keyring = False):
"""
Expand Down
19 changes: 10 additions & 9 deletions common/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,15 +500,16 @@ def set_env_key(env, env_file, key):
if key in env.keys():
env_file.set_str_value(key, env[key])

def set_keyring(prefered):
if prefered in ('', 'gnomekeyring'):
backends = (keyring.backend.GnomeKeyring(), keyring.backend.KDEKWallet())
elif prefered == 'kwallet':
backends = (keyring.backend.KDEKWallet(), keyring.backend.GnomeKeyring())
for backend in backends:
if backend.supported() == 1:
keyring.set_keyring(backend)
return True
def keyring_supported():
try:
backends = (keyring.backends.SecretService.Keyring,
keyring.backends.Gnome.Keyring,
keyring.backends.kwallet.Keyring)
except AttributeError:
backends = (keyring.backend.GnomeKeyring,
keyring.backend.KDEKWallet)
if isinstance(keyring.get_keyring(), backends):
return True
return False


Expand Down
1 change: 1 addition & 0 deletions gnome/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import os.path
import stat
import sys
import keyring

if len( os.getenv( 'DISPLAY', '' ) ) == 0:
os.putenv( 'DISPLAY', ':0.0' )
Expand Down
2 changes: 1 addition & 1 deletion gnome/man/C/backintime-gnome.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH backintime-gnome 1 "June 2013" "version 1.0.27" "USER COMMANDS"
.TH backintime-gnome 1 "Oct 2013" "version 1.0.27" "USER COMMANDS"
.SH NAME
backintime-gnome \- a simple backup tool for Gnome.
.SH SYNOPSIS
Expand Down
7 changes: 1 addition & 6 deletions gnome/settingsdialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import datetime
import gettext
import subprocess
import keyring

import config
import messagebox
Expand Down Expand Up @@ -190,11 +189,7 @@ def __init__( self, config, snapshots, parent ):
self.cb_password_save = get('cb_password_save')
self.cb_password_use_cache = get('cb_password_use_cache')

backend = self.config.get_keyring_backend()
if len(backend) <= 0:
backend = 'gnomekeyring'
self.config.set_keyring_backend(backend)
self.keyring_supported = tools.set_keyring(backend)
self.keyring_supported = tools.keyring_supported()
self.cb_password_save.set_sensitive(self.keyring_supported)

#automatic backup mode store
Expand Down
2 changes: 1 addition & 1 deletion kde4/man/C/backintime-kde4.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH backintime-kde4 1 "June 2013" "version 1.0.27" "USER COMMANDS"
.TH backintime-kde4 1 "Oct 2013" "version 1.0.27" "USER COMMANDS"
.SH NAME
backintime-kde4 \- a simple backup tool for KDE4.
.SH SYNOPSIS
Expand Down
7 changes: 1 addition & 6 deletions kde4/settingsdialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import gettext
import copy
import subprocess
import keyring

from PyQt4.QtGui import *
from PyQt4.QtCore import *
Expand Down Expand Up @@ -253,11 +252,7 @@ def __init__( self, parent ):
self.cb_password_use_cache = QCheckBox( QString.fromUtf8( _( 'Cache Password for Cron (Security issue: root can read password)' ) ), self )
vlayout.addWidget( self.cb_password_use_cache )

backend = self.config.get_keyring_backend()
if len(backend) <= 0:
backend = 'kwallet'
self.config.set_keyring_backend(backend)
self.keyring_supported = tools.set_keyring(backend)
self.keyring_supported = tools.keyring_supported()
self.cb_password_save.setEnabled(self.keyring_supported)

#mode change
Expand Down

0 comments on commit 78ffd4d

Please sign in to comment.