~rmcbride/ubuntu/lucid/ubuntuone-client/fixucg

« back to all changes in this revision

Viewing changes to ubuntuone/syncdaemon/local_rescan.py

  • Committer: Bazaar Package Importer
  • Author(s): Rodney Dawes
  • Date: 2009-07-16 17:00:00 UTC
  • mto: (17.1.1 ubuntuone-client)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20090716170000-tnnk149g57bxxo24
Tags: upstream-0.90.4
ImportĀ upstreamĀ versionĀ 0.90.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
116
116
        scan_info = self._queue.pop()
117
117
 
118
118
        def safe_scan():
 
119
            '''Scan safely'''
119
120
            try:
120
121
                self._scan_tree(*scan_info)
 
122
            # pylint: disable-msg=W0703
121
123
            except Exception, e:
122
124
                self._previous_deferred.errback(e)
123
125
 
136
138
        '''Scans a whole tree, using the received path as root.'''
137
139
        log_debug("_scan_tree:  share_path: %r  path: %r", share_path, path)
138
140
 
139
 
        def get_start_info():
140
 
            '''Gathers the info to start.'''
141
 
            # start the process
142
 
            return (all_share_dirs, share_path)
143
 
 
144
141
        def go_deeper(newdirs):
145
142
            '''Explore into the subdirs.'''
146
143
            for direct in newdirs:
188
185
            # if asked, remove metadata por children
189
186
            if also_children:
190
187
                log_debug("Removing also metadata from %r children", fullname)
 
188
                # pylint: disable-msg=W0612
191
189
                for path, is_dir in self.fsm.get_paths_starting_with(fullname):
192
190
                    self.fsm.delete_metadata(path)
193
191
 
252
250
                    # it's there, but it's a directory!
253
251
                    events.append(('FS_DIR_DELETE', fullname))
254
252
                    events.append(('FS_FILE_CREATE', fullname))
 
253
                    events.append(('FS_FILE_CLOSE_WRITE', fullname))
255
254
                else:
256
255
                    if changed == "LOCAL":
257
256
                        # upload interrupted
309
308
                    log_debug("comp yield: file %r is new!", fullname)
310
309
                    events.append(('FS_FILE_CREATE', fullname))
311
310
 
312
 
                    # if it's not empty, tell to hash it and uplod
313
 
                    if os.path.getsize(fullname):
314
 
                        events.append(('FS_FILE_CLOSE_WRITE', fullname))
 
311
                    # even if it's empty, we signal to get the hash
 
312
                    # otherwise it will never get "empty" to the server
 
313
                    events.append(('FS_FILE_CLOSE_WRITE', fullname))
315
314
 
316
315
 
317
316
        # all these don't exist anymore