25
25
from xerparser .model .classes .calendar import Calendar
26
26
from xerparser .model .activitiyresources import ActivityResources
27
27
from xerparser .model .taskprocs import TaskProcs
28
+ import locale
28
29
29
30
class Task :
30
31
obj_list = []
@@ -40,7 +41,7 @@ def __init__(self, params, data):
40
41
self .clndr_id = int (params .get ('clndr_id' )) if params .get ('clndr_id' ) else None
41
42
# The physical percent complete can either be user entered or calculated from the activity's weighted steps.
42
43
# There is a project setting specifying this.
43
- self .phys_complete_pct = float (params .get ('phys_complete_pct' )) if 'phys_complete_pct' in params .keys () else None
44
+ self .phys_complete_pct = locale . atof (params .get ('phys_complete_pct' )) if 'phys_complete_pct' in params .keys () else None
44
45
# Indicates that the primary resource has sent feedback notes about this activity which have not been
45
46
# reviewed yet.
46
47
self .rev_fdbk_flag = params .get ('rev_fdbk_flag' ) if params .get ('rev_fdbk_flag' ) else None
@@ -49,7 +50,7 @@ def __init__(self, params, data):
49
50
# the same WBS. Top-down estimation distributes estimated units in a top-down manner to activities using the
50
51
# WBS hierarchy.
51
52
52
- self .est_wt = float (params .get ('est_wt' ).strip ()) if 'est_wt' in params .keys () else None
53
+ self .est_wt = locale . atof (params .get ('est_wt' ).strip ()) if 'est_wt' in params .keys () else None
53
54
# Indicates that the planned labor and nonlabor units for the activity will not be modified by top-down
54
55
# estimation.
55
56
self .lock_plan_flag = params .get ('lock_plan_flag' ) if params .get ('lock_plan_flag' ) else None
@@ -94,37 +95,37 @@ def __init__(self, params, data):
94
95
# The amount of time the wbs can be delayed before delaying the project finish date. Total int can be
95
96
# computed as Late Start - Early Start or as Late Finish - Early Finish; this option can be set when running
96
97
# the project scheduler.
97
- self .total_float_hr_cnt = float (params .get ('total_float_hr_cnt' ).strip ()) if params .get ('total_float_hr_cnt' ) and \
98
+ self .total_float_hr_cnt = locale . atof (params .get ('total_float_hr_cnt' ).strip ()) if params .get ('total_float_hr_cnt' ) and \
98
99
params .get ('total_float_hr_cnt' ) != '' else None
99
100
# The amount of time the activity can be delayed before delaying the start date of any successor activity.
100
- self .free_float_hr_cnt = float (params .get ('free_float_hr_cnt' )) if params .get ('free_float_hr_cnt' ) else None
101
+ self .free_float_hr_cnt = locale . atof (params .get ('free_float_hr_cnt' )) if params .get ('free_float_hr_cnt' ) else None
101
102
# Remaining duration is the total working time from the activity remaining start date to the remaining finish
102
103
# date. The remaining working time is computed using the activity's calendar. Before the activity is
103
104
# started, the remaining duration is the same as the Original Duration. After the activity is completed the
104
105
# remaining duration is zero.
105
- self .remain_drtn_hr_cnt = float (params .get ('remain_drtn_hr_cnt' ).strip ()) if params .get ('remain_drtn_hr_cnt' ) else 0
106
+ self .remain_drtn_hr_cnt = locale . atof (params .get ('remain_drtn_hr_cnt' ).strip ()) if params .get ('remain_drtn_hr_cnt' ) else 0
106
107
# The total actual labor units for all child activities
107
- self .act_work_qty = float (params .get ('act_work_qty' )) if params .get ('act_work_qty' ) else None
108
+ self .act_work_qty = locale . atof (params .get ('act_work_qty' )) if params .get ('act_work_qty' ) else None
108
109
# The remaining units for all labor resources assigned to the activity. The remaining units reflects the work
109
110
# remaining to be done for the activity. Before the activity is started, the remaining units are the same as
110
111
# the planned units. After the activity is completed, the remaining units are zero.
111
- self .remain_work_qty = float (params .get ('remain_work_qty' )) if params .get ('remain_work_qty' ) else None
112
+ self .remain_work_qty = locale . atof (params .get ('remain_work_qty' )) if params .get ('remain_work_qty' ) else None
112
113
# The planned units for all labor resources assigned to the activity.
113
- self .target_work_qty = float (params .get ('target_work_qty' )) if params .get ('target_work_qty' ) else None
114
+ self .target_work_qty = locale . atof (params .get ('target_work_qty' )) if params .get ('target_work_qty' ) else None
114
115
# Original Duration is the planned working time for the resource assignment on the activity,
115
116
# from the resource's planned start date to the planned finish date. The planned working time is computed
116
117
# using the calendar determined by the Activity Type. Resource Dependent activities use the resource's
117
118
# calendar; other activity types use the activity's calendar. This is the duration that Timesheets users
118
119
# follow and the schedule variance is measured against.
119
- self .target_drtn_hr_cnt = float (params .get ('target_drtn_hr_cnt' ).strip ()) if params .get ('target_drtn_hr_cnt' ) else None
120
+ self .target_drtn_hr_cnt = locale . atof (params .get ('target_drtn_hr_cnt' ).strip ()) if params .get ('target_drtn_hr_cnt' ) else None
120
121
# The planned units for all nonlabor resources assigned to the activity.
121
- self .target_equip_qty = float (params .get ('target_equip_qty' )) if params .get ('target_equip_qty' ) else None
122
+ self .target_equip_qty = locale . atof (params .get ('target_equip_qty' )) if params .get ('target_equip_qty' ) else None
122
123
# The actual units for all nonlabor resources assigned to the activities under the WBS.
123
- self .act_equip_qty = float (params .get ('act_equip_qty' )) if params .get ('act_equip_qty' ) else None
124
+ self .act_equip_qty = locale . atof (params .get ('act_equip_qty' )) if params .get ('act_equip_qty' ) else None
124
125
# The remaining units for all nonlabor resources assigned to the activity. The remaining units reflects the
125
126
# work remaining to be done for the activity. Before the activity is started, the remaining units are the
126
127
# same as the planned units. After the activity is completed, the remaining units are zero.
127
- self .remain_equip_qty = float (params .get ('remain_equip_qty' )) if params .get ('remain_equip_qty' ) else None
128
+ self .remain_equip_qty = locale . atof (params .get ('remain_equip_qty' )) if params .get ('remain_equip_qty' ) else None
128
129
# The constraint date for the activity, if the activity has a constraint. The activity's constraint type
129
130
# determines whether this is a start date or finish date. Activity constraints are used by the project
130
131
# scheduler.
@@ -192,9 +193,9 @@ def __init__(self, params, data):
192
193
self .cstr_type2 = params .get ('cstr_type2' ).strip () if params .get ('cstr_type2' ) else None
193
194
self .driving_path_flag = params .get ('driving_path_flag' ) if params .get ('driving_path_flag' ) else None
194
195
# The actual this period units for all labor resources assigned to the activity.
195
- self .act_this_per_work_qty = float (params .get ('act_this_per_work_qty' )) if params .get ('act_this_per_work_qty' ) else None
196
+ self .act_this_per_work_qty = locale . atof (params .get ('act_this_per_work_qty' )) if params .get ('act_this_per_work_qty' ) else None
196
197
# The actual this period units for all nonlabor resources assigned to the activity.
197
- self .act_this_per_equip_qty = float (params .get ('act_this_per_equip_qty' )) if params .get ('act_this_per_equip_qty' ) else None
198
+ self .act_this_per_equip_qty = locale . atof (params .get ('act_this_per_equip_qty' )) if params .get ('act_this_per_equip_qty' ) else None
198
199
# The External Early Start date is the date the external relationship was scheduled to finish. This date may
199
200
# be used to calculate the start date of the current activity during scheduling. This field is populated on
200
201
# import when an external relationship is lost.
0 commit comments