(s)
| 117 | else: return 0.0 |
| 118 | |
| 119 | def validate_string(s): |
| 120 | try: |
| 121 | s.encode('ascii') |
| 122 | except (KeyboardInterrupt, SystemExit): |
| 123 | raise |
| 124 | except Exception: |
| 125 | return False |
| 126 | else: |
| 127 | return True |
| 128 | |
| 129 | # Connect to database and set up cursor |
| 130 | db = sqlite3.connect(os.path.expanduser(options.database)) |