Make a filename from the given args
(arg)
| 409 | """Utility method used by magic_edit to find what to edit.""" |
| 410 | |
| 411 | def make_filename(arg): |
| 412 | "Make a filename from the given args" |
| 413 | try: |
| 414 | filename = get_py_filename(arg) |
| 415 | except IOError: |
| 416 | # If it ends with .py but doesn't already exist, assume we want |
| 417 | # a new file. |
| 418 | if arg.endswith('.py'): |
| 419 | filename = arg |
| 420 | else: |
| 421 | filename = None |
| 422 | return filename |
| 423 | |
| 424 | # Set a few locals from the options for convenience: |
| 425 | opts_prev = 'p' in opts |
nothing calls this directly
no test coverage detected