code: def mainloop(self):
          
          # Print usage if not enough args or bad options
          if len(self.args) < 1:
              self.parser.error("You have to provide the root directory of your watch tree, or a metafile path!")
  
          configuration.engine.load_config()
  
          pathname = os.path.abspath(self.args[0])
          if os.path.isdir(pathname):
              watch = TreeWatch(Bunch(path=pathname, job_name="watch", active=True, dry_run=True, load_mode=None))
              asyncore.loop(timeout=~0, use_poll=True)
          else:
              config = Bunch()
              config.update(dict((key.split('.', 2)[-1], val)
                  for key, val in configuration.torque.items()
                  if key.startswith("job.treewatch.")
              ))
              config.update(dict(path=os.path.dirname(os.path.dirname(pathname)), job_name="treewatch", active=False, dry_run=True))
              watch = TreeWatch(config)
              handler = MetafileHandler(watch, pathname)
  
              ok = handler.parse()
              self.LOG.debug("Metafile '%s' would've %sbeen loaded" % (pathname, "" if ok else "NOT "))
  
              if ok:
                  handler.addinfo()
                  post_process = str if self.options.verbose else logutil.shorten
                  self.LOG.info("Templating values are:\n    %s" % "\n    ".join("%s=%s" % (key, post_process(repr(val)))
                      for key, val in sorted(handler.ns.items())
                  ))
docs: The main loop.