1
0
Fork 0

Removing old modules

This commit is contained in:
Némunaire 2012-04-09 04:28:55 +02:00
parent 0f00e63ee3
commit a86d653fdf
2 changed files with 0 additions and 97 deletions

View File

@ -1,44 +0,0 @@
import re
import os
import subprocess
def launch(s, sender, msgpart):
result = re.match(".*((dans|in) (la |the )?bran?ch?e?|(dans|in) (la |the )?bran?c?he?) +([^ ]+).*", msgpart)
if result is not None:
branch = "acu/" + result.group(6);
else:
branch = "master"
result = re.match(".*(dans|in) (la |the |le fichier |le dossier )?([^b][^r][^ ]+).*", msgpart)
if result is not None and re.search("(^/|.*\.\..*)", result.group(3)) is None:
checkpath = result.group(3)
if not os.path.exists(checkpath):
if os.path.exists("./src/" + checkpath):
checkpath = "./src/" + checkpath
else:
dirList = os.listdir("./src/")
for f in dirList:
if os.path.exists("./src/" + os.path.basename(f) + "/" + checkpath):
checkpath = "./src/" + os.path.basename(f) + "/" + checkpath
break
if not os.path.exists(checkpath):
s.send("PRIVMSG %s :I don't find %s in branch %s\r\n" % (sender[0], checkpath, branch))
return
else:
checkpath = "./src/"
if subprocess.call(["git", "checkout", branch]) == 0:
try:
#s.send("PRIVMSG %s :Let me check %s in %s\r\n" % (sender[0], branch, checkpath))
faults = subprocess.check_output(["/home/nemunaire/workspace_/moulinette/main.py", checkpath])
lines = faults.split('\n')
for l in lines:
if len(l) > 1:
#print l
#print sender
s.send("PRIVMSG %s :%s\r\n" % (sender[0], l))
except:
s.send("PRIVMSG %s :An error occurs, all is broken\r\n" % sender[0])
else:
s.send("PRIVMSG %s :I haven't the branch %s here.\r\n" % (sender[0], branch))

View File

@ -1,53 +0,0 @@
# coding=utf-8
from datetime import datetime
import time
import newyear
def sync(sec):
print "Time thread synchronization..."
time.sleep(((60 + sec) - datetime.now().second - 1) % 60)
while datetime.now().second % sec != 0:
time.sleep (0.1)
time.sleep (0.4)
print "Synchonized on {0}={1} seconds...".format(sec, datetime.now().second)
def startThread(s, ndate, sentences, CHANLIST):
sync (60);
while 1:
minute = datetime.now ().minute
if minute == 0 and datetime.now ().hour == 0 and datetime.now ().day == 1 and datetime.now ().month == 1:
print("Happy new year!")
for chan in CHANLIST.split():
newyear.special (s, chan)
elif minute == 0 and datetime.now ().hour == 6 and datetime.now ().day == 18 and datetime.now ().month == 1:
print("WikiEnd!")
for chan in CHANLIST.split():
newyear.special (s, chan)
elif minute == 0 and datetime.now ().hour == 0 and datetime.now ().day == 23 and datetime.now ().month == 2:
print("Anniv Xetal!")
for chan in CHANLIST.split():
newyear.special (s, chan)
if minute == 18:
for chan in CHANLIST.split():
newyear.launch (s, chan, datetime(2012, 1, 18, 6, 0, 1), sentences, 0)
if minute == 42:
sync(42)
print("42!")
# for chan in CHANLIST.split():
# s.send("PRIVMSG %s :42 !\r\n" % chan)
if datetime.now ().second != 0:
sync(60)
else:
time.sleep(60)