Skip to content

Commit

Permalink
[ide] Code inspection.
Browse files Browse the repository at this point in the history
Signed-off-by: Xiangyu Bu <[email protected]>
  • Loading branch information
xybu committed Jan 13, 2017
1 parent 4c50ec7 commit 82b653a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
8 changes: 8 additions & 0 deletions .idea/dictionaries/xb.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion onedrived/od_pref.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,9 @@ def set_drive(drive_id=None, email=None, local_root=None, ignore_file=None):
if ignore_file is None or not os.path.isfile(ignore_file):
click.echo(click.style('Warning: ignore file path does not point to a file. Use default.', fg='yellow'))
ignore_file = context.config_dir + '/' + context.DEFAULT_IGNORE_FILENAME
if drive_exists and local_root == curr_drive_config.localroot_path and ignore_file == curr_drive_config.ignorefile_path:
if (drive_exists and
local_root == curr_drive_config.localroot_path and
ignore_file == curr_drive_config.ignorefile_path):
click.echo(click.style('No parameter was changed. Skipped operation.', fg='yellow'))
return
except ValueError as e:
Expand Down
3 changes: 2 additions & 1 deletion onedrived/od_watcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ def _handle_move_pair(self, move_pair, to_repo, from_repo=None):

self._handle_unpaired_move_to(to_ev, to_flags, to_repo, to_parent_dir, to_parent_relpath)

def _get_remote_item(self, repo, relpath):
@staticmethod
def _get_remote_item(repo, relpath):
item_request = repo.authenticator.client.item(drive=repo.drive.id, path=relpath)
try:
return item_request, item_request_call(repo, item_request.get)
Expand Down
4 changes: 2 additions & 2 deletions onedrived/tasks/merge_dir.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@


class MergeDirectoryTask(_TaskBase):

def __init__(self, repo, task_pool, rel_path, item_request):
"""
:param onedrived.od_repo.OneDriveLocalRepository repo:
Expand Down Expand Up @@ -163,7 +162,8 @@ def get_local_sha1_hash():
return local_sha1_hash

if (remote_item.id == item_record.item_id and remote_item.c_tag == item_record.c_tag or
remote_item.size == item_record.size and diff_timestamps(remote_mtime_ts, record_mtime_ts) == 0):
remote_item.size == item_record.size and
diff_timestamps(remote_mtime_ts, record_mtime_ts) == 0):
# The remote item metadata matches the database record. So this item has been synced before.
if item_stat is None:
# The local file was synced but now is gone. Delete remote one as well.
Expand Down
1 change: 0 additions & 1 deletion onedrived/tasks/update_mtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ def __init__(self, repo, task_pool, parent_relpath, item_name):
"""
:param onedrived.od_repo.OneDriveLocalRepository repo:
:param onedrived.od_task.TaskPool task_pool:
:param onedrivesdk.request.item_request_builder.ItemRequestBuilder parent_dir_request:
:param str parent_relpath:
:param str item_name:
"""
Expand Down

0 comments on commit 82b653a

Please sign in to comment.