~didrocks/ubuntuone-client/use_result_var

« back to all changes in this revision

Viewing changes to ubuntuone/syncdaemon/action_queue.py

  • Committer: Bazaar Package Importer
  • Author(s): Rodney Dawes
  • Date: 2011-03-18 15:32:09 UTC
  • mfrom: (1.1.47 upstream)
  • Revision ID: james.westby@ubuntu.com-20110318153209-eiao2x342xppviid
Tags: 1.5.7-0ubuntu1
* New upstream release.
  - Connection notifications are pointless (LP: #734895)
  - Use a single platform Notification instance (LP: #734985)
* 01_reset-udf-typeerror.patch:
  - Removed patch which is now included upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1003
1003
        return Move(self.queue, share_id, node_id, old_parent_id,
1004
1004
                    new_parent_id, new_name, path_from, path_to).go()
1005
1005
 
1006
 
    def unlink(self, share_id, parent_id, node_id, path):
 
1006
    def unlink(self, share_id, parent_id, node_id, path, is_dir):
1007
1007
        """See .interfaces.IMetaQueue."""
1008
 
        return Unlink(self.queue, share_id, parent_id, node_id, path).go()
 
1008
        return Unlink(self.queue, share_id, parent_id, node_id, path,
 
1009
                      is_dir).go()
1009
1010
 
1010
1011
    def inquire_free_space(self, share_id):
1011
1012
        """See .interfaces.IMetaQueue."""
1509
1510
 
1510
1511
class Unlink(ActionQueueCommand):
1511
1512
    """Unlink a file or dir."""
1512
 
    __slots__ = ('share_id', 'node_id', 'parent_id', 'path')
 
1513
    __slots__ = ('share_id', 'node_id', 'parent_id', 'path', 'is_dir')
1513
1514
    logged_attrs = ActionQueueCommand.logged_attrs + __slots__
1514
1515
    possible_markers = 'node_id', 'parent_id'
1515
1516
 
1516
 
    def __init__(self, request_queue, share_id, parent_id, node_id, path):
 
1517
    def __init__(self, request_queue, share_id, parent_id, node_id, path,
 
1518
                 is_dir):
1517
1519
        super(Unlink, self).__init__(request_queue)
1518
1520
        self.share_id = share_id
1519
1521
        self.node_id = node_id
1520
1522
        self.parent_id = parent_id
1521
1523
        self.path = path
 
1524
        self.is_dir = is_dir
1522
1525
 
1523
1526
    def _run(self):
1524
1527
        """Do the actual running."""
1527
1530
    def handle_success(self, request):
1528
1531
        """It worked! Push the event."""
1529
1532
        d = dict(share_id=self.share_id, parent_id=self.parent_id,
1530
 
                 node_id=self.node_id, new_generation=request.new_generation)
 
1533
                 node_id=self.node_id, new_generation=request.new_generation,
 
1534
                 was_dir=self.is_dir, old_path=self.path)
1531
1535
        self.action_queue.event_queue.push('AQ_UNLINK_OK', **d)
1532
1536
 
1533
1537
    def handle_failure(self, failure):
2422
2426
        self.log.debug("got upload_id from server: %s", upload_id)
2423
2427
        self.action_queue.main.fs.set_by_node_id(
2424
2428
            self.node_id, self.share_id, upload_id=upload_id)
 
2429
        self.upload_id = upload_id
2425
2430
 
2426
2431
    def progress_hook(self):
2427
2432
        """Send event if accumulated enough progress."""