def site_data_dir(appname=None, appauthor=None, version=None, multipath=False):
 if (sys.platform == 'win32'):
  if (appauthor is None):
   appauthor = appname
  path = os.path.normpath(_get_win_folder('CSIDL_COMMON_APPDATA'))
  if appname:
   path = os.path.join(path, appauthor, appname)
 elif (sys.platform == 'darwin'):
  path = os.path.expanduser('/Library/Application Support')
  if appname:
   path = os.path.join(path, appname)
 else:
  path = os.getenv('XDG_DATA_DIRS', os.pathsep.join(['/usr/local/share', '/usr/share']))
  pathlist = [os.path.expanduser(x.rstrip(os.sep)) for x in path.split(os.pathsep)]
  if appname:
   if version:
    appname = os.path.join(appname, version)
   pathlist = [os.sep.join([x, appname]) for x in pathlist]
  if multipath:
   path = os.pathsep.join(pathlist)
  else:
   path = pathlist[0]
  return path
 if (appname and version):
  path = os.path.join(path, version)
 return path

def site_data_dir ( appname = None , appauthor = None , version = None , multipath = False ) : if ( sys . platform == 'win32' ) : if ( appauthor is None ) : appauthor = appname path = os . path . normpath ( _get_win_folder ( 'CSIDL_COMMON_APPDATA' ) ) if appname : path = os . path . join ( path , appauthor , appname ) elif ( sys . platform == 'darwin' ) : path = os . path . expanduser ( '/Library/Application Support' ) if appname : path = os . path . join ( path , appname ) else : path = os . getenv ( 'XDG_DATA_DIRS' , os . pathsep . join ( [ '/usr/local/share' , '/usr/share' ] ) ) pathlist = [ os . path . expanduser ( x . rstrip ( os . sep ) ) for x in path . split ( os . pathsep ) ] if appname : if version : appname = os . path . join ( appname , version ) pathlist = [ os . sep . join ( [ x , appname ] ) for x in pathlist ] if multipath : path = os . pathsep . join ( pathlist ) else : path = pathlist [ 0 ] return path if ( appname and version ) : path = os . path . join ( path , version ) return path
return full path to the user-shared data dir for this application .