movestuff
This commit is contained in:
parent
07af40215b
commit
f1a34e3fcd
35 changed files with 22 additions and 18 deletions
8
.gitignore
vendored
8
.gitignore
vendored
|
@ -1,4 +1,4 @@
|
||||||
data
|
persist
|
||||||
config.json
|
config.json
|
||||||
gitflow
|
gitflow
|
||||||
*.db
|
*.db
|
||||||
|
@ -11,4 +11,8 @@ gitflow
|
||||||
*.sublime-project
|
*.sublime-project
|
||||||
*.sublime-workspace
|
*.sublime-workspace
|
||||||
.idea/
|
.idea/
|
||||||
plugins/data/GeoLiteCity.dat
|
data/GeoLiteCity.dat
|
||||||
|
plugins/New Text Document.txt
|
||||||
|
plugins/srvv.py
|
||||||
|
run.cmd
|
||||||
|
config
|
||||||
|
|
|
@ -87,7 +87,7 @@ class Bot(object):
|
||||||
self.logger.debug("Logging engine started.")
|
self.logger.debug("Logging engine started.")
|
||||||
|
|
||||||
# data folder
|
# data folder
|
||||||
self.data_dir = os.path.abspath('data')
|
self.data_dir = os.path.abspath('persist')
|
||||||
if not os.path.exists(self.data_dir):
|
if not os.path.exists(self.data_dir):
|
||||||
self.logger.debug("Data folder not found, creating.")
|
self.logger.debug("Data folder not found, creating.")
|
||||||
os.mkdir(self.data_dir)
|
os.mkdir(self.data_dir)
|
||||||
|
|
0
plugins/data/flirts.txt → data/flirts.txt
Executable file → Normal file
0
plugins/data/flirts.txt → data/flirts.txt
Executable file → Normal file
0
plugins/data/fortunes.txt → data/fortunes.txt
Executable file → Normal file
0
plugins/data/fortunes.txt → data/fortunes.txt
Executable file → Normal file
0
plugins/data/insults.txt → data/insults.txt
Executable file → Normal file
0
plugins/data/insults.txt → data/insults.txt
Executable file → Normal file
0
plugins/data/itemids.txt → data/itemids.txt
Executable file → Normal file
0
plugins/data/itemids.txt → data/itemids.txt
Executable file → Normal file
0
plugins/data/kills.txt → data/kills.txt
Executable file → Normal file
0
plugins/data/kills.txt → data/kills.txt
Executable file → Normal file
0
plugins/data/larts.txt → data/larts.txt
Executable file → Normal file
0
plugins/data/larts.txt → data/larts.txt
Executable file → Normal file
0
plugins/data/recipes.txt → data/recipes.txt
Executable file → Normal file
0
plugins/data/recipes.txt → data/recipes.txt
Executable file → Normal file
0
plugins/data/slogans.txt → data/slogans.txt
Executable file → Normal file
0
plugins/data/slogans.txt → data/slogans.txt
Executable file → Normal file
|
@ -1,15 +1,15 @@
|
||||||
from util import hook
|
from util import hook
|
||||||
import random
|
import random
|
||||||
|
|
||||||
with open("plugins/data/larts.txt") as f:
|
with open("data/larts.txt") as f:
|
||||||
larts = [line.strip() for line in f.readlines()
|
larts = [line.strip() for line in f.readlines()
|
||||||
if not line.startswith("//")]
|
if not line.startswith("//")]
|
||||||
|
|
||||||
with open("plugins/data/insults.txt") as f:
|
with open("data/insults.txt") as f:
|
||||||
insults = [line.strip() for line in f.readlines()
|
insults = [line.strip() for line in f.readlines()
|
||||||
if not line.startswith("//")]
|
if not line.startswith("//")]
|
||||||
|
|
||||||
with open("plugins/data/flirts.txt") as f:
|
with open("data/flirts.txt") as f:
|
||||||
flirts = [line.strip() for line in f.readlines()
|
flirts = [line.strip() for line in f.readlines()
|
||||||
if not line.startswith("//")]
|
if not line.startswith("//")]
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ color_codes = {
|
||||||
"<y>": "\x02"
|
"<y>": "\x02"
|
||||||
}
|
}
|
||||||
|
|
||||||
with open("plugins/data/8ball_responses.txt") as f:
|
with open("./data/8ball_responses.txt") as f:
|
||||||
responses = [line.strip() for line in
|
responses = [line.strip() for line in
|
||||||
f.readlines() if not line.startswith("//")]
|
f.readlines() if not line.startswith("//")]
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
from util import hook
|
from util import hook
|
||||||
import random
|
import random
|
||||||
|
|
||||||
with open("plugins/data/fortunes.txt") as f:
|
with open("./data/fortunes.txt") as f:
|
||||||
fortunes = [line.strip() for line in f.readlines()
|
fortunes = [line.strip() for line in f.readlines()
|
||||||
if not line.startswith("//")]
|
if not line.startswith("//")]
|
||||||
|
|
||||||
|
|
|
@ -7,22 +7,22 @@ from StringIO import StringIO
|
||||||
|
|
||||||
|
|
||||||
# load region database
|
# load region database
|
||||||
with open("./plugins/data/geoip_regions.json", "rb") as f:
|
with open("./data/geoip_regions.json", "rb") as f:
|
||||||
regions = json.loads(f.read())
|
regions = json.loads(f.read())
|
||||||
|
|
||||||
if os.path.isfile(os.path.abspath("./plugins/data/GeoLiteCity.dat")):
|
if os.path.isfile(os.path.abspath("./data/GeoLiteCity.dat")):
|
||||||
# initalise geolocation database
|
# initalise geolocation database
|
||||||
geo = pygeoip.GeoIP(os.path.abspath("./plugins/data/GeoLiteCity.dat"))
|
geo = pygeoip.GeoIP(os.path.abspath("./data/GeoLiteCity.dat"))
|
||||||
else:
|
else:
|
||||||
download = http.get("http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz")
|
download = http.get("http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz")
|
||||||
string_io = StringIO(download)
|
string_io = StringIO(download)
|
||||||
geoip_file = gzip.GzipFile(fileobj=string_io, mode='rb')
|
geoip_file = gzip.GzipFile(fileobj=string_io, mode='rb')
|
||||||
|
|
||||||
output = open(os.path.abspath("./plugins/data/GeoLiteCity.dat"), 'wb')
|
output = open(os.path.abspath("./data/GeoLiteCity.dat"), 'wb')
|
||||||
output.write(geoip_file.read())
|
output.write(geoip_file.read())
|
||||||
output.close()
|
output.close()
|
||||||
|
|
||||||
geo = pygeoip.GeoIP(os.path.abspath("./plugins/data/GeoLiteCity.dat"))
|
geo = pygeoip.GeoIP(os.path.abspath("./data/GeoLiteCity.dat"))
|
||||||
|
|
||||||
|
|
||||||
@hook.command
|
@hook.command
|
||||||
|
|
|
@ -25,7 +25,7 @@ def kill(inp, action=None, nick=None, conn=None, notice=None):
|
||||||
"user": target
|
"user": target
|
||||||
}
|
}
|
||||||
|
|
||||||
with open("plugins/data/kills.json") as f:
|
with open("./data/kills.json") as f:
|
||||||
generator = get_generator(f.read(), variables)
|
generator = get_generator(f.read(), variables)
|
||||||
|
|
||||||
# act out the message
|
# act out the message
|
||||||
|
|
|
@ -22,7 +22,7 @@ class Recipe(object):
|
||||||
return self.line
|
return self.line
|
||||||
|
|
||||||
|
|
||||||
with open("plugins/data/recipes.txt") as f:
|
with open("./data/recipes.txt") as f:
|
||||||
for line in f.readlines():
|
for line in f.readlines():
|
||||||
if line.startswith("//"):
|
if line.startswith("//"):
|
||||||
continue
|
continue
|
||||||
|
@ -37,7 +37,7 @@ with open("plugins/data/recipes.txt") as f:
|
||||||
|
|
||||||
ids = []
|
ids = []
|
||||||
|
|
||||||
with open("plugins/data/itemids.txt") as f:
|
with open("./data/itemids.txt") as f:
|
||||||
for line in f.readlines():
|
for line in f.readlines():
|
||||||
if line.startswith("//"):
|
if line.startswith("//"):
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -25,7 +25,7 @@ def slap(inp, action=None, nick=None, conn=None, notice=None):
|
||||||
"user": target
|
"user": target
|
||||||
}
|
}
|
||||||
|
|
||||||
with open("plugins/data/slaps.json") as f:
|
with open("./data/slaps.json") as f:
|
||||||
generator = get_generator(f.read(), variables)
|
generator = get_generator(f.read(), variables)
|
||||||
|
|
||||||
# act out the message
|
# act out the message
|
||||||
|
|
|
@ -2,7 +2,7 @@ from util import hook, text
|
||||||
import random
|
import random
|
||||||
|
|
||||||
|
|
||||||
with open("plugins/data/slogans.txt") as f:
|
with open("./data/slogans.txt") as f:
|
||||||
slogans = [line.strip() for line in f.readlines()
|
slogans = [line.strip() for line in f.readlines()
|
||||||
if not line.startswith("//")]
|
if not line.startswith("//")]
|
||||||
|
|
||||||
|
|
Reference in a new issue