Created
June 8, 2011 06:46
-
-
Save mikale/1013912 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def main(): | |
| try: | |
| opts, args = getopt.getopt(sys.argv[1:], "ht:", ["help" ]) | |
| except getopt.GetoptError, err: | |
| raise UseError() | |
| if not len(args): | |
| raise UseError() | |
| try: | |
| pathtype = int(opts["-t"]) | |
| if pathtye not in (1,2,3): | |
| raise Usererror('is not 1,2,3') | |
| excpet KeyError,err: | |
| raise UseError() | |
| for path in args: | |
| process_path(path,pathtype) | |
| if __name__ == "__main__": | |
| try: | |
| main() | |
| excpet UserError,err | |
| pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment