~didrocks/ubuntuone-client/use_result_var

« back to all changes in this revision

Viewing changes to ubuntuone/eventlog/zg_listener.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:
56
56
        self.newly_created_server_files = set()
57
57
        self.newly_created_local_files = set()
58
58
 
59
 
    def handle_AQ_CREATE_SHARE_OK(self, share_id=None, marker=None):
 
59
    def handle_AQ_CREATE_SHARE_OK(self, share_id, marker):
60
60
        """Log the 'directory shared thru the server' event."""
61
61
        share = self.vm.shared[share_id]
62
62
        self.log_folder_shared(share, share_id)
371
371
 
372
372
        self.zg.log(event)
373
373
 
374
 
    def handle_SV_FILE_DELETED(self, volume_id, node_id, is_dir):
 
374
    def handle_SV_FILE_DELETED(self, volume_id, node_id, was_dir, old_path):
375
375
        """A file or folder was deleted locally by Syncdaemon."""
376
 
        mdo = self.fsm.get_by_node_id(volume_id, node_id)
377
 
        path = self.fsm.get_abspath(volume_id, mdo.path)
378
 
 
379
 
        if is_dir:
 
376
        if was_dir:
380
377
            mime, interp = DIRECTORY_MIMETYPE, Interpretation.FOLDER
381
378
        else:
382
 
            mime, interp = self.get_mime_and_interpretation_for_filepath(path)
 
379
            mime, interp = self.get_mime_and_interpretation_for_filepath(
 
380
                                                                    old_path)
383
381
 
384
382
        file_subject = Subject.new_for_values(
385
 
            uri="file:///" + path,
 
383
            uri="file:///" + old_path,
386
384
            interpretation=interp,
387
385
            manifestation=Manifestation.DELETED_RESOURCE,
388
386
            origin=URI_PROTOCOL_U1 + str(node_id),
398
396
        self.zg.log(event)
399
397
 
400
398
    def handle_AQ_UNLINK_OK(self, share_id, parent_id, node_id,
401
 
                            new_generation):
 
399
                            new_generation, was_dir, old_path):
402
400
        """A file or folder was deleted on the server by Syncdaemon,"""
403
 
        mdo = self.fsm.get_by_node_id(share_id, node_id)
404
 
        path = self.fsm.get_abspath(share_id, mdo.path)
405
 
 
406
 
        if mdo.is_dir:
 
401
        if was_dir:
407
402
            mime, interp = DIRECTORY_MIMETYPE, Interpretation.FOLDER
408
403
        else:
409
 
            mime, interp = self.get_mime_and_interpretation_for_filepath(path)
 
404
            mime, interp = self.get_mime_and_interpretation_for_filepath(
 
405
                                                                    old_path)
410
406
 
411
407
        file_subject = Subject.new_for_values(
412
408
            uri=URI_PROTOCOL_U1 + str(node_id),
413
409
            interpretation=interp,
414
410
            manifestation=Manifestation.DELETED_RESOURCE,
415
 
            origin="file:///" + path,
 
411
            origin="file:///" + old_path,
416
412
            mimetype=mime,
417
413
            storage=STORAGE_DELETED)
418
414