Exemplo n.º 1
0
def add_hostname_segment(powerline):
    if powerline.args.shell == 'bash':
        host_prompt = ' \\h '
    elif powerline.args.shell == 'zsh':
        host_prompt = ' %m '
    else:
        host_prompt = ' ' + gethostname().split('.')[0] + ' '

    powerline.append(host_prompt, Color.HOSTNAME_FG, Color.HOSTNAME_BG)
Exemplo n.º 2
0
def gethostname(space):
    """gethostname() -> string

    Return the current host name.
    """
    try:
        res = rsocket.gethostname()
    except SocketError, e:
        raise converted_error(space, e)
Exemplo n.º 3
0
def gethostname(space):
    """gethostname() -> string

    Return the current host name.
    """
    try:
        res = rsocket.gethostname()
    except SocketError, e:
        raise converted_error(space, e)
Exemplo n.º 4
0
def add_hostname_segment(powerline):
  if powerline.args.shell == 'bash':
    host_prompt = ' \\h '
  elif powerline.args.shell == 'zsh':
    host_prompt = ' %m '
  else:
    host_prompt = ' ' + gethostname().split('.')[0] + ' '

  powerline.append(host_prompt, Color.HOSTNAME_FG, Color.HOSTNAME_BG)
Exemplo n.º 5
0
def gethostname(space):
    """gethostname() -> string

    Return the current host name.
    """
    try:
        res = rsocket.gethostname()
    except SocketError as e:
        raise converted_error(space, e)
    return space.fsdecode(space.newbytes(res))
Exemplo n.º 6
0
def gethostname(space):
    """ Gets the host name"""
    n = rsocket.gethostname()
    return space.newstr(n)
Exemplo n.º 7
0
def get_hostname(vm):
    _, _ = vm.decode_args()

    return Con_String(vm, rsocket.gethostname())
Exemplo n.º 8
0
def gethostname(space):
    """ Gets the host name"""
    n = rsocket.gethostname()
    return space.newstr(n)
Exemplo n.º 9
0
def get_hostname(vm):
    _,_ = vm.decode_args()

    return Con_String(vm, rsocket.gethostname())