Quote a string, or return a default value if the string is None.
(s, default='undefined')
| 45 | Images = 'images' |
| 46 | |
| 47 | def undefquote(s, default='undefined'): |
| 48 | """Quote a string, or return a default value if the string is None.""" |
| 49 | |
| 50 | if s is not None: |
| 51 | return enquote(s) |
| 52 | else: |
| 53 | return 'undefined' |
| 54 | |
| 55 | if __name__ == '__main__': |
| 56 | parser = argparse.ArgumentParser() |