Exemplo n.º 1
0
def Refresh():
    global_var.app_stat = 'refresh'
    try:
        #if(1):
        global_var.statusBar.SetStatusText(u"状态:忙碌", 2)
        global_var.statusBar.SetStatusText(u"正在获取网络学堂文件列表......", 1)
        download.getCourse()
        download.refreshFiles()
        download.refreshNotes()
        ShowCourse()
        ShowFile(global_var.current_courseindex)
        a = os.path.join(global_var.setting['download_path'], u'notes')
        b = global_var.list[global_var.current_courseindex][1] + u'.htm'
        notename = os.path.join(a, b)

        if os.path.exists(notename):
            global_var.html.LoadFile(notename)

    except:
        #else:
        global_var.statusBar.SetStatusText(u"由于网络或其他原因,列表刷新失败", 1)
        global_var.statusBar.SetStatusText(u"状态:空闲", 2)
        return
    global_var.statusBar.SetStatusText(u"列表刷新成功", 1)
    global_var.statusBar.SetStatusText(u"状态:空闲", 2)
    saveList()
    global_var.app_stat = 'Idle'
    return True
Exemplo n.º 2
0
def Refresh():
    global_var.app_stat='refresh'
    try:
    #if(1):
        global_var.statusBar.SetStatusText(u"状态:忙碌",2)
        global_var.statusBar.SetStatusText(u"正在获取网络学堂文件列表......",1)
        download.getCourse()
        download.refreshFiles()
        download.refreshNotes()
        ShowCourse()
        ShowFile(global_var.current_courseindex)
        a=os.path.join(global_var.setting['download_path'],u'notes')
        b=global_var.list[global_var.current_courseindex][1]+u'.htm'
        notename=os.path.join(a,b)
        
        if os.path.exists(notename):
            global_var.html.LoadFile(notename )
        
    except:
    #else:
        global_var.statusBar.SetStatusText(u"由于网络或其他原因,列表刷新失败",1)
        global_var.statusBar.SetStatusText(u"状态:空闲",2)
        return
    global_var.statusBar.SetStatusText(u"列表刷新成功",1)
    global_var.statusBar.SetStatusText(u"状态:空闲",2)
    saveList()
    global_var.app_stat='Idle'
    return True
Exemplo n.º 3
0
def _refreshAll():
    global_var.statusBar.SetStatusText(u"状态:忙碌", 2)
    global_var.statusBar.SetStatusText(u"正在更新课件列表......", 1)
    download.refreshFiles()
    saveList()
    ShowCourse()
    ShowFile(-1)
    global_var.statusBar.SetStatusText(u"课件列表更新完毕", 1)
    global_var.statusBar.SetStatusText(u"状态:空闲", 2)
Exemplo n.º 4
0
def _refreshAll():
    global_var.statusBar.SetStatusText(u"状态:忙碌",2)
    global_var.statusBar.SetStatusText(u"正在更新课件列表......",1)
    download.refreshFiles()
    saveList()
    ShowCourse()
    ShowFile(-1)
    global_var.statusBar.SetStatusText(u"课件列表更新完毕",1)
    global_var.statusBar.SetStatusText(u"状态:空闲",2)
Exemplo n.º 5
0
def _downAll():
    global_var.statusBar.SetStatusText(u"状态:忙碌", 2)
    download.refreshFiles()
    #if(1):
    try:
        download.DownAll()
    #else:
    except:
        global_var.statusBar.SetStatusText(u"由于网络或其他原因,下载被中断", 1)
        global_var.statusBar.SetStatusText(u"状态:空闲", 2)
        return
    try:
        download.refreshNotes()
    except:
        global_var.statusBar.SetStatusText(u"由于网络或其他原因,更新文件列表被中断", 1)
        global_var.statusBar.SetStatusText(u"状态:空闲", 2)
        return
    saveList()
    global_var.statusBar.SetStatusText(u"所有的课件已经成功下载,所有课程公告已经更新", 1)
    global_var.statusBar.SetStatusText(u"状态:空闲", 2)
Exemplo n.º 6
0
def _downAll():
    global_var.statusBar.SetStatusText(u"状态:忙碌",2)
    download.refreshFiles()
    #if(1):
    try:
        download.DownAll()
    #else:
    except:
        global_var.statusBar.SetStatusText(u"由于网络或其他原因,下载被中断",1)
        global_var.statusBar.SetStatusText(u"状态:空闲",2)
        return
    try:
        download.refreshNotes()
    except:
        global_var.statusBar.SetStatusText(u"由于网络或其他原因,更新文件列表被中断",1)
        global_var.statusBar.SetStatusText(u"状态:空闲",2)
        return
    saveList()
    global_var.statusBar.SetStatusText(u"所有的课件已经成功下载,所有课程公告已经更新",1)
    global_var.statusBar.SetStatusText(u"状态:空闲",2)