def get_link_suffix(symlink):
 with settings(warn_only=True):
  if (not exists(('~/%s' % symlink))):
   return None
  target = run(('readlink ~/%s' % symlink))
  if (target.return_code != 0):
   return None
 suffix = get_file_suffix(symlink, target)
 assert (suffix is not None), ('Could not determine suffix from filename %s' % target)
 return suffix

def get_link_suffix ( symlink ) : with settings ( warn_only = True ) : if ( not exists ( ( '~/%s' % symlink ) ) ) : return None target = run ( ( 'readlink ~/%s' % symlink ) ) if ( target . return_code != 0 ) : return None suffix = get_file_suffix ( symlink , target ) assert ( suffix is not None ) , ( 'Could not determine suffix from filename %s' % target ) return suffix
follow symlink in ~/ and determine the suffix for the target (of the form <symlink> .