|
38 | 38 | Zone, |
39 | 39 | ) |
40 | 40 | import dzcb.tone |
| 41 | +from dzcb.util import unique_name |
41 | 42 |
|
42 | 43 |
|
43 | 44 | logger = logging.getLogger(__name__) |
@@ -97,7 +98,7 @@ def Codeplug_from_zone_dicts(zone_dicts): |
97 | 98 | def update_static_talkgroups(ch): |
98 | 99 | contacts.update(ch.static_talkgroups) |
99 | 100 | grouplist = GroupList( |
100 | | - name="{} TGS".format(ch.code), |
| 101 | + name="{} TGS".format(ch.code or ch.name[:5]), |
101 | 102 | contacts=ch.static_talkgroups, |
102 | 103 | ) |
103 | 104 | grouplists.append(grouplist) |
@@ -126,9 +127,7 @@ def update_static_talkgroups(ch): |
126 | 127 | ch = attr.evolve(ch, dedup_key=ch._dedup_key + 1) |
127 | 128 | all_channels[ch.short_name] = ch |
128 | 129 | updated_channels.append(ch) |
129 | | - scanlists.append( |
130 | | - attr.evolve(zscanlist, channels=updated_channels) |
131 | | - ) |
| 130 | + scanlists.append(attr.evolve(zscanlist, channels=updated_channels)) |
132 | 131 | zones.append( |
133 | 132 | Zone( |
134 | 133 | name=zname, |
@@ -308,8 +307,8 @@ def update_zones_channels(zones_dict, in_zones, log_filename=None): |
308 | 307 | :param log_filename: used for logging only |
309 | 308 | """ |
310 | 309 | _log_zones_channels(in_zones, log_filename) |
311 | | - # XXX: instead, consider combining channels from same-named zones in different CSV files? |
312 | | - zones_dict.update(in_zones) |
| 310 | + for zname, zchannels in in_zones.items(): |
| 311 | + zones_dict[unique_name(zname, zones_dict)] = zchannels |
313 | 312 |
|
314 | 313 |
|
315 | 314 | def Codeplug_from_k7abd(input_dir): |
|
0 commit comments