def same_file(a, b):
 a = os.path.normpath(os.path.abspath(a))
 b = os.path.normpath(os.path.abspath(b))
 if (sabnzbd.WIN32 or sabnzbd.DARWIN):
  a = a.lower()
  b = b.lower()
 if b.startswith(a):
  return 2
 if ('samefile' in os.path.__dict__):
  try:
   return int(os.path.samefile(a, b))
  except:
   return 0
 else:
  return int((a == b))

def same_file ( a , b ) : a = os . path . normpath ( os . path . abspath ( a ) ) b = os . path . normpath ( os . path . abspath ( b ) ) if ( sabnzbd . WIN32 or sabnzbd . DARWIN ) : a = a . lower ( ) b = b . lower ( ) if b . startswith ( a ) : return 2 if ( 'samefile' in os . path . __dict__ ) : try : return int ( os . path . samefile ( a , b ) ) except : return 0 else : return int ( ( a == b ) )
return 0 if a and b have nothing in common return 1 if a and b are actually the same path return 2 if b is a subfolder of a .