Пример #1
0
 def __init__(self, sockdir=None, confdir=None):
     from xpra.platform import get_default_socket_dir, get_default_conf_dir
     self._confdir = os.path.expanduser(confdir or get_default_conf_dir())
     self._sockdir = os.path.expanduser(sockdir or get_default_socket_dir())
     if not os.path.exists(self._confdir):
         os.mkdir(self._confdir, o0700)
     if not os.path.exists(self._sockdir):
         os.mkdir(self._sockdir, o0700)
     self._prefix = "%s-" % (socket.gethostname(),)
Пример #2
0
 def __init__(self, sockdir=None, confdir=None):
     from xpra.platform import get_default_socket_dir, get_default_conf_dir
     self._confdir = os.path.expanduser(confdir or get_default_conf_dir())
     self._sockdir = os.path.expanduser(sockdir or get_default_socket_dir())
     if not os.path.exists(self._confdir):
         os.mkdir(self._confdir, o0700)
     if not os.path.exists(self._sockdir):
         os.mkdir(self._sockdir, o0700)
     self._prefix = "%s-" % (socket.gethostname(), )
Пример #3
0
def read_xpra_defaults():
    """
        Reads the global "xpra.conf" and then the user-specific one.
        (the latter overrides values from the former)
        returns a dict with values as strings and arrays of strings.
    """
    #first, read the global defaults:
    if sys.platform.startswith("win"):
        conf_dir = os.path.dirname(sys.executable)
    elif sys.prefix == '/usr':
        conf_dir = '/etc/xpra'
    else:
        conf_dir = sys.prefix + '/etc/xpra/'
    defaults = read_xpra_conf(conf_dir)
    #now load the per-user config over it:
    from xpra.platform import get_default_conf_dir
    user_defaults = read_xpra_conf(get_default_conf_dir())
    for k,v in user_defaults.items():
        defaults[k] = v
    return defaults
Пример #4
0
def read_xpra_defaults():
    """
        Reads the global "xpra.conf" and then the user-specific one.
        (the latter overrides values from the former)
        returns a dict with values as strings and arrays of strings.
    """
    #first, read the global defaults:
    if sys.platform.startswith("win"):
        conf_dir = os.path.dirname(sys.executable)
    elif sys.prefix == '/usr':
        conf_dir = '/etc/xpra'
    else:
        conf_dir = sys.prefix + '/etc/xpra/'
    defaults = read_xpra_conf(conf_dir)
    #now load the per-user config over it:
    from xpra.platform import get_default_conf_dir
    user_defaults = read_xpra_conf(get_default_conf_dir())
    for k, v in user_defaults.items():
        defaults[k] = v
    return defaults