Skip to content

Commit

Permalink
Fix bad references to six.u to six.text_type. (#190)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesVaughan authored Jun 29, 2022
1 parent b655766 commit b728b91
Show file tree
Hide file tree
Showing 98 changed files with 245 additions and 229 deletions.
8 changes: 4 additions & 4 deletions TMGToolbox.pyproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
<Compile Include="src\assignment\preprocessing\check_scenario_functions.py" />
<Compile Include="src\assignment\preprocessing\flag_premium_buses.py" />
<Compile Include="src\assignment\preprocessing\import_v3_boarding_penalty.py" />
<Compile Include="src\assignment\preprocessing\remove_redundant_functions.py" />
<Compile Include="src\assignment\preprocessing\set_walk_speed.py" />
<Compile Include="src\assignment\road\tolled\toll_attribute.py" />
<Compile Include="src\assignment\road\tolled\toll_attribute_transit_background.py" />
Expand All @@ -83,7 +84,6 @@
<Compile Include="src\common\utilities.py" />
<Compile Include="src\execute_python_script.py" />
<Compile Include="src\input_output\export_binary_matrix.py" />
<Compile Include="src\input_output\export_distance_matrix.py" />
<Compile Include="src\input_output\export_network_package.py" />
<Compile Include="src\input_output\import_binary_matrix.py" />
<Compile Include="src\input_output\import_network_package.py" />
Expand All @@ -99,6 +99,7 @@
<SubType>Code</SubType>
</Compile>
<Compile Include="src\license.py" />
<Compile Include="src\logbook\search_logbook_attributes.py" />
<Compile Include="src\network_editing\calculate_station_frequencies.py" />
<Compile Include="src\network_editing\centroid_connectors\CCGEN.py" />
<Compile Include="src\network_editing\centroid_connectors\copy_zone_system.py" />
Expand All @@ -111,9 +112,7 @@
<Compile Include="src\network_editing\GTFS_utilities\GTFS_EMME_node_map.py">
<SubType>Code</SubType>
</Compile>
<Compile Include="src\network_editing\attribute_changer.py">
<SubType>Code</SubType>
</Compile>
<Compile Include="src\network_editing\line_set_conjoiner.py" />
<Compile Include="src\network_editing\NCS11\conversion\convert_ncs16_ncs11.py" />
<Compile Include="src\network_editing\NCS22\convert_between_ncs_scenarios.py" />
<Compile Include="src\network_editing\remove_extra_links.py">
Expand Down Expand Up @@ -212,6 +211,7 @@
<Folder Include="src\assignment\transit" />
<Folder Include="src\common" />
<Folder Include="src\input_output" />
<Folder Include="src\logbook\" />
<Folder Include="src\network_editing" />
<Folder Include="src\network_editing\centroid_connectors" />
<Folder Include="src\network_editing\GTFS_utilities" />
Expand Down
2 changes: 1 addition & 1 deletion TMGToolbox/src/XTMF_internal/apply_batch_line_edits.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def _ApplyLineChanges(self, inputData):
def percent_completed(self):
return self.TRACKER.getProgress()

@_m.method(return_type=six.u)
@_m.method(return_type=six.text_type)
def tool_run_msg_status(self):
return self.tool_run_msg

2 changes: 1 addition & 1 deletion TMGToolbox/src/XTMF_internal/export_network_batch_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def _Execute(self, scenario, filename):
def percent_completed(self):
return self.TRACKER.getProgress()

@_m.method(return_type=six.u)
@_m.method(return_type=six.text_type)
def tool_run_msg_status(self):
return self.tool_run_msg

2 changes: 1 addition & 1 deletion TMGToolbox/src/XTMF_internal/export_worksheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def page(self):
def percent_completed(self):
return self.TRACKER.getProgress()

@_m.method(return_type=six.u)
@_m.method(return_type=six.text_type)
def tool_run_msg_status(self):
return self.tool_run_msg

Expand Down
2 changes: 1 addition & 1 deletion TMGToolbox/src/XTMF_internal/import_from_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def _RetrieveFunctionIds(self):
def percent_completed(self):
return self.TRACKER.getProgress()

@_m.method(return_type=six.u)
@_m.method(return_type=six.text_type)
def tool_run_msg_status(self):
return self.tool_run_msg

6 changes: 3 additions & 3 deletions TMGToolbox/src/XTMF_internal/multi_class_road_assignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -854,17 +854,17 @@ def _getChangeLinkVDFto98Spec(self):
def percent_completed(self):
return self._tracker.getProgress()

@_m.method(return_type=six.u)
@_m.method(return_type=six.text_type)
def tool_run_msg_status(self):
return self.tool_run_msg

@_m.method(return_type=six.u)
@_m.method(return_type=six.text_type)
def _GetSelectAttributeOptionsHTML(self):
list = []

for att in self.Scenario.extra_attributes():
if not att.type == 'LINK': continue
label = "{id} ({domain}) - {name}".format(id=att.name, domain=att.type, name=att.description)
html = unicode('<option value="{id}">{text}</option>'.format(id=att.name, text=label))
html = '<option value="{id}">{text}</option>'.format(id=att.name, text=label)
list.append(html)
return "\n".join(list)
2 changes: 1 addition & 1 deletion TMGToolbox/src/XTMF_internal/return_boarding_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def _GetLineResults(self, scenario, iBoardAttributeId, tBoardAttributeId):
def percent_completed(self):
return self.TRACKER.getProgress()

@_m.method(return_type=six.u)
@_m.method(return_type=six.text_type)
def tool_run_msg_status(self):
return self.tool_run_msg

Expand Down
2 changes: 1 addition & 1 deletion TMGToolbox/src/XTMF_internal/return_boardings.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def _CheckAggregationFile(self, netSet, lineAggregation):
def percent_completed(self):
return self.TRACKER.getProgress()

@_m.method(return_type=six.u)
@_m.method(return_type=six.text_type)
def tool_run_msg_status(self):
return self.tool_run_msg

2 changes: 1 addition & 1 deletion TMGToolbox/src/XTMF_internal/return_boardings_and_WAW.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def _SumWalkAllWayMatrix(self, wawMatrixId, scenario):
def percent_completed(self):
return self.TRACKER.getProgress()

@_m.method(return_type=six.u)
@_m.method(return_type=six.text_type)
def tool_run_msg_status(self):
return self.tool_run_msg

Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def _OutputResults(self, valueDict):
def percent_completed(self):
return self.TRACKER.getProgress()

@_m.method(return_type=six.u)
@_m.method(return_type=six.text_type)
def tool_run_msg_status(self):
return self.tool_run_msg

2 changes: 1 addition & 1 deletion TMGToolbox/src/XTMF_internal/return_grouped_boardings.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def _GetLineTypes(self, scenario):
def percent_completed(self):
return self.TRACKER.getProgress()

@_m.method(return_type=six.u)
@_m.method(return_type=six.text_type)
def tool_run_msg_status(self):
return self.tool_run_msg

2 changes: 1 addition & 1 deletion TMGToolbox/src/XTMF_internal/return_matrix_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def _Execute(self, scenario, partition, demandMatrix):
def percent_completed(self):
return self.TRACKER.getProgress()

@_m.method(return_type=six.u)
@_m.method(return_type=six.text_type)
def tool_run_msg_status(self):
return self.tool_run_msg

8 changes: 4 additions & 4 deletions TMGToolbox/src/XTMF_internal/tmg_transit_assignment_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -1886,7 +1886,7 @@ def _tempStsuTTFs(self):
if self.ttfs_changed == True:
self.Scenario.set_attribute_values("TRANSIT_SEGMENT", ["transit_time_func"], self.orig_ttf_values)

@_m.method(return_type=six.u)
@_m.method(return_type=six.text_type)
def get_scenario_node_attributes(self):
options = ["<option value='-1'>None</option>"]
for exatt in self.Scenario.extra_attributes():
Expand All @@ -1895,7 +1895,7 @@ def get_scenario_node_attributes(self):

return "\n".join(options)

@_m.method(return_type=six.u)
@_m.method(return_type=six.text_type)
def get_scenario_link_attributes(self, include_none=True):
options = []
if include_none:
Expand All @@ -1906,7 +1906,7 @@ def get_scenario_link_attributes(self, include_none=True):

return "\n".join(options)

@_m.method(return_type=six.u)
@_m.method(return_type=six.text_type)
def get_scenario_segment_attribtues(self):
options = []
for exatt in self.Scenario.extra_attributes():
Expand All @@ -1919,6 +1919,6 @@ def get_scenario_segment_attribtues(self):
def percent_completed(self):
return self.TRACKER.getProgress()

@_m.method(return_type=six.u)
@_m.method(return_type=six.text_type)
def tool_run_msg_status(self):
return self.tool_run_msg
2 changes: 1 addition & 1 deletion TMGToolbox/src/analysis/create_zone_adjacency_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def flagPQ(p, q):
def percent_completed(self):
return self.TRACKER.getProgress()

@_m.method(return_type=six.u)
@_m.method(return_type=six.text_type)
def tool_run_msg_status(self):
return self.tool_run_msg

Expand Down
2 changes: 1 addition & 1 deletion TMGToolbox/src/analysis/export_partition_average_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ def _MatrixDataToString(data):
def percent_completed(self):
return self.TRACKER.getProgress()

@_m.method(return_type=six.u)
@_m.method(return_type=six.text_type)
def tool_run_msg_status(self):
return self.tool_run_msg

Expand Down
2 changes: 1 addition & 1 deletion TMGToolbox/src/analysis/matrix_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ def _WriteReportToFile(self,
def percent_completed(self):
return self.TRACKER.getProgress()

@_m.method(return_type=six.u)
@_m.method(return_type=six.text_type)
def tool_run_msg_status(self):
return self.tool_run_msg

Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,6 @@ def _GetAtts(self):
def percent_completed(self):
return self.TRACKER.getProgress()

@_m.method(return_type=six.u)
@_m.method(return_type=six.text_type)
def tool_run_msg_status(self):
return self.tool_run_msg
2 changes: 1 addition & 1 deletion TMGToolbox/src/analysis/traffic/Import_Cordon_Counts.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def _GetAtts(self):
def percent_completed(self):
return self.TRACKER.getProgress()

@_m.method(return_type=six.u)
@_m.method(return_type=six.text_type)
def tool_run_msg_status(self):
return self.tool_run_msg

Expand Down
6 changes: 3 additions & 3 deletions TMGToolbox/src/analysis/traffic/export_countpost_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,17 +160,17 @@ def page(self):
def percent_completed(self):
return self.TRACKER.getProgress()

@_m.method(return_type=six.u)
@_m.method(return_type=six.text_type)
def tool_run_msg_status(self):
return self.tool_run_msg

@_m.method(return_type=six.u)
@_m.method(return_type=six.text_type)
def preload_scenario_attributes(self):
list = []

for att in self.Scenario.extra_attributes():
label = "{id} - {name}".format(id=att.name, name=att.description)
html = unicode('<option value="{id}">{text}</option>'.format(id=att.name, text=label))
html = '<option value="{id}">{text}</option>'.format(id=att.name, text=label)
list.append(html)
return "\n".join(list)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,17 +176,17 @@ def page(self):
def percent_completed(self):
return self.TRACKER.getProgress()

@_m.method(return_type=six.u)
@_m.method(return_type=six.text_type)
def tool_run_msg_status(self):
return self.tool_run_msg

@_m.method(return_type=six.u)
@_m.method(return_type=six.text_type)
def preload_scenario_attributes(self):
list = []

for att in self.Scenario.extra_attributes():
label = "{id} - {name}".format(id=att.name, name=att.description)
html = unicode('<option value="{id}">{text}</option>'.format(id=att.name, text=label))
html = '<option value="{id}">{text}</option>'.format(id=att.name, text=label)
list.append(html)
return "\n".join(list)

Expand Down
25 changes: 23 additions & 2 deletions TMGToolbox/src/analysis/traffic/export_screenline_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,24 @@ def run(self):
def percent_completed(self):
return self.TRACKER.getProgress()

@_m.method(return_type=six.u)
@_m.method(return_type=six.text_type)
def tool_run_msg_status(self):
return self.tool_run_msg

def short_description(self):
return "<em>Exports traffic results for screenlines defined by multiple count posts.</em>"

@_m.method(return_type=six.text_type)
def preload_scenario_attributes(self):
list = []

for att in self.Scenario.extra_attributes():
label = "{id} - {name}".format(id=att.name, name=att.description)
html = '<option value="{id}">{text}</option>'.format(id=att.name, text=label)
list.append(html)
return "\n".join(list)

@_m.method(return_type=six.u)
@_m.method(return_type=six.text_type)
def preload_screenline_definitions(self):
atts = [self.CountpostFlagAttribute]
if self.AlternateFlagAttribute: atts.append(self.AlternateFlagAttribute)
Expand Down Expand Up @@ -235,6 +245,17 @@ def preload_screenline_definitions(self):
lines.sort()
lines.insert(0, "Screenline ID\tnStations\tnMissing\tStatus")
return "\n".join(lines)

@_m.method(return_type=six.text_type)
def _GetSelectAttributeOptionsHTML(self):
list = []

for att in self.Scenario.extra_attributes():
if not att.type == 'LINK': continue
label = "{id} ({domain}) - {name}".format(id=att.name, domain=att.type, name=att.description)
html = '<option value="{id}">{text}</option>'.format(id=att.name, text=label)
list.append(html)
return "\n".join(list)

#---
#---XTMF INTERFACE METHODS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def _GetNodeSet(self, network):
def percent_completed(self):
return self.TRACKER.getProgress()

@_m.method(return_type=six.u)
@_m.method(return_type=six.text_type)
def tool_run_msg_status(self):
return self.tool_run_msg

Expand Down
2 changes: 1 addition & 1 deletion TMGToolbox/src/analysis/transit/export_boardings.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def run(self):
def percent_completed(self):
return self.TRACKER.getProgress()

@_m.method(return_type=six.u)
@_m.method(return_type=six.text_type)
def tool_run_msg_status(self):
return self.tool_run_msg

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def run(self):
def percent_completed(self):
return self.TRACKER.getProgress()

@_m.method(return_type=six.u)
@_m.method(return_type=six.text_type)
def tool_run_msg_status(self):
return self.tool_run_msg

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def page(self):
$("#AlternateFlagAttribute")
.empty()
.append(tool._GetSelectAttributeOptionsHTML())
.append(tool.preload_scenario_attributes())
inro.modeller.page.preload("#AlternateFlagAttribute");
$("#AlternateFlagAttribute").trigger('change');
});
Expand Down Expand Up @@ -221,7 +221,7 @@ def run(self):
def percent_completed(self):
return self.TRACKER.getProgress()

@_m.method(return_type=six.u)
@_m.method(return_type=six.text_type)
def tool_run_msg_status(self):
return self.tool_run_msg

Expand All @@ -231,8 +231,17 @@ def check_ped_flag(self):

def short_description(self):
return "<em>Exports transit results for screenlines defined by multiple count posts.</em>"

@_m.method(return_type=six.u)

@_m.method(return_type=six.text_type)
def preload_scenario_attributes(self):
list = []
for att in self.Scenario.extra_attributes():
label = "{id} - {name}".format(id=att.name, name=att.description)
html = '<option value="{id}">{text}</option>'.format(id=att.name, text=label)
list.append(html)
return "\n".join(list)

@_m.method(return_type=six.text_type)
def preload_screenline_definitions(self):
atts = [self.CountpostFlagAttribute]
if self.AlternateFlagAttribute: atts.append(self.AlternateFlagAttribute)
Expand Down
Loading

0 comments on commit b728b91

Please sign in to comment.