~time-drive-devel/time-drive/time-drive.sync

« back to all changes in this revision

Viewing changes to sync/syncaction.py

  • Committer: Rob Oakes
  • Date: 2012-11-13 19:28:27 UTC
  • Revision ID: rob.oakes@oak-tree.us-20121113192827-yi0aetd3jb288f0r
Initial version of upload queue and error library. Real-time sync client can detect when it is offline and has rudimentary support for determining why the remote server (owncloud only) may be rejecting authentication requests.

To-do:
- Implement the processing of downloads
- Implement file renames, deletes
- Implement a better method for uploading a file when it is locked by a program
- Implement sync algorithm that is driven by folders rather than individual files

Show diffs side-by-side

added added

removed removed

Lines of Context:
151
151
        return False, None
152
152
 
153
153
 
154
 
def uploadNewFile(file_localpath, file_url, file_dates, file_md5, db_session, sync_backend):
 
154
def uploadNewFile(file_localpath, file_url, file_dates, 
 
155
                file_md5, db_session, sync_backend):
155
156
        '''Routine used for uploading a new file from the local disk to the server
156
157
                and logging it in the database.'''
157
158
        
165
166
 
166
167
        # Upload the file to the server
167
168
        r_ = syncfile_.uploadFile(file_url, sync_backend)
168
 
        print r_
169
169
 
170
170
        # Add to the database and save
171
171
        db_session.add(syncfile_)
175
175
 
176
176
 
177
177
def uploadUpdatedFile(dbfile_, file_url, file_dates, file_md5, 
178
 
                db_session, sync_backend):
 
178
                db_session, sync_backend, remote_missing=False):
179
179
        '''Routine used for uploading an updated version of the file to the remote server'''
180
180
 
181
181
        # Upload file to server