mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-03 04:07:52 +00:00
run autopep8 on create_station
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
This commit is contained in:
@@ -74,23 +74,31 @@ class CreateStation(Realm):
|
|||||||
|
|
||||||
def build(self):
|
def build(self):
|
||||||
# Build stations
|
# Build stations
|
||||||
self.station_profile.use_security(self.security, self.ssid, self.password)
|
self.station_profile.use_security(
|
||||||
|
self.security, self.ssid, self.password)
|
||||||
self.station_profile.set_number_template(self.number_template)
|
self.station_profile.set_number_template(self.number_template)
|
||||||
|
|
||||||
print("Creating stations")
|
print("Creating stations")
|
||||||
self.station_profile.set_command_flag("add_sta", "create_admin_down", 1)
|
self.station_profile.set_command_flag(
|
||||||
self.station_profile.set_command_param("set_port", "report_timer", 1500)
|
"add_sta", "create_admin_down", 1)
|
||||||
|
self.station_profile.set_command_param(
|
||||||
|
"set_port", "report_timer", 1500)
|
||||||
self.station_profile.set_command_flag("set_port", "rpt_timer", 1)
|
self.station_profile.set_command_flag("set_port", "rpt_timer", 1)
|
||||||
if self.set_txo_data is not None:
|
if self.set_txo_data is not None:
|
||||||
self.station_profile.set_wifi_txo(txo_ena=self.set_txo_data["txo_enable"],
|
self.station_profile.set_wifi_txo(
|
||||||
|
txo_ena=self.set_txo_data["txo_enable"],
|
||||||
tx_power=self.set_txo_data["txpower"],
|
tx_power=self.set_txo_data["txpower"],
|
||||||
pream=self.set_txo_data["pream"],
|
pream=self.set_txo_data["pream"],
|
||||||
mcs=self.set_txo_data["mcs"],
|
mcs=self.set_txo_data["mcs"],
|
||||||
nss=self.set_txo_data["nss"],
|
nss=self.set_txo_data["nss"],
|
||||||
bw=self.set_txo_data["bw"],
|
bw=self.set_txo_data["bw"],
|
||||||
retries=self.set_txo_data["retries"],
|
retries=self.set_txo_data["retries"],
|
||||||
sgi=self.set_txo_data["sgi"], )
|
sgi=self.set_txo_data["sgi"],
|
||||||
self.station_profile.create(radio=self.radio, sta_names_=self.sta_list, debug=self.debug)
|
)
|
||||||
|
self.station_profile.create(
|
||||||
|
radio=self.radio,
|
||||||
|
sta_names_=self.sta_list,
|
||||||
|
debug=self.debug)
|
||||||
if self.up:
|
if self.up:
|
||||||
self.station_profile.admin_up()
|
self.station_profile.admin_up()
|
||||||
|
|
||||||
@@ -119,21 +127,32 @@ def main():
|
|||||||
--debug
|
--debug
|
||||||
''')
|
''')
|
||||||
required = parser.add_argument_group('required arguments')
|
required = parser.add_argument_group('required arguments')
|
||||||
required.add_argument('--start_id', help='--start_id <value> default 0', default=0)
|
required.add_argument(
|
||||||
|
'--start_id',
|
||||||
|
help='--start_id <value> default 0',
|
||||||
|
default=0)
|
||||||
|
|
||||||
optional = parser.add_argument_group('Optional arguments')
|
optional = parser.add_argument_group('Optional arguments')
|
||||||
optional.add_argument('--mode', help='Mode for your station (as a number)',default=0)
|
optional.add_argument(
|
||||||
optional.add_argument('--station_flag', help='station flags to add', required=False, default=None, action='append')
|
'--mode',
|
||||||
|
help='Mode for your station (as a number)',
|
||||||
|
default=0)
|
||||||
|
optional.add_argument(
|
||||||
|
'--station_flag',
|
||||||
|
help='station flags to add',
|
||||||
|
required=False,
|
||||||
|
default=None,
|
||||||
|
action='append')
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
# if args.debug:
|
# if args.debug:
|
||||||
# pprint.pprint(args)
|
# pprint.pprint(args)
|
||||||
# time.sleep(5)
|
# time.sleep(5)
|
||||||
if (args.radio is None):
|
if args.radio is None:
|
||||||
raise ValueError("--radio required")
|
raise ValueError("--radio required")
|
||||||
|
|
||||||
start_id = 0
|
start_id = 0
|
||||||
if (args.start_id != 0):
|
if args.start_id != 0:
|
||||||
start_id = int(args.start_id)
|
start_id = int(args.start_id)
|
||||||
|
|
||||||
num_sta = 2
|
num_sta = 2
|
||||||
@@ -175,5 +194,6 @@ def main():
|
|||||||
create_station.build()
|
create_station.build()
|
||||||
print('Created %s stations' % num_sta)
|
print('Created %s stations' % num_sta)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|||||||
Reference in New Issue
Block a user