От ОС зависит располодение папки с рабочими файлами
This commit is contained in:
parent
0e13795c4b
commit
84c821cc77
|
@ -1,9 +1,14 @@
|
||||||
import os
|
import os
|
||||||
from peewee import Model, CharField, DateTimeField, TextField, ForeignKeyField, DateField, fn
|
from peewee import Model, CharField, DateTimeField, TextField, ForeignKeyField, DateField, fn
|
||||||
from playhouse.sqlite_ext import CSqliteExtDatabase, FTS5Model, AutoIncrementField, SearchField, RowIDField, JSONField
|
from playhouse.sqlite_ext import CSqliteExtDatabase, FTS5Model, AutoIncrementField, SearchField, RowIDField, JSONField
|
||||||
import re
|
import platform
|
||||||
|
|
||||||
var_dir = os.path.join(os.path.abspath(os.environ['HOME']), '.eldoc')
|
if 'windows' in platform.system().lower():
|
||||||
|
user_dir = os.path.abspath(os.environ['APPDATA'])
|
||||||
|
else:
|
||||||
|
user_dir = os.path.abspath(os.environ['HOME'])
|
||||||
|
|
||||||
|
var_dir = os.path.join(user_dir, '.eldoc')
|
||||||
db_dir = os.path.join(var_dir, 'db')
|
db_dir = os.path.join(var_dir, 'db')
|
||||||
db_file = os.path.join(db_dir, 'eldoc.sqlite3')
|
db_file = os.path.join(db_dir, 'eldoc.sqlite3')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue