def symlink(path, v=False):
 if (not os.path.exists(path)):
  err((path + u' : no such file or directory'))
 elif (not os.path.isdir(path)):
  err((path + u' : not a directory'))
 else:
  theme_name = os.path.basename(os.path.normpath(path))
  theme_path = os.path.join(_THEMES_PATH, theme_name)
  if os.path.exists(theme_path):
   err((path + u' : already exists'))
  else:
   if v:
    print(u"Linking `{p}' to `{t}' ...".format(p=path, t=theme_path))
   try:
    os.symlink(path, theme_path)
   except Exception as e:
    err(u"Cannot link `{p}' to `{t}':\n{e}".format(p=path, t=theme_path, e=str(e)))

def symlink ( path , v = False ) : if ( not os . path . exists ( path ) ) : err ( ( path + u' : no such file or directory' ) ) elif ( not os . path . isdir ( path ) ) : err ( ( path + u' : not a directory' ) ) else : theme_name = os . path . basename ( os . path . normpath ( path ) ) theme_path = os . path . join ( _THEMES_PATH , theme_name ) if os . path . exists ( theme_path ) : err ( ( path + u' : already exists' ) ) else : if v : print ( u"Linking `{p}' to `{t}' ..." . format ( p = path , t = theme_path ) ) try : os . symlink ( path , theme_path ) except Exception as e : err ( u"Cannot link `{p}' to `{t}':\n{e}" . format ( p = path , t = theme_path , e = str ( e ) ) )
create a symbolic link to a file cli example: .