Create data dir on demand
This commit is contained in:
parent
4585b2798a
commit
5f568a0379
|
@ -7,6 +7,7 @@ import time
|
||||||
import sys
|
import sys
|
||||||
from socket import SHUT_RDWR
|
from socket import SHUT_RDWR
|
||||||
from core.rpc import BotRPC
|
from core.rpc import BotRPC
|
||||||
|
import os.path
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from cStringIO import StringIO
|
from cStringIO import StringIO
|
||||||
|
@ -374,6 +375,8 @@ class PyIRCBot(asynchat.async_chat):
|
||||||
|
|
||||||
" Filesystem Methods "
|
" Filesystem Methods "
|
||||||
def getDataPath(self, moduleName):
|
def getDataPath(self, moduleName):
|
||||||
|
if not os.path.exists("%s/data/%s" % (self.botconfig["bot"]["datadir"], moduleName)):
|
||||||
|
os.mkdir("%s/data/%s/" % (self.botconfig["bot"]["datadir"], moduleName))
|
||||||
return "%s/data/%s/" % (self.botconfig["bot"]["datadir"], moduleName)
|
return "%s/data/%s/" % (self.botconfig["bot"]["datadir"], moduleName)
|
||||||
|
|
||||||
def getConfigPath(self, moduleName):
|
def getConfigPath(self, moduleName):
|
||||||
|
|
Loading…
Reference in New Issue