(filename)
| 1746 | |
| 1747 | # 根据文件名自动判断数据库类型并打开 |
| 1748 | def open_dict(filename): |
| 1749 | if isinstance(filename, dict): |
| 1750 | return DictMySQL(filename) |
| 1751 | if filename[:8] == 'mysql://': |
| 1752 | return DictMySQL(filename) |
| 1753 | if os.path.splitext(filename)[-1].lower() in ('.csv', '.txt'): |
| 1754 | return DictCsv(filename) |
| 1755 | return StarDict(filename) |
| 1756 | |
| 1757 | |
| 1758 | # 字典转化,csv sqlite之间互转 |
no test coverage detected