Here is a patch to fix the reported issues above.
Explanations on the modifications:

=== modified file 'src/nssbackup/util/__init__.py':

* adding new functions to unify checking of expressions (maybe it is
useful for further versions to create somekind of ConfigurationHandler
class to encapsulate reading configuration files, checking of
configuration values and setting of new ones - so this is a bugfix only
for the current release candidate version)


=== modified file 'src/nssbackup/ui/SBConfigGTK.py':

* adding a method for showing a dialogbox containing an errormessage

* the regular expressions from the configuration file were checked
before they are added to any lists; if they are invalid they were
removed and the users gets informed. This fixes issue 4).

* if a regular expression is added to the configuration, the resulting
line gets stripped off leading and trailing ',' to avoid to unwanted
adding of an empty expression

* in method 'on_ex_delregex_clicked': the removal of an expression is
done by the function mentioned above. The last expression didn't had a
leading comma, so it was not removed. This fixes issue 3).

* in method 'cell_regex_edited_callback': it was possible to clear the
expression and therefore an empty expression was stored. The fix now
checks not only for a valid expression but additionally for a not empty
expression. This fixes issue 1).

* while checking regular expression only 're.error' were catched now.


=== modified file 'src/nssbackup/managers/BackupManager.py':

* while reading the configuration it is checked whether the expression
is not empty and valid. If so it is added otherwise output a log
message. This fixes issue 2).


=== modified file 'src/nssbackup/managers/SnapshotManager.py'

* string formatting was errornous. Fixed without changing the content of
translated string. This fixes bug Bug #299964: Exception 'TypeError' is
raised if an error occurs while pulling a snapshot.


** Attachment added: "Fixes regular expressions issues."
   http://launchpadlibrarian.net/19790796/regexp.peer.loz.patch

-- 
Using regular expressions in NSsbackup does not work properly.
https://bugs.launchpad.net/bugs/299967
You received this bug notification because you are a member of NSsbackup
team, which is subscribed to NSsbackup.

_______________________________________________
Mailing list: https://launchpad.net/~nssbackup-team
Post to     : nssbackup-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~nssbackup-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to