Make a filename from the given args
(arg)
| 381 | """Utility method used by magic_edit to find what to edit.""" |
| 382 | |
| 383 | def make_filename(arg): |
| 384 | "Make a filename from the given args" |
| 385 | try: |
| 386 | filename = get_py_filename(arg) |
| 387 | except IOError: |
| 388 | # If it ends with .py but doesn't already exist, assume we want |
| 389 | # a new file. |
| 390 | if arg.endswith('.py'): |
| 391 | filename = arg |
| 392 | else: |
| 393 | filename = None |
| 394 | return filename |
| 395 | |
| 396 | # Set a few locals from the options for convenience: |
| 397 | opts_prev = 'p' in opts |
nothing calls this directly
no test coverage detected