通信人家园

标题: 贝尔7360 与华为MA5800业务替换脚本_Part1  [查看完整版帖子] [打印本页]

时间:  2021-12-3 21:59
作者: 地心引力520     标题: 贝尔7360 与华为MA5800业务替换脚本_Part1

贝尔7360 与华为MA5800业务替换脚本_Part1  近期更新


时间:  2021-12-4 10:25
作者: 地心引力520

目前实现功能:
界面GUI设计
宽带业务替换
语音业务替换
IPTV业务替换
B型专线业务替换开发中...

时间:  2021-12-4 10:36
作者: 地心引力520

先上完成图 7360_MA5800.PNG 检查光猫类型和业务类型.PNG ONU业务整合.PNG

附件: 7360_MA5800.PNG (2021-12-4 10:35, 112.68 KB) / 下载次数 0
https://www.txrjy.com/forum.php?mod=attachment&aid=NTA4MzI5fDRmZTU0ZTFkfDE3MzIyNTk4OTZ8MHww

附件: 7360_MA5800.PNG (2021-12-4 10:35, 112.68 KB) / 下载次数 1
https://www.txrjy.com/forum.php?mod=attachment&aid=NTA4MzMwfGNjNWExOGQ1fDE3MzIyNTk4OTZ8MHww

附件: 检查光猫类型和业务类型.PNG (2021-12-4 10:35, 22.13 KB) / 下载次数 0
https://www.txrjy.com/forum.php?mod=attachment&aid=NTA4MzMxfDNlZWQzYWJifDE3MzIyNTk4OTZ8MHww

附件: ONU业务整合.PNG (2021-12-4 10:35, 32.32 KB) / 下载次数 0
https://www.txrjy.com/forum.php?mod=attachment&aid=NTA4MzMyfDE5OTVhZmJlfDE3MzIyNTk4OTZ8MHww
时间:  2021-12-4 10:36
作者: 地心引力520

什么问题发个贴还要人工审核了
时间:  2021-12-16 19:25
作者: 地心引力520

#!/usr/bin/python3.5
# -*- coding: UTF-8 -*-
import xlrd
import os
import xlwt
from xlrd import xldate_as_tuple
import datetime
'''
xlrd中单元格的数据类型
数字一律按浮点型输出,日期输出成一串小数,布尔型输出0或1,所以我们必须在程序中做判断处理转换
成我们想要的数据类型
0 empty,1 string, 2 number, 3 date, 4 boolean, 5 error
'''        
def stringCompare(str1, str2):
    for i in range(len(str2)):
        if str1 == str2[i]:
            return 1
    return -1
def get_board_port(val,val_len):
    a = 0
    for i in range(1,val_len):
        if val[i] == '/':
            a = a+1
            if a == 2:
                if val[i+2] == '/':
                    board = val[i+1]
                if val[i+3] == '/':
                    board[0] = val[i+1]
                    board[1] = val[i+2]
            if a == 3:
                port = val[i+1]
                if i+3 == val_len:
                    port = port + val[i+2]
    return board,port      
            
   
if __name__ == "__main__":
    KD_SVLAN = ["3116","3117","3118","3119","3120","3121","3122","3123","3136","3138"]
    YUYIN_SVLAN = ["3851"]
    IPTV_SVLAN = ["501"]
    HGU_VLAN = "900"
    data_path = "1.xls"
    sheetname = "OLT(分光器)下的PON用户数据查询1"
    get_data = xlrd.open_workbook(data_path, sheetname)
    datas = get_data.sheets()[0] #选取要读的sheet表单
    nrows = datas.nrows  #行数
    ncols = datas.ncols #行数
   
    w_xls= xlwt.Workbook() #创建工作簿
    sheet1 = w_xls.add_sheet(u'sheet1',cell_overwrite_ok=True) #创建sheet
    sheet2 = w_xls.add_sheet(u'sheet2',cell_overwrite_ok=True) #创建sheet
    sheet3 = w_xls.add_sheet(u'sheet3',cell_overwrite_ok=True) #创建sheet
    # 设置颜色
    style = xlwt.easyxf('pattern: pattern solid, fore_colour ice_blue')
     # 字体加粗
    style = xlwt.easyxf('font: bold on')
    #样式合并
    style = xlwt.easyxf('pattern: pattern solid, fore_colour ice_blue; font: bold on')

    sheet1.write(0,0,"board")       
    sheet1.write(0,1,"pon")       
    sheet1.write(0,2,"ONUID")       
    sheet1.write(0,3,"ONU TYPE")       
    sheet1.write(0,4,"LOID")
    sheet1.write(0,5,"SVLAN")
    sheet1.write(0,6,"USERVLAN")                       
    sheet1.write(0,7,"宽带外层1")       
    sheet1.write(0,8,"宽带内层1")       
    sheet1.write(0,9,"语音外层")
    sheet1.write(0,10,"语音内层")       
    sheet1.write(0,11,"IPTV外层")       
    sheet1.write(0,12,"IPTV内层")       
    sheet1.write(0,13,"HGU外层")       
    sheet1.write(0,14,"共享宽带外层2")       
    sheet1.write(0,15,"共享宽带内层2")       
    sheet1.write(0,16,"共享宽带外层3")       
    sheet1.write(0,17,"共享宽带内层3")       
    sheet1.write(0,18,"共享宽带外层4")       
    sheet1.write(0,19,"共享宽带内层4")       





通信人家园 (https://www.txrjy.com/) Powered by C114