当前位置: 首页>>代码示例>>Python>>正文


Python lng._函数代码示例

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


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

示例1: __init__

 def __init__(self, par, menu=None):
     gtk.TreeView.__init__(self)
     self.par = par
     self.menuId = menu.getLocalId()
     
     self.store = MenuItemStore(gtk.gdk.Pixbuf,str,int,int,parent=self.par, objectStore = self.getApplication().getObjectStore(),menu=menu)
     
     self.set_model(self.store)
     self.col_name = gtk.TreeViewColumn(_("MenuItem"))
     self.col_order = gtk.TreeViewColumn(_("Order"))
     self.append_column(self.col_name)
     self.append_column(self.col_order)
     self.renderer_icon = gtk.CellRendererPixbuf()
     self.renderer_name = gtk.CellRendererText()
     self.renderer_order = gtk.CellRendererText()
     self.renderer_name.set_property('editable',True)
     self.col_name.pack_start(self.renderer_icon,False)
     self.col_name.pack_start(self.renderer_name,True)
     self.col_order.pack_start(self.renderer_order,True)
     self.col_name.add_attribute(self.renderer_icon,'pixbuf',0)
     self.col_name.add_attribute(self.renderer_name,'text',1)
     self.col_order.add_attribute(self.renderer_order,'text',3)
     self.renderer_name.connect('edited', self.renamedCallback)
     self.set_reorderable(True)
     
     self.col_order.set_sort_column_id(2)
     self.col_order.set_sort_order(gtk.SORT_DESCENDING)
     self.store.emit("sort_column_changed")
     
     self.set_search_column(1)
开发者ID:skarphed,项目名称:skarphed,代码行数:30,代码来源:Menu.py

示例2: __init__

    def __init__(self, par, repo):
        self.par = par
        gtk.ScrolledWindow.__init__(self)
        self.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)

        self.treeview = gtk.TreeView()
        self.store = gtk.ListStore(gtk.gdk.Pixbuf, str, str, str, int)
        self.treeview.set_model(self.store)
        self.repoId = repo.getLocalId()

        self.col_name = gtk.TreeViewColumn(_("Template"))
        self.col_description = gtk.TreeViewColumn(_("Description"))
        self.col_author = gtk.TreeViewColumn(_("Author"))
        self.ren_icon = gtk.CellRendererPixbuf()
        self.ren_name = gtk.CellRendererText()
        self.ren_description = gtk.CellRendererText()
        self.ren_author = gtk.CellRendererText()
        self.col_name.pack_start(self.ren_icon, False)
        self.col_name.pack_start(self.ren_name, False)
        self.col_description.pack_start(self.ren_description, True)
        self.col_author.pack_start(self.ren_author, False)
        self.col_name.add_attribute(self.ren_icon, "pixbuf", 0)
        self.col_name.add_attribute(self.ren_name, "text", 1)
        self.col_description.add_attribute(self.ren_description, "text", 2)
        self.col_author.add_attribute(self.ren_author, "text", 3)
        self.treeview.append_column(self.col_name)
        self.treeview.append_column(self.col_description)
        self.treeview.append_column(self.col_author)
        self.add(self.treeview)

        repo.addCallback(self.render)
        self.show_all()
        self.render()
开发者ID:skarphed,项目名称:skarphed,代码行数:33,代码来源:Skarphed_repo.py

示例3: render

    def render(self):
        try:
            view = self.getApplication().getLocalObjectById(self.viewId)
        except GenericObjectStoreException:
            self.destroy()
            return
        site = view.getPage()
        if self.spaceId is not None: # In case, this space is a real space
            spaceName = site.getNameOfSpace(self.spaceId)
            self.framelabel.setText(_("Space: ")+spaceName)
            spaceWidgetMapping = view.getSpaceWidgetMapping()
            try:
                widgetId = spaceWidgetMapping[str(self.spaceId)]
            except KeyError:
                widget = None
                widgetId = None
            else:
                widget = view.getViews().getSkarphed().getModules().getWidgetById(widgetId)
        else: #In case this space is only part of a box
            self.framelabel.setText(_("BoxSpace"))
            boxmapping = self.getPar().getPar().getTemporaryBoxContent()
            try:
                widgetId = boxmapping[self.orderNumber]
            except KeyError:
                widget = None
                widgetId = None
            else:
                widget = view.getViews().getSkarphed().getModules().getWidgetById(widgetId)

        self.widgetId = widgetId
        self.widget_combo.setSelected(widget)
        self.param_widget.setWidget(widget)
        self.param_widget.render()
开发者ID:skarphed,项目名称:skarphed,代码行数:33,代码来源:View.py

示例4: __init__

    def __init__(self,parent):
        gtk.Menu.__init__(self)

        self.par = parent

        self.objId = None

        ca_image = gtk.Image()
        ca_image.set_from_stock(gtk.STOCK_CLOSE,gtk.ICON_SIZE_MENU) 
        ca_item = gtk.ImageMenuItem()
        ca_item.set_image(ca_image)
        gtk.MenuItem.__init__(ca_item, _("Close all tabs"))
        ca_item.connect("activate", self.closeAll)
        self.append(ca_item)

        ct_image = gtk.Image()
        ct_image.set_from_stock(gtk.STOCK_CLOSE,gtk.ICON_SIZE_MENU) 
        ct_item = gtk.ImageMenuItem()
        ct_item.set_image(ct_image)
        gtk.MenuItem.__init__(ct_item, _("Close this tab"))
        ct_item.connect("activate", self.closeThis)
        self.append(ct_item)

        co_image = gtk.Image()
        co_image.set_from_stock(gtk.STOCK_CLOSE,gtk.ICON_SIZE_MENU) 
        co_item = gtk.ImageMenuItem()
        co_item.set_image(co_image)
        gtk.MenuItem.__init__(co_item, _("Close other tabs"))
        co_item.connect("activate", self.closeOther)
        self.append(co_item)

        self.show_all()
开发者ID:skarphed,项目名称:skarphed,代码行数:32,代码来源:Tabs.py

示例5: __init__

    def __init__(self, parent):
        gtk.Frame.__init__(self, _("Create a new profile"))
        self.par=parent

        self.fixed = gtk.Fixed()
        
        self.l_user = gtk.Label(_("User"))
        self.e_user = DefaultEntry(default_message=_("username"))
        self.l_password = gtk.Label(_("Password"))
        self.e_password = gtk.Entry()
        self.l_password_r = gtk.Label (_("Repeat password"))
        self.e_password_r = gtk.Entry()
        self.ok = gtk.Button(stock=gtk.STOCK_OK)
        
        self.e_password.set_invisible_char("●")
        self.e_password_r.set_invisible_char("●")
        self.e_password.set_visibility(False)
        self.e_password_r.set_visibility(False)
        
        self.fixed.put(self.l_user,10,10)
        self.fixed.put(self.e_user,110,10)
        self.fixed.put(self.l_password,10,35)
        self.fixed.put(self.e_password,110,35)
        self.fixed.put(self.l_password_r,10,60)
        self.fixed.put(self.e_password_r,110,60)
        self.fixed.put(self.ok,110,85)

        self.add(self.fixed)
        
        self.ok.connect("clicked", self.cb_OK)
开发者ID:skarphed,项目名称:skarphed,代码行数:30,代码来源:LoginPage.py

示例6: __init__

    def __init__(self, par, skarphed):
        ActionRenderContext.__init__(self, par,skarphed)

        self.addAction(_('Destroy...'), IconStock.DELETE, self.destroyInstance)
        self.addAction(_('Remove...'), IconStock.DELETE, self.removeInstance)
        self.addAction(_('CSS Editor...'), IconStock.CSS, self.cssEditor)
        self.addAction(_('Update Modules'), IconStock.MODULE_UPDATEABLE, self.updateModules)
开发者ID:skarphed,项目名称:skarphed,代码行数:7,代码来源:ActionRenderContext.py

示例7: __init__

    def __init__(self,par,server):
        self.par = par
        gtk.Frame.__init__(self, _("Skarphed Admin :: Register Database"))

        self.serverId = server.getLocalId()

        self.table = gtk.Table(4,2,False)
        self.instruction = gtk.Label(_("Please enter DBA-Credentials here:"))
        self.dba_user_label = gtk.Label(_("DBA-User:"))
        self.dba_pass_label = gtk.Label(_("Password:"))
        self.dba_user_entry = DefaultEntry(default_message="SYSDBA")
        self.dba_pass_entry = DefaultEntry(default_message=_("password"))
        self.buttonhbox = gtk.HBox()
        self.cancel = gtk.Button(stock=gtk.STOCK_CLOSE)
        self.ok = gtk.Button(stock=gtk.STOCK_OK)
        self.buttonhbox.add(self.cancel)
        self.buttonhbox.add(self.ok)
        
        self.table.attach(self.instruction,0,2,0,1)
        self.table.attach(self.dba_user_label,0,1,1,2)
        self.table.attach(self.dba_user_entry,1,2,1,2)
        self.table.attach(self.dba_pass_label,0,1,2,3)
        self.table.attach(self.dba_pass_entry,1,2,2,3)
        self.table.attach(self.buttonhbox,1,2,3,4)

        self.ok.connect("clicked", self.cb_Ok)
        self.cancel.connect("clicked", self.cb_Cancel)
        self.connect("delete-event", self.cb_Cancel)

        server.addCallback(self.render)

        self.table.set_border_width(10)
        self.add(self.table)
        self.getApplication().getMainWindow().openDialogPane(self)
开发者ID:skarphed,项目名称:skarphed,代码行数:34,代码来源:NewDatabasePage.py

示例8: __init__

    def __init__(self, parent,  view, spaceId=None, boxId=None, orderNumber=None):
        gtk.Frame.__init__(self)

        self.par = parent
        self.viewId = view.getLocalId()
        self.spaceId = spaceId
        self.boxId = boxId
        self.orderNumber = orderNumber
        self.widgetId = None

        self.vbox = gtk.VBox()
        self.hbox = gtk.HBox(spacing=10)
        self.framelabel = FrameLabel(self,_("Space: "), IconStock.SPACE)
        self.set_label_widget(self.framelabel)
        self.spacelabel = gtk.Label(_("Widget in this Space:"))

        self.widget_combo = ObjectCombo(self, \
                                Widget, \
                                virtualRootObject=view.getViews().getSkarphed().getModules(), \
                                noneElement=True)
        self.widget_combo.connect("changed", self.cb_changed)
        self.expander = gtk.Expander()
        self.expander.set_label_widget(gtk.Label(_("Edit Widget Parameters")))
        self.param_widget = ParamWidget(self, view)
        self.expander.add(self.param_widget)
        self.hbox.pack_start(self.spacelabel,False)
        self.hbox.pack_start(self.widget_combo,False)
        self.vbox.pack_start(self.hbox,False)
        self.vbox.pack_start(self.expander,False)
        self.add(self.vbox)

        self.show_all()
        self.render()
开发者ID:skarphed,项目名称:skarphed,代码行数:33,代码来源:View.py

示例9: errorMessage

 def errorMessage(msgId):
     msgs = (_("This is not a valid int number"),
             _("Empty input is not valid")
             )
     dia = gtk.MessageDialog(parent=None, flags=0, type=gtk.MESSAGE_WARNING, \
                           buttons=gtk.BUTTONS_OK, message_format=msgs[msgId])
     dia.run()
     dia.destroy()
开发者ID:skarphed,项目名称:skarphed,代码行数:8,代码来源:InputBox.py

示例10: __init__

 def __init__(self,*args,**kwargs):
     '''Constructor --'''
     assert kwargs['objectStore'] is not None, _("Need ObjectStore")
     gtk.TreeStore.__init__(self,*args)
     self.par = kwargs['parent']
     self.objectStore  = kwargs['objectStore']
     self.objectStore.setMainTreeCallback(self.render)
     self.busy = False # Prevent threadcollisions 
     root = self.append(None,(IconStock.SKARPHED,_("Skarphed Infrastructure"),-2))
开发者ID:skarphed,项目名称:skarphed,代码行数:9,代码来源:Store.py

示例11: render

 def render(self):
     try:
         action = self.getApplication().getLocalObjectById(self.actionId)
     except GenericObjectStoreException:
         self.getPar().destroy()
         return
     if action.data['type'] == 'url':
         self.actionDisplay.set_text(_('Goto URL: ')+str(action.data['url']))
     elif action.data['type'] == 'widgetSpaceConstellation':
         self.actionDisplay.set_text(_('Move Widget ')+str(action.data['widgetId'])+_(' into Space ')+str(action.data['space']))
     elif action.data['type'] == 'site':
         self.actionDisplay.set_text(_('Goto Site ')+str(action.data['siteId']))
开发者ID:skarphed,项目名称:skarphed,代码行数:12,代码来源:Menu.py

示例12: __init__

 def __init__(self,parent,role):
     ObjectPageAbstract.__init__(self,parent,role)
     self.roleId = role.getLocalId()
     role.fetchPermissions()
     
     self.headline = gtk.Label()
     self.pack_start(self.headline,False)
     
     self.info = PageFrame(self,_("Information"), IconStock.ROLE)
     self.infobox = gtk.VBox()
     self.info.add(self.infobox)
     self.pack_start(self.info,False)
     
     self.perm = PageFrame(self,_("Permissions"), IconStock.PERMISSION)
     self.permbox = gtk.Table(1,2,False)
     self.permbox.set_row_spacings(10)
     self.permbox.set_col_spacings(10)
     self.permbox.set_border_width(10)
     
     self.perm_permlabel = FrameLabel(self,_("Please choose the Permissions you want to assign to the user here:"), IconStock.PERMISSION)
     
     self.perm_permlistview = gtk.TreeView()
     self.perm_permlist = gtk.ListStore(int, str,str)
     self.perm_permlistview.set_model(self.perm_permlist)
     self.perm_permlist_col_checkbox = gtk.TreeViewColumn('')
     self.perm_permlist_col_identifier = gtk.TreeViewColumn(_('Permission Identifier'))
     self.perm_permlist_col_name = gtk.TreeViewColumn(_('Permission Name'))
     self.perm_permlistview.append_column(self.perm_permlist_col_checkbox)
     self.perm_permlistview.append_column(self.perm_permlist_col_identifier)
     self.perm_permlistview.append_column(self.perm_permlist_col_name)
     self.perm_permlist_renderer_checkbox= gtk.CellRendererToggle()
     self.perm_permlist_renderer_identifier = gtk.CellRendererText()
     self.perm_permlist_renderer_name = gtk.CellRendererText()
     
     self.perm_permlist_col_checkbox.pack_start(self.perm_permlist_renderer_checkbox)
     self.perm_permlist_col_identifier.pack_start(self.perm_permlist_renderer_identifier)
     self.perm_permlist_col_name.pack_start(self.perm_permlist_renderer_name)
     self.perm_permlist_col_checkbox.add_attribute(self.perm_permlist_renderer_checkbox,'active',0)
     self.perm_permlist_col_identifier.add_attribute(self.perm_permlist_renderer_identifier,'text',1)
     self.perm_permlist_col_name.add_attribute(self.perm_permlist_renderer_name,'text',2)
     self.perm_permlist_renderer_checkbox.set_activatable(True)
     self.perm_permlist_renderer_checkbox.connect("toggled",self.toggledRight)
     
     self.permbox.attach(self.perm_permlabel,0,1,0,1)
     self.permbox.attach(self.perm_permlistview,0,1,1,2)
     
     self.perm.add(self.permbox)
     self.pack_start(self.perm,False)
     
     self.show_all()
     
     self.render()
开发者ID:skarphed,项目名称:skarphed,代码行数:52,代码来源:Role.py

示例13: __init__

 def __init__(self, par, obj):
     gtk.Window.__init__(self)
     self.par = par
     self.objId = obj.getLocalId()
     
     self.set_title(_("Skarphed Admin :: CssEditor :: ")+obj.getName())
     self.set_icon(IconStock.CSS)
     self.set_size_request(600,500)
     
     self.set_border_width(10)
     self.cssframe = PageFrame(self,_("Css-Properties"),CSS)
     self.label = gtk.Label(_("Edit CSS Settings for ")+obj.getName())
     self.store = CssStore(str, str, str, bool, bool, parent=self)
     self.listview = CssView(self)
     self.listview.set_model(self.store)
     self.listviewscroll = gtk.ScrolledWindow()
     self.listviewscroll.set_policy(gtk.POLICY_AUTOMATIC,gtk.POLICY_AUTOMATIC)
     self.vbox = gtk.VBox()
     self.framevbox = gtk.VBox()
     
     self.toolbar = gtk.Toolbar()
     self.tool_add=gtk.ToolButton()
     self.tool_add.set_stock_id(gtk.STOCK_ADD)
     self.tool_add.connect("clicked",self.addCallback)
     self.toolbar.add(self.tool_add)
     self.tool_save = gtk.ToolButton()
     self.tool_save.set_stock_id(gtk.STOCK_SAVE)
     self.tool_save.connect("clicked",self.saveCallback)
     self.toolbar.add(self.tool_save)
     self.vbox.pack_start(self.toolbar,False)
     self.tool_refresh = gtk.ToolButton()
     self.tool_refresh.set_stock_id(gtk.STOCK_REFRESH)
     self.tool_refresh.connect("clicked",self.refreshCallback)
     self.toolbar.add(self.tool_refresh)
     
     self.listviewscroll.add(self.listview)
     self.framevbox.pack_start(self.label,False)
     self.framevbox.pack_start(self.listviewscroll,True)
     self.cssframe.add(self.framevbox)
     
     self.vbox.pack_start(self.cssframe,True)
     self.add(self.vbox)
     
     self.connect("delete-event",self.closeCallback)
     
     self.show_all()
     
     obj.addCallback(self.render)
     obj.loadCssPropertySet()
开发者ID:skarphed,项目名称:skarphed,代码行数:49,代码来源:CssEditor.py

示例14: __init__

 def __init__(self, parent, server=None):
     '''Constructor --'''
     gtk.TreeView.__init__(self)
     self.par = parent
     
     #self.context = MatchTreeContextMenu(self.app,self)
     
     if server is not None:
         self.serverId = server.getLocalId()
         self.store = OperationStore(gtk.gdk.Pixbuf, gtk.gdk.Pixbuf, str,str ,int, parent=self.par, server=server, objectStore=self.getApplication().getObjectStore()) #Icon, Name, ID, type
     else:
         self.serverId = None
         self.store = OperationStore(gtk.gdk.Pixbuf, gtk.gdk.Pixbuf, str,str ,int, parent=self.par, objectStore=self.getApplication().getObjectStore()) #Icon, Name, ID, type
     self.context = TreeContextMenu(self)
     self.set_model(self.store)
     
     
     self.col_active = gtk.TreeViewColumn('')
     self.col_name = gtk.TreeViewColumn(_("Operation"))
     self.col_invoked = gtk.TreeViewColumn(_("Invoked"))
     self.append_column(self.col_active)
     self.append_column(self.col_name)
     self.append_column(self.col_invoked)
     self.renderer_active = gtk.CellRendererPixbuf()
     self.renderer_name = gtk.CellRendererText()
     self.renderer_icon = gtk.CellRendererPixbuf()
     self.renderer_invoked = gtk.CellRendererText()
     
     self.col_active.pack_start(self.renderer_active,False)
     self.col_name.pack_start(self.renderer_icon,False)
     self.col_name.pack_start(self.renderer_name,True)
     self.col_invoked.pack_start(self.renderer_invoked,True)
     self.col_active.add_attribute(self.renderer_active,'pixbuf',0)
     self.col_name.add_attribute(self.renderer_icon,'pixbuf',1)
     self.col_name.add_attribute(self.renderer_name,'text',2)
     self.col_invoked.add_attribute(self.renderer_invoked,'text',3)
     #self.col_name.set_cell_data_func(self.renderer_id,self.renderId)
     
     self.col_name.set_sort_column_id(1)
     self.col_invoked.set_resizable(True)
     self.col_name.set_resizable(True)
     self.set_search_column(1)
     self.set_rules_hint(True)
     
     
     #self.connect("row-activated",self.cb_RowActivated)
     #self.connect("row-expanded",self.cb_RowExpanded)
     self.connect("button_press_event",self.cb_ButtonPressed)
开发者ID:skarphed,项目名称:skarphed,代码行数:48,代码来源:OperationTree.py

示例15: __init__

 def __init__(self,*args,**kwargs):
     '''Constructor --'''
     assert kwargs['objectStore'] is not None, _("Need ObjectStore")
     gtk.TreeStore.__init__(self,*args)
     self.par = kwargs['parent']
     self.objectStore  = kwargs['objectStore']
     
     if kwargs['server'] is not None:
         self.server = kwargs['server']
         self.server.getOperationManager().addCallback(self.render)
     else:
         self.server = None
         self.objectStore.addCallback(self.render)
             
     self.busy = False # Prevent threadcollisions 
     self.root = self.append(None,(IconStock.ERROR,IconStock.OPERATION,_("Operationtree"),"",-2))
开发者ID:skarphed,项目名称:skarphed,代码行数:16,代码来源:OperationStore.py


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