~nataliabidart/ubuntuone-client/login-email-password-for-everyone

« back to all changes in this revision

Viewing changes to ubuntuone/syncdaemon/action_queue.py

  • Committer: Tarmac
  • Author(s): Natalia B. Bidart
  • Date: 2011-08-11 21:54:06 UTC
  • mfrom: (1100.3.5 no-makedirs)
  • Revision ID: tarmac-20110811215406-xtcs6ksbs365cdqu
- No more calls to os.makedirs, os.mkdir, os.stat, os.listdir, open(), os.unlink
  (LP: #824095).

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
 
51
51
from oauth import oauth
52
52
from ubuntuone import clientdefs
53
 
from ubuntuone.platform import open_file, platform
 
53
from ubuntuone.platform import open_file, platform, remove_file
54
54
from ubuntuone.storageprotocol import protocol_pb2, content_hash
55
55
from ubuntuone.storageprotocol import errors as protocol_errors
56
56
from ubuntuone.storageprotocol.client import (
2548
2548
        """It worked! Push the event."""
2549
2549
        # remove the temporary file if have one
2550
2550
        if getattr(self.tempfile, 'name', None) is not None:
2551
 
            os.unlink(self.tempfile.name)
 
2551
            remove_file(self.tempfile.name)
2552
2552
 
2553
2553
        # send the event
2554
2554
        d = dict(share_id=self.share_id, node_id=self.node_id, hash=self.hash,
2566
2566
    def handle_failure(self, failure):
2567
2567
        """It didn't work! Push the event."""
2568
2568
        if getattr(self.tempfile, 'name', None) is not None:
2569
 
            os.unlink(self.tempfile.name)
 
2569
            remove_file(self.tempfile.name)
2570
2570
 
2571
2571
        self.action_queue.event_queue.push('AQ_UPLOAD_ERROR',
2572
2572
                                           error=failure.getErrorMessage(),