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


Python Project.add_engineer方法代碼示例

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


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

示例1: read_from_json

# 需要導入模塊: from Project import Project [as 別名]
# 或者: from Project.Project import add_engineer [as 別名]
 def read_from_json(filename): # make tasks and return the list
     project = Project()
     with open('houseproject.json') as data_file:
         data = json.load(data_file)
     for task in data['Leafs']:
         leaf_task = Leaf(task['id'],task['label'],task['description'],
                          task['original_hours'],task['revised_hours'],
                          task['percent_complete'],task['est_remaining_hrs'],
                          int(task['est_remaining_workdays']), task['engineers'])
         project.add_task(leaf_task)
     for task in data['Sequential']:
         seq_task = Sequential(task['id'],task['label'],task['description'],
                               task['children'])
         project.add_task(seq_task)
     for task in data['Parallel']:
         par_task = Parallel(task['id'], task['label'],task['description'],
                             task['children'])
         project.add_task(par_task)
     for engr in data['engineers']:
         engineer = Engineer(engr['id'], engr['name'], engr['available_hours'])
         project.add_engineer(engineer)
     project.initialize()
     return project
開發者ID:Craiting,項目名稱:work_breakdown,代碼行數:25,代碼來源:FileLoader.py

示例2: test_add_engineer

# 需要導入模塊: from Project import Project [as 別名]
# 或者: from Project.Project import add_engineer [as 別名]
 def test_add_engineer(self):
     engineer = Engineer(88,"Jameses",5)
     project = Project()
     project.add_engineer(engineer)
     self.assertEqual(len(project.engr_list), 1)
     self.assertEqual(project.get_engineer(88), engineer)
開發者ID:Craiting,項目名稱:work_breakdown,代碼行數:8,代碼來源:tests.py


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