def _insert(node, path, itemid):
 if (len(path) == 1):
  node.files[path[0]] = itemid
 else:
  dirname = path[0]
  rest = path[1:]
  if (dirname not in node.dirs):
   node.dirs[dirname] = Node({}, {})
  _insert(node.dirs[dirname], rest, itemid)

def _insert ( node , path , itemid ) : if ( len ( path ) == 1 ) : node . files [ path [ 0 ] ] = itemid else : dirname = path [ 0 ] rest = path [ 1 : ] if ( dirname not in node . dirs ) : node . dirs [ dirname ] = Node ( { } , { } ) _insert ( node . dirs [ dirname ] , rest , itemid )
insert an item into a virtual filesystem node .