• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python I18N._函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中umit.icm.agent.I18N._函数的典型用法代码示例。如果您正苦于以下问题:Python _函数的具体用法?Python _怎么用?Python _使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了_函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: _on_activated

 def _on_activated(self,widget,row,col):
     """"""
     self.install_btn.set_sensitive(True)
     #choice
     selection = self.treeview.get_selection()
     (model,iter) = selection.get_selected()
     if iter == None:
         return
     else:
         cur_version = self.store.get_value(iter,1)
         #fill self.current_record
         rs = g_db_helper.select("select * from updates where version = '%s'" % cur_version)
         if len(rs) != 1:
             g_logger.error("Record is ERROR in DB!!!! The window will be closed!!!")
             self.destroy()
         self.current_record = {}
         
         self.current_record["version"] = rs[0][0]
         self.current_record["news_date"] = rs[0][1]
         self.current_record["software_name"] = rs[0][2]
         self.current_record["description"] = rs[0][3]
         self.current_record["download_url"] = rs[0][4] 
         self.current_record["is_update"] = rs[0][5]
         self.current_record["check_code"] = rs[0][6]            
           
         
         self.statusbar.push(0,_("You have selected the %s version" % \
                             self.current_record["version"])) 
        
         self.details_textview.set_buffer(self._set_details_content(_(self.current_record["description"] + "\n" + 
                                     "download:"+self.current_record["download_url"] + "\n" +
                                     "Designed by Umit!" 
                                     ))) 
         self.details_textview.show_all()
         g_logger.debug("Selected the item %s" % (self.current_record))              
开发者ID:tianweidut,项目名称:openmonitor-desktop-agent,代码行数:35,代码来源:SoftwareUpdate.py


示例2: _alter_network_informaiton

 def _alter_network_informaiton(self,failure):
     failure_info_first = None
     failure_info_second = None
     
     if 'error.NoRouteError' in str(failure):
         failure_info_first  = 'Disconnect to Internet'
         failure_info_second = 'Please check your network card connection!'
     elif 'TimeoutError' in str(failure):
         failure_info_first = 'Cloud Aggregator Server Connect Error'
         failure_info_second = 'Please check your cloud aggregator URL'         
     elif 'Agent matching query does not exist' in str(failure) :# or\
                        # '500 Internal Server Error' in str(failure) or\
                        # '500 INTERNAL SERVER ERROR' in str(failure):
         failure_info_first = _('Username/Password Error')
         failure_info_second = _('Please check your username or password')
         #clear username and password (there maybe some bugs here)
         theApp.peer_info.clear_db()
     else: 
         print str(failure)
         pass
     
     if failure_info_first == None and failure_info_second == None:
         return
     else:
         self._alter_show(primary_text = failure_info_first,secondary_text =failure_info_second)    
开发者ID:gkso,项目名称:openmonitor-desktop-agent,代码行数:25,代码来源:aggregator.py


示例3: show_failed

 def show_failed(self,result):
     """
     """
     alert = HIGAlertDialog(message_format=_("Error."),
                                secondary_text=_("Send to aggregaetor failed."))
     alert.run()
     alert.destroy()
开发者ID:gkso,项目名称:openmonitor-desktop-agent,代码行数:7,代码来源:FeedbackPage.py


示例4: __init__

    def __init__(self, title=_('Bug Report'), summary=None, description=None,
                 category=None, crashreport=False, description_dialog=None,
                 reuse_mainloop=True):
        HIGDialog.__init__(self, title=title,
            buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT,
                gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))

        # If reuse_mainloop is true, then dialogs created inside this dialog
        # will not start another mainloop.
        self._reuse_mainloop = reuse_mainloop

        self.set_position(gtk.WIN_POS_CENTER_ALWAYS)

        self.crashreport = crashreport
        self.description_dialog = description_dialog
        self._create_widgets()
        self._set_category_list()
        self._pack_widgets()
        self._connect_widgets()
        self.summary = summary or ''
        self.description_report = description
        if self.crashreport:
            self.description = _("CrashReport automatically created")
        else:
            if self.description_dialog is None:
                self.description = description or ''
            else:
                self.description = description_dialog or ''
        self.category = category or ''
开发者ID:gkso,项目名称:openmonitor-desktop-agent,代码行数:29,代码来源:BugReport.py


示例5: __create_widgets

 def __create_widgets(self):
     self.hbox1 = HIGHBox()
     self.hbox2 = HIGHBox()
     self.subbox = Tests()
     self.hbox1.add(self.subbox)
     self.checkbtn = gtk.CheckButton(_("Update tests module automatically"))
     self.checkbtn_throttled = gtk.CheckButton(_("Load HTTP Throttled Test"))
开发者ID:gkso,项目名称:openmonitor-desktop-agent,代码行数:7,代码来源:TestPage.py


示例6: descr_by_graphmode

    def descr_by_graphmode(self):
        """
        Returns a description with graph meaning.
        """
        graph_descr = [
            _("end of a week"), _("end of 12 hours period"),
            _("end of half hour period"), _("end of a minute")
            ]

        return _("Each point break represents ") + \
               graph_descr[view_mode_order.index(self.graph_mode)]
开发者ID:gkso,项目名称:openmonitor-desktop-agent,代码行数:11,代码来源:TimeLineGraphBase.py


示例7: send_website_suggestion

 def send_website_suggestion(self):
     website_url = self.website_url_entry.get_text()
     if website_url == '':
         alert = HIGAlertDialog(message_format=_("Missing fields."),
                                secondary_text=_("Please input all fields "
                                                 "for website suggestion."))
         alert.run()
         alert.destroy()
         return
     d = theApp.aggregator.send_website_suggestion(website_url)
     d.addCallback(self.show_success)
     d.addErrback(self.show_failed)
开发者ID:gkso,项目名称:openmonitor-desktop-agent,代码行数:12,代码来源:FeedbackPage.py


示例8: show_success

 def show_success(self, result):
     """
     """
     if result is not None:
         alert = HIGAlertDialog(message_format=_("Succuss."),
                                secondary_text=_("Send to aggregaetor successfully."))
         alert.run()
         alert.destroy()
     else:
         alert = HIGAlertDialog(message_format=_("Error."),
                                secondary_text=_("Send to aggregaetor failed."))
         alert.run()
         alert.destroy()
开发者ID:gkso,项目名称:openmonitor-desktop-agent,代码行数:13,代码来源:FeedbackPage.py


示例9: show_report

def show_report(reuse_mainloop, bug_page):
    if not bug_page:
        return
    try:
        webbrowser.open(bug_page)
    except: # XXX What exceptions should be caught here ?
        page_dialog = HIGAlertDialog(type=gtk.MESSAGE_ERROR,
                message_format=_("Could not open default Web Browser"),
                secondary_text=_("Open Monitor was unable to open your default "
                    "web browser to show the bug tracker page with the "
                    "report status. Try visiting Open Monitor's bug tracker "
                    "page to see if your bug was reported."))
        run_dialog(reuse_mainloop, page_dialog)
开发者ID:gkso,项目名称:openmonitor-desktop-agent,代码行数:13,代码来源:BugReport.py


示例10: __create_widgets

    def __create_widgets(self):
        
        #box
        self.all_box = HIGVBox()
        self.input_box = HIGHBox()
        self.buttom_box = HIGHBox()
        self.check_btn_box = gtk.HButtonBox()
        
        #Add input
        self.title_text = HIGLabel(_("Locations"))
        self.longitude_text = HIGLabel(_("longitude:"))
        self.longitude_entry = HIGTextEntry()
        self.latitude_text = HIGLabel(_("latitude:"))
        self.latitude_entry = HIGTextEntry()         
        
        #Add buttons
        self.get_event_btn = gtk.Button(_("Get Events"))
        self.refresh_btn = gtk.Button(_("Refresh"))
          
        #status bar
        self.statusbar = gtk.Statusbar()
        self.statusbar.push(0,'Events in Database')        
                                
        self.listmodel = gtk.ListStore(str, str, str, str, str)

        # create the TreeView
        self.treeview = gtk.TreeView()

        # create the TreeViewColumns to display the data
        self.tvcolumn = [None] * len(self.column_names)
        cellpb = gtk.CellRendererText()

        self.tvcolumn[0] = gtk.TreeViewColumn(self.column_names[0], cellpb)
        self.tvcolumn[0].add_attribute(cellpb, 'text', 0)
        #cell = gtk.CellRendererText()
        #self.tvcolumn[0].set_cell_data_func(cell, self.test_type)
        self.treeview.append_column(self.tvcolumn[0])

        for n in range(1, len(self.column_names)):
            cell = gtk.CellRendererText()
            self.tvcolumn[n] = gtk.TreeViewColumn(self.column_names[n], cell)
            self.tvcolumn[n].add_attribute(cell, 'text', n)
            if n == 1:
                cell.set_property('xalign', 1.0)
            #self.tvcolumn[n].set_cell_data_func(cell, cell_data_funcs[n])
            self.treeview.append_column(self.tvcolumn[n])

        #self.treeview.connect('row-activated', self.open_file)
        self.scrolledwindow = gtk.ScrolledWindow()
        self.scrolledwindow.add(self.treeview)
        self.treeview.set_model(self.listmodel)
开发者ID:tianweidut,项目名称:openmonitor-desktop-agent,代码行数:51,代码来源:Event.py


示例11: __create_widgets

 def __create_widgets(self):
     
     
     self.general_hbox = HIGHBox()    
     self.version_hbox = HIGHBox()
     
     ################
     #Version Section
     self.version_section = HIGSectionLabel(_("Version"))
     self.version_table = HIGTable()
     self.version_label  = HIGEntryLabel(_("Software Version:"))
     self.version2_label = HIGEntryLabel()
     self.testver_label  = HIGEntryLabel(_("Service Test Version:"))
     self.testver2_label = HIGEntryLabel()
     self.attribute_label = HIGEntryLabel(_("Agent Attribute:"))
     self.attribute2_label = HIGEntryLabel()
         
     ################
     #General Section
     self.general_section = HIGSectionLabel(_("General"))
     self.general_table = HIGTable()
             
     self.startup_check = gtk.CheckButton(_("Startup OpenMonitor on system startup"))
     self.notification_check = gtk.CheckButton(_("Show Desktop Notifications"))
     self.login_ckeck = gtk.CheckButton(_("Enable Auto login"))        
开发者ID:gkso,项目名称:openmonitor-desktop-agent,代码行数:25,代码来源:GeneralPage.py


示例12: __create_widgets

    def __create_widgets(self):
        """"""
        
        self.update_switch_hbox = HIGHBox()
        self.update_settings_hbox = HIGHBox()
        self.update_db_hbox = HIGHBox()

        self.update_switch_section = HIGSectionLabel(_("Update News Detect"))        
        self.update_switch_table = HIGTable()
        self.update_settings_section = HIGSectionLabel(_("Update Settings"))        
        self.update_settings_table = HIGTable()  
        self.update_db_section = HIGSectionLabel(_("Update Database"))        
        self.update_db_table = HIGTable()
        
        self.update_check = gtk.CheckButton(_("Automatically update"))
        self.update_switch_check = gtk.CheckButton(_("Software Update Detect Switch"))
        self.update_times_label = HIGEntryLabel(_("Auto detect update news"))
        self.update_method_label = HIGEntryLabel(_("Update method"))       
        
        self.update_time_store = gtk.ListStore(str)
        self.update_time_entry = gtk.ComboBoxEntry(self.update_time_store, 0)
        self.update_method_store = gtk.ListStore(str)
        self.update_method_entry = gtk.ComboBoxEntry(self.update_method_store, 0)  
        
        self.update_db_label =  HIGEntryLabel()
        self.update_db_clear_button = gtk.Button(_("Clear Update Information")) 
开发者ID:tianweidut,项目名称:openmonitor-desktop-agent,代码行数:26,代码来源:UpdatePage.py


示例13: graph_kind_ui

    def graph_kind_ui(self):
        """
        Graph kind: Line and Area
        """
        modes = _("Line Graph"), _("Area Graph")
        self.combo_graph_kind = gtk.combo_box_new_text()
        self.combo_graph_kind.append_text(_("Select a graph style"))
        
        for mode in modes:
            self.combo_graph_kind.append_text(mode)

        self.combo_graph_kind.set_active(1)
        self.combo_graph_kind.connect('changed',self.change_graph_kind)
        
        return self.packed(self.combo_graph_kind)
开发者ID:gkso,项目名称:openmonitor-desktop-agent,代码行数:15,代码来源:TimeLineGraphToolbar.py


示例14: _create_widgets

    def _create_widgets(self):
        
        self.bug_text = gtk.Label(_("Bug report details that "
                                  "will be send!"))
        
        self.description_scrolled = gtk.ScrolledWindow()
        self.description_text = gtk.TextView()

        # Fill the text entry
        description =  _("Reporter: %s\nSummary: %s\nCategory: %s\n"
                         "Comments: %s\n\nDescription: %s" % 
                         (self._reporter, self._summary, self._category,
                          self._comments, self._description))
        self.description_text.get_buffer().set_text(description.replace("[[BR]]", "\n"))
        self.description_text.set_editable(False)
开发者ID:gkso,项目名称:openmonitor-desktop-agent,代码行数:15,代码来源:BugReport.py


示例15: send_service_suggestion

 def send_service_suggestion(self):
     service_name = self.service_name_entry.child.get_text()
     host_name = self.service_host_entry.get_text()
     ip = self.service_ip_entry.get_text()
     port = int(self.service_port_entry.get_text())
     if service_name == '' or host_name == '' or ip == '' or port == "":
         alert = HIGAlertDialog(message_format=_("Missing fields."),
                                secondary_text=_("Please input all fields "\
                                                 "for service suggestion."))
         alert.run()
         alert.destroy()
         return
     d = theApp.aggregator.send_service_suggestion(service_name, host_name, ip,port)
     d.addCallback(self.show_success)
     d.addErrback(self.show_failed)
开发者ID:gkso,项目名称:openmonitor-desktop-agent,代码行数:15,代码来源:FeedbackPage.py


示例16: _set_details_content

 def _set_details_content(self,content=None):
     if content == None or content == "":
         content = str(_('Open Monitor Alpha is coming soon!\n Designed by UMIT'))
        
     buf = gtk.TextBuffer()
     buf.set_text(content)
     return buf
开发者ID:tianweidut,项目名称:openmonitor-desktop-agent,代码行数:7,代码来源:SoftwareUpdate.py


示例17: _create_widgets

    def _create_widgets(self):
        self.username_label = HIGLabel(_("Username"))
        self.username_entry = gtk.Entry()

        self.password_label = HIGLabel(_("Password"))
        self.password_entry = HIGPasswordEntry()

        self.retype_password_label = HIGLabel(_("Retype password"))
        self.retype_password_entry = HIGPasswordEntry()

        self.registration_icon = gtk.Image()
        self.registration_text = gtk.Label(_("If you don't have an ICM account,"
                "please register a new account."))

        self.hbox = HIGHBox()
        self.table = HIGTable()
开发者ID:gkso,项目名称:openmonitor-desktop-agent,代码行数:16,代码来源:Registration.py


示例18: __create_widgets

    def __create_widgets(self):
        """
        """
        cur_mode = view_mode_descr[self.timeline_base.graph_mode]
        self.select_label = gtk.Label(cur_mode)
        
        values = self.timeline_base.bounds_by_graphmode()
        
        self.date_select = gtk.SpinButton(gtk.Adjustment(value=values[2],
            lower=values[0], upper=values[1], step_incr=1), 1)
        
        ###############
        #Refresh Button
        
        self.tooltips = gtk.Tooltips()
        
        self.refresh_button = gtk.Button()
        self.refresh_button.set_border_width(3)

        self.refresh_button.set_relief(gtk.RELIEF_NONE)
        
        self.tooltips.set_tip(self.refresh_button, _("Graph Refresh"))
        
        img = gtk.Image()
        img.set_from_stock(gtk.STOCK_REFRESH,gtk.ICON_SIZE_BUTTON)
        box = gtk.HBox()
        box.pack_start(img,False,False,0)
        self.refresh_button.add(box)
开发者ID:gkso,项目名称:openmonitor-desktop-agent,代码行数:28,代码来源:TimeLineGraphToolbar.py


示例19: _refresh_list

 def _refresh_list(self):
     """
     clear and load
     """
     self.listmodel.clear()
     self.__load_events()
     self.statusbar.push(0,_("Refresh the Events List!"))  
开发者ID:tianweidut,项目名称:openmonitor-desktop-agent,代码行数:7,代码来源:Event.py


示例20: __init__

 def __init__(self):
     HIGWindow.__init__(self, type=gtk.WINDOW_TOPLEVEL)
     self.set_title(_('OpenMonitor Preferences'))
     self.set_position(gtk.WIN_POS_CENTER_ALWAYS)
             
     self.__create_widgets()
     self.__pack_widgets()
     self.load_preference()
开发者ID:tianweidut,项目名称:openmonitor-desktop-agent,代码行数:8,代码来源:Preference.py



注:本文中的umit.icm.agent.I18N._函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python g_logger.debug函数代码示例发布时间:2022-05-27
下一篇:
Python log.debug函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap