def maybe_shorten_name(powerline, name):
 if powerline.args.cwd_max_dir_size:
  return name[:powerline.args.cwd_max_dir_size]
 return name

def maybe_shorten_name ( powerline , name ) : if powerline . args . cwd_max_dir_size : return name [ : powerline . args . cwd_max_dir_size ] return name
if the user has asked for each directory name to be shortened .