Merge lp:~kevinread/timevault/external into lp:~astromme/timevault/timevault-external

Proposed by Kevin Read
Status: Needs review
Proposed branch: lp:~kevinread/timevault/external
Merge into: lp:~astromme/timevault/timevault-external
Diff against target: None lines
To merge this branch: bzr merge lp:~kevinread/timevault/external
Reviewer Review Type Date Requested Status
Andrew Stromme Approve
Review via email: mp+7424@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Kevin Read (kevinread) wrote :

This branch is based of astrommes "timevault-external" branch Rev 44.
I added a HAL listener to the server. It will wait for the DBUS signal "DeviceAdded" and then re-check if our backup drive is present (if it is not present yet). As I do not plan on working on this branch a lot I propose merging it into astrommes excellent work. I hope to do more work on disconnecting from the SQLite DB so we can unmount the database media if it is not in use.

Revision history for this message
Andrew Stromme (astromme) wrote :

Looks good. Sorry, I was out of email contact for most of the summer. Thanks for your work :)

review: Approve

Unmerged revisions

45. By Kevin Read <kread@bling>

Added HAL listener to check for addition of new volumes, so that we can find our backup drive after server start.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/TimeVault/server.py'
2--- src/TimeVault/server.py 2008-05-10 17:44:40 +0000
3+++ src/TimeVault/server.py 2009-06-14 18:01:29 +0000
4@@ -86,6 +86,9 @@
5
6 self.Reload(reloadConfiguration=False)
7 self.SetState(TVS_IDLE, 'Initializing', TVI_UNCONFIGURED)
8+
9+ self.bus = dbus.SystemBus()
10+ self.bus.add_signal_receiver(self.DeviceAdded, 'DeviceAdded', 'org.freedesktop.Hal.Manager', 'org.freedesktop.Hal', '/org/freedesktop/Hal/Manager')
11
12 if Verbosity()>1:
13 gobject.timeout_add(self.cfg.settings['bipTimer'], self.Bip)
14@@ -110,6 +113,12 @@
15 def OrderlyShutdown(self, sig, frame):
16 self.OnServerShutdown()
17 gobject.timeout_add(100, self.Die, sig, frame)
18+
19+ ''' Check if our backup drive was just mounted. '''
20+ def DeviceAdded(self, udi):
21+ if not self.db:
22+ time.sleep(0.3)
23+ self.Reload(reloadConfiguration=False)
24
25 def Reload(self, reloadConfiguration=True):
26 if reloadConfiguration:

Subscribers

People subscribed via source and target branches