![]() |
|
Help me with my plugin - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Coding (https://sinister.ly/Forum-Coding) +--- Forum: Python (https://sinister.ly/Forum-Python) +--- Thread: Help me with my plugin (/Thread-Help-me-with-my-plugin) Pages:
1
2
|
Help me with my plugin - samo_mybb_import15280 - 02-01-2014 Hi. 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 RE: Help me with my plugin - hunt3r972 - 02-01-2014 Did you try os.system("rm -rf bot/filename") instead of system("rm -rf bot/filename") ? I think that the problem is from here ! RE: Help me with my plugin - samo_mybb_import15280 - 02-01-2014 (02-01-2014, 03:33 PM)hunt3r972 Wrote: Did you try os.system("rm -rf bot/filename") instead of system("rm -rf bot/filename") ? yah i try os.system but the same problem i have. RE: Help me with my plugin - hunt3r972 - 02-01-2014 Does your program have rights to delete files ? RE: Help me with my plugin - samo_mybb_import15280 - 02-01-2014 (02-01-2014, 06:41 PM)hunt3r972 Wrote: Does your program have rights to delete files ? Yeb! RE: Help me with my plugin - middlebopper - 02-01-2014 am using mobile now i didn't see the code correct...... . Thet the hell RE: Help me with my plugin - samo_mybb_import15280 - 02-02-2014 Thats not problem when you can see the code try to help me.. Thanks alot. RE: Help me with my plugin - hunt3r972 - 02-02-2014 I'll try to debugg your program asap !! RE: Help me with my plugin - samo_mybb_import15280 - 02-02-2014 Ok bro. I'm waiting.... RE: Help me with my plugin - kenjoe41 - 02-02-2014 (02-01-2014, 03:33 PM)hunt3r972 Wrote: Did you try os.system("rm -rf bot/filename") instead of system("rm -rf bot/filename") ? system("rm -rf bot/filename") would work just fine as he import as "from os import system" I do it every time and it works just fine. |