
from s3backup.clients import compare, LocalSyncClient


def sync():
    local_client = LocalSyncClient('/home/michael/Notebooks')
    current = local_client.get_current_state()
    index = local_client.get_index_state()
    print(list(compare(current, index)))
    local_client.update_index()


import os

from s3backup.clients import compare, LocalSyncClient


def sync():
    target_folder = os.path.expanduser('~/Notebooks')

    local_client = LocalSyncClient(target_folder)
    current = local_client.get_current_state()
    index = local_client.get_index_state()
    print(list(compare(current, index)))
    local_client.update_index()

Use expanduser to prevent hardcoding username
Use expanduser to prevent hardcoding username

+ 
+ import os
  
  from s3backup.clients import compare, LocalSyncClient
  
  
  def sync():
-     local_client = LocalSyncClient('/home/michael/Notebooks')
+     target_folder = os.path.expanduser('~/Notebooks')
+ 
+     local_client = LocalSyncClient(target_folder)
      current = local_client.get_current_state()
      index = local_client.get_index_state()
      print(list(compare(current, index)))
      local_client.update_index()
  
Use expanduser to prevent hardcoding username
## Code Before:

from s3backup.clients import compare, LocalSyncClient


def sync():
    local_client = LocalSyncClient('/home/michael/Notebooks')
    current = local_client.get_current_state()
    index = local_client.get_index_state()
    print(list(compare(current, index)))
    local_client.update_index()

## Instruction:
Use expanduser to prevent hardcoding username
## Code After:

import os

from s3backup.clients import compare, LocalSyncClient


def sync():
    target_folder = os.path.expanduser('~/Notebooks')

    local_client = LocalSyncClient(target_folder)
    current = local_client.get_current_state()
    index = local_client.get_index_state()
    print(list(compare(current, index)))
    local_client.update_index()
