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