Help me with my plugin 02-01-2014, 02:34 PM
#1
Hi.
I try to make auto remove file from my server on certain date using jabber bot and i make this plugin:
and its work without any problems but the file dos not removed from my server i think the problem is from date.
so please can anyone help me and edit my plugin?
regards,
sam
I try to make auto remove file from my server on certain date using jabber bot and i make this plugin:
Code:
from os import system
from sys import exit as sys_exit
import datetime, time
def dcbot_join():
date = _parse_date(sdate)
DCBOT = '2014/2/1' #Date to remove file
if DCBOT == date:
try:
system("rm -rf bot/filename") #path of file
except KeyboardInterrupt:
print 'Exiting...'
time.sleep(3)
sys_exit()
except:
print 'Exiting...'
time.sleep(3)
sys_exit()
def _parse_date(sdate):
date = time.strptime(sdate, '%Y/%m/%d')
return datetime.date(date.tm_year, date.tm_mon, date.tm_mday)
register_join_handler(dcbot_join)and its work without any problems but the file dos not removed from my server i think the problem is from date.
so please can anyone help me and edit my plugin?
regards,
sam


![[+]](https://sinister.li/images/modern/collapse_collapsed.png)


