예제 #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)
예제 #2
0
def gethostname(space):
    """gethostname() -> string

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

    Return the current host name.
    """
    try:
        res = rsocket.gethostname()
    except SocketError, e:
        raise converted_error(space, e)
예제 #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)
예제 #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))
예제 #6
0
def gethostname(space):
    """ Gets the host name"""
    n = rsocket.gethostname()
    return space.newstr(n)
예제 #7
0
def get_hostname(vm):
    _, _ = vm.decode_args()

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

    return Con_String(vm, rsocket.gethostname())