Dispatches a string command to a method.
(self, args)
| 22 | """This class emulates the 'flock' command.""" |
| 23 | |
| 24 | def Dispatch(self, args): |
| 25 | """Dispatches a string command to a method.""" |
| 26 | if len(args) < 1: |
| 27 | raise Exception("Not enough arguments") |
| 28 | |
| 29 | method = "Exec%s" % self._CommandifyName(args[0]) |
| 30 | getattr(self, method)(*args[1:]) |
| 31 | |
| 32 | def _CommandifyName(self, name_string): |
| 33 | """Transforms a tool name like copy-info-plist to CopyInfoPlist""" |