Пример #1
0
    def set_data(self,**kwargs):  #远程参数
        try:
            if "title" in kwargs:  #标题
                self.setWindowTitle(u'%s'%(kwargs['title']))
            if "Import_export" in kwargs:  #操作方式
                self.Import_export=int(kwargs['Import_export'])

            if "type_id" in kwargs:  #类别
                self.type_id.addItem(QtGui.QIcon('system/main.ico'),_fromUtf8(str("站点类别")))
                #self.type_id.addItems(kwargs['type_id'])
                self.json_data=json.loads(kwargs['type_id'])
                for colour in self.json_data:
                    #print "xxxx",colour
                    self.type_ICO=treeWidget_work.sql_type_ICO(str(colour))
                    self.type_id.addItem(QtGui.QIcon(str(self.type_ICO)),_fromUtf8(str(self.json_data.get(str(colour)))))
                    self.list_data.append(colour)
                #self.type_id.setCurrentIndex(int(1))
            if "type_id_key" in kwargs:  #类别
                self.insert_update=False   #0是True添加    1是False  修改
                x= self.list_data.index(u'%s'%(kwargs['type_id_key']))
                # if self.type_id.currentIndex()>=int(x): #返回Item数目
                #     print self.type_id.currentIndex(),"bbbbb",x
                try:
                    # 你的代码
                    self.type_id.setCurrentIndex(int(x)+1)
                except BaseException, e:
                    pass
        except BaseException, e:
            log.logging.debug("except:%s"%(str(e)))
Пример #2
0
    def set_data(self, **kwargs):  #远程参数
        try:
            if "title" in kwargs:  #标题
                self.setWindowTitle(u'%s' % (kwargs['title']))
            if "Import_export" in kwargs:  #操作方式
                self.Import_export = int(kwargs['Import_export'])

            if "type_id" in kwargs:  #类别
                self.type_id.addItem(QtGui.QIcon('system/main.ico'),
                                     _fromUtf8(str("站点类别")))
                #self.type_id.addItems(kwargs['type_id'])
                self.json_data = json.loads(kwargs['type_id'])
                for colour in self.json_data:
                    #print "xxxx",colour
                    self.type_ICO = treeWidget_work.sql_type_ICO(str(colour))
                    self.type_id.addItem(
                        QtGui.QIcon(str(self.type_ICO)),
                        _fromUtf8(str(self.json_data.get(str(colour)))))
                    self.list_data.append(colour)
                #self.type_id.setCurrentIndex(int(1))
            if "type_id_key" in kwargs:  #类别
                self.insert_update = False  #0是True添加    1是False  修改
                x = self.list_data.index(u'%s' % (kwargs['type_id_key']))
                # if self.type_id.currentIndex()>=int(x): #返回Item数目
                #     print self.type_id.currentIndex(),"bbbbb",x
                try:
                    # 你的代码
                    self.type_id.setCurrentIndex(int(x) + 1)
                except BaseException, e:
                    pass
        except BaseException, e:
            log.logging.debug("except:%s" % (str(e)))
Пример #3
0
 def set_data(self, **kwargs):  #远程参数
     try:
         if "title" in kwargs:  #标题
             self.setWindowTitle(u'%s' % (kwargs['title']))
         if "siteurl" in kwargs:  #URL
             self.insert_update = True  #0是True添加    1是False  修改
             self.siteurl.setText(u'%s' % (kwargs['siteurl']))
         if "sitepass" in kwargs:  #密码
             self.sitepass.setText(u'%s' % (kwargs['sitepass']))
         if "config" in kwargs:  #配置
             self.config.setText(u'%s' % (kwargs['config']))
         if "type_id" in kwargs:  #类别
             self.type_id.addItem(QtGui.QIcon('system/main.png'),
                                  _fromUtf8(str("站点类别")))
             #self.type_id.addItems(kwargs['type_id'])
             self.json_data = json.loads(kwargs['type_id'])
             for colour in self.json_data:
                 #print "xxxx",colour
                 self.type_ICO = treeWidget_work.sql_type_ICO(str(colour))
                 self.type_id.addItem(
                     QtGui.QIcon(str(self.type_ICO)),
                     _fromUtf8(str(self.json_data.get(str(colour)))))
                 self.list_data.append(colour)
         # list_script=["PHP(Eval)","ASP(Eval)","ASPX(Eval)","Customize"]
         # list_coding=["UTF-8","GB2312","BIG5","Euc-KR","Euc-JP","Shift_JIS","Windows-1251","Windows-874","ISO-8859-1"]
         # if "script" in kwargs:  #脚本类型  asp   php
         #     self.script.addItem(QtGui.QIcon('ico/time.ico'),_fromUtf8(str("脚本类型")))
         #     self.script.addItems(kwargs['script'])
         # if "coding" in kwargs:  #编码方式
         #     self.coding.addItem(QtGui.QIcon('ico/coding.ico'),_fromUtf8(str("字符编码")))
         #     self.coding.addItems(kwargs['coding'])
         #脚本类型  asp   php
         self.script.addItem(QtGui.QIcon('system/script.ico'),
                             _fromUtf8(str("脚本类型")))
         self.script.addItem(QtGui.QIcon('system/php.ico'),
                             _fromUtf8(str("PHP(Eval)")))
         self.script.addItem(QtGui.QIcon('system/asp.ico'),
                             _fromUtf8(str("ASP(Eval)")))
         self.script.addItem(QtGui.QIcon('system/aspx.ico'),
                             _fromUtf8(str("ASPX(Eval)")))
         self.script.addItem(_fromUtf8(str("Customize")))
         #self.script.setCurrentIndex(0)
         #编码方式
         self.coding.addItem(QtGui.QIcon('system/coding.ico'),
                             _fromUtf8(str("字符编码")))
         self.coding.addItem(_fromUtf8(str("UTF-8")))
         self.coding.addItem(_fromUtf8(str("GB2312")))
         self.coding.addItem(_fromUtf8(str("BIG5")))
         self.coding.addItem(_fromUtf8(str("Euc-KR")))
         self.coding.addItem(_fromUtf8(str("Euc-JP")))
         self.coding.addItem(_fromUtf8(str("Shift_JIS")))
         self.coding.addItem(_fromUtf8(str("Windows-1251")))
         self.coding.addItem(_fromUtf8(str("Windows-874")))
         self.coding.addItem(_fromUtf8(str("ISO-8859-1")))
         #self.coding.setCurrentIndex(0)
         #修改传入
         int_ini = 1
         if "id_key" in kwargs:  #id
             self.id = u'%s' % (kwargs['id_key'])
             self.pushButton.setText(u'修改数据')
             int_ini = 0
         else:
             self.pushButton.setText(u'添加数据')
             int_ini = 1
         if "type_id_key" in kwargs:  #类别
             self.insert_update = False  #0是True添加    1是False  修改
             x = self.list_data.index(u'%s' % (kwargs['type_id_key']))
             # if self.type_id.currentIndex()>=int(x): #返回Item数目
             #     print self.type_id.currentIndex(),"bbbbb",x
             try:
                 self.type_id.setCurrentIndex(int(x) + 1)
             except BaseException, e:
                 pass
         try:  #没有选择分组时选择默认分组
             if self.type_id.currentIndex() == 0:
                 self.type_id.setCurrentIndex(int(1))
         except BaseException, e:
             pass
Пример #4
0
 def set_data(self,**kwargs):  #远程参数
     try:
         if "title" in kwargs:  #标题
             self.setWindowTitle(u'%s'%(kwargs['title']))
         if "siteurl" in kwargs:  #URL
             self.insert_update=True   #0是True添加    1是False  修改
             self.siteurl.setText(u'%s'%(kwargs['siteurl']))
         if "sitepass" in kwargs:  #密码
             self.sitepass.setText(u'%s'%(kwargs['sitepass']))
         if "config" in kwargs:  #配置
             self.config.setText(u'%s'%(kwargs['config']))
         if "type_id" in kwargs:  #类别
             self.type_id.addItem(QtGui.QIcon('system/main.png'),_fromUtf8(str("站点类别")))
             #self.type_id.addItems(kwargs['type_id'])
             self.json_data=json.loads(kwargs['type_id'])
             for colour in self.json_data:
                 #print "xxxx",colour
                 self.type_ICO=treeWidget_work.sql_type_ICO(str(colour))
                 self.type_id.addItem(QtGui.QIcon(str(self.type_ICO)),_fromUtf8(str(self.json_data.get(str(colour)))))
                 self.list_data.append(colour)
         # list_script=["PHP(Eval)","ASP(Eval)","ASPX(Eval)","Customize"]
         # list_coding=["UTF-8","GB2312","BIG5","Euc-KR","Euc-JP","Shift_JIS","Windows-1251","Windows-874","ISO-8859-1"]
         # if "script" in kwargs:  #脚本类型  asp   php
         #     self.script.addItem(QtGui.QIcon('ico/time.ico'),_fromUtf8(str("脚本类型")))
         #     self.script.addItems(kwargs['script'])
         # if "coding" in kwargs:  #编码方式
         #     self.coding.addItem(QtGui.QIcon('ico/coding.ico'),_fromUtf8(str("字符编码")))
         #     self.coding.addItems(kwargs['coding'])
         #脚本类型  asp   php
         self.script.addItem(QtGui.QIcon('system/script.ico'),_fromUtf8(str("脚本类型")))
         self.script.addItem(QtGui.QIcon('system/php.ico'),_fromUtf8(str("PHP(Eval)")))
         self.script.addItem(QtGui.QIcon('system/asp.ico'),_fromUtf8(str("ASP(Eval)")))
         self.script.addItem(QtGui.QIcon('system/aspx.ico'),_fromUtf8(str("ASPX(Eval)")))
         self.script.addItem(_fromUtf8(str("Customize")))
         #self.script.setCurrentIndex(0)
         #编码方式
         self.coding.addItem(QtGui.QIcon('system/coding.ico'),_fromUtf8(str("字符编码")))
         self.coding.addItem(_fromUtf8(str("UTF-8")))
         self.coding.addItem(_fromUtf8(str("GB2312")))
         self.coding.addItem(_fromUtf8(str("BIG5")))
         self.coding.addItem(_fromUtf8(str("Euc-KR")))
         self.coding.addItem(_fromUtf8(str("Euc-JP")))
         self.coding.addItem(_fromUtf8(str("Shift_JIS")))
         self.coding.addItem(_fromUtf8(str("Windows-1251")))
         self.coding.addItem(_fromUtf8(str("Windows-874")))
         self.coding.addItem(_fromUtf8(str("ISO-8859-1")))
         #self.coding.setCurrentIndex(0)
         #修改传入
         int_ini=1
         if "id_key" in kwargs:  #id
             self.id= u'%s'%(kwargs['id_key'])
             self.pushButton.setText(u'修改数据')
             int_ini=0
         else:
             self.pushButton.setText(u'添加数据')
             int_ini=1
         if "type_id_key" in kwargs:  #类别
             self.insert_update=False   #0是True添加    1是False  修改
             x= self.list_data.index(u'%s'%(kwargs['type_id_key']))
             # if self.type_id.currentIndex()>=int(x): #返回Item数目
             #     print self.type_id.currentIndex(),"bbbbb",x
             try:
                 self.type_id.setCurrentIndex(int(x)+1)
             except BaseException, e:
                 pass
         try: #没有选择分组时选择默认分组
             if self.type_id.currentIndex()==0:
                 self.type_id.setCurrentIndex(int(1))
         except BaseException, e:
             pass