Save data to user dir
This commit is contained in:
1 parent
138845ca9e
commit
36ed61f549
8 files changed
+37
-15
No files matched your search
@@ -69,7 +69,7 @@ config = [{
|
||||
{
|
||||
'name': 'data_dir',
|
||||
'type': 'directory',
|
||||
'description': 'Where cache/logs/etc are stored. Keep empty for <strong>./_data</strong>.',
|
||||
'description': 'Where cache/logs/etc are stored. Keep empty for defaults.',
|
||||
},
|
||||
{
|
||||
'name': 'url_base',
|
||||
|
||||
@@ -45,7 +45,7 @@ class Core(Plugin):
|
||||
|
||||
if brk: break
|
||||
|
||||
time.sleep(1)
|
||||
time.sleep(300)
|
||||
|
||||
if restart:
|
||||
self.createFile(self.restartFilePath(), 'This is the most suckiest way to register if CP is restarted. Ever...')
|
||||
|
||||
@@ -1,7 +1,25 @@
|
||||
import hashlib
|
||||
import os.path
|
||||
import platform
|
||||
import re
|
||||
|
||||
def getDataDir():
|
||||
|
||||
# Windows
|
||||
try:
|
||||
from win32com.shell import shellcon, shell
|
||||
return os.path.join(shell.SHGetFolderPath(0, shellcon.CSIDL_APPDATA, 0, 0), 'CouchPotato')
|
||||
|
||||
except ImportError:
|
||||
dir = os.path.expanduser("~")
|
||||
|
||||
# OSX
|
||||
if 'darwin' in platform.platform().lower():
|
||||
return os.path.join(dir, 'Library', 'Application Support', 'CouchPotato')
|
||||
|
||||
# Linux
|
||||
return os.path.join(dir, '.couchpotato')
|
||||
|
||||
def isDict(object):
|
||||
return isinstance(object, dict)
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ from couchpotato.core.logger import CPLog
|
||||
from couchpotato.environment import Env
|
||||
from flask.helpers import send_from_directory
|
||||
from flask.templating import render_template_string
|
||||
from libs.multipartpost import MultipartPostHandler
|
||||
from multipartpost import MultipartPostHandler
|
||||
from urlparse import urlparse
|
||||
import cookielib
|
||||
import glob
|
||||
|
||||
Reference in new issue
Block a user