# > !NewsStats.py.Task/py

import os
import wimp
import Iconbar
import MainW
import Newsbase

def init():
    "Initialise program specific stuff"
    wimp.hourglass_on()
    Newsbase.init()
    Iconbar.init()
    MainW.init()
    wimp.message_handler[0x83581] = Newsbase_Reply
    wimp.hourglass_off()

def quit():
    "Tidy up before quitting"
    Newsbase.quit()
    for temp in MainW.temps:
        os.system('Wipe ' + temp + ' ~CFR~V')
        try:
            os.rmdir('<Wimp$ScrapDir>.NewsStats')
        except:
            pass

def Newsbase_Reply():
    Newsbase.Reply()
    Iconbar.update()
