當前位置: 首頁>>代碼示例>>Python>>正文


Python TreeNode.__init__方法代碼示例

本文整理匯總了Python中liblarch.TreeNode.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python TreeNode.__init__方法的具體用法?Python TreeNode.__init__怎麽用?Python TreeNode.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在liblarch.TreeNode的用法示例。


在下文中一共展示了TreeNode.__init__方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from liblarch import TreeNode [as 別名]
# 或者: from liblarch.TreeNode import __init__ [as 別名]
    def __init__(self, ze_id, requester, newtask=False):
        TreeNode.__init__(self, ze_id)
        # the id of this task in the project should be set
        # tid is a string ! (we have to choose a type and stick to it)
        assert(isinstance(ze_id, str) or isinstance(ze_id, str))
        self.tid = str(ze_id)
        self.set_uuid(uuid.uuid4())
        self.remote_ids = {}
        self.content = ""
        self.title = _("My new task")
        # available status are: Active - Done - Dismiss - Note
        self.status = self.STA_ACTIVE
        self.closed_date = Date.no_date()
        self.due_date = Date.no_date()
        self.start_date = Date.no_date()
        self.can_be_deleted = newtask
        # tags
        self.tags = []
        self.req = requester
        self.__main_treeview = requester.get_main_view()
        # If we don't have a newtask, we will have to load it.
        self.loaded = newtask
        # Should not be necessary with the new backends
#        if self.loaded:
#            self.req._task_loaded(self.tid)
        self.attributes = {}
        self._modified_update()
開發者ID:kunaaljain,項目名稱:gtg,代碼行數:29,代碼來源:task.py

示例2: __init__

# 需要導入模塊: from liblarch import TreeNode [as 別名]
# 或者: from liblarch.TreeNode import __init__ [as 別名]
    def __init__(self, name, req, attributes={}):
        """Construct a tag.

        @param name: The name of the tag. Should be a string, generally
            a short one.
        @param attributes: Allow having initial set of attributes without
            calling _save callback
        """
        TreeNode.__init__(self, name)
        self._name = saxutils.unescape(str(name))
        self.req = req
        self._save = None
        self._attributes = {'name': self._name}
        for key, value in attributes.iteritems():
            self.set_attribute(key, value)

        self.viewcount = None
開發者ID:lefred,項目名稱:backend_gtgonline,代碼行數:19,代碼來源:tag.py

示例3: __init__

# 需要導入模塊: from liblarch import TreeNode [as 別名]
# 或者: from liblarch.TreeNode import __init__ [as 別名]
 def __init__(self, tid, label,viewtree):
     TreeNode.__init__(self, tid)
     self.label = label
     self.tid = tid
     self.vt = viewtree
開發者ID:panks,項目名稱:liblarch,代碼行數:7,代碼來源:main.py

示例4: __init__

# 需要導入模塊: from liblarch import TreeNode [as 別名]
# 或者: from liblarch.TreeNode import __init__ [as 別名]
 def __init__(self,node_id):
     TreeNode.__init__(self,node_id)
     #A team cannot have parents. This is arbitrarly done for the purpose
     #of this example.
     self.set_parents_enabled(False)
開發者ID:broussea,項目名稱:liblarch,代碼行數:7,代碼來源:contact_list.py

示例5: __init__

# 需要導入模塊: from liblarch import TreeNode [as 別名]
# 或者: from liblarch.TreeNode import __init__ [as 別名]
 def __init__(self,tid):
     TreeNode.__init__(self, tid)
     self.colors = []
開發者ID:panks,項目名稱:liblarch,代碼行數:5,代碼來源:test.py


注:本文中的liblarch.TreeNode.__init__方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。