diff --git a/confedit.py b/confedit.py index 2b5e743..bd90c97 100755 --- a/confedit.py +++ b/confedit.py @@ -91,7 +91,7 @@ def language_default(): else: lan = 'en' return lan - + def show_restricted(): global cpedata_out sout = get_restricted(cpedata_out) @@ -144,7 +144,7 @@ def write_inifile(): global inifile with open(inifile,'w') as configfile: iniconfig.write(configfile) - + #------------------------------------------------------------------------------ # get_restricted return a string with restricted commands in the cpe xml # input: xml_str it is cpedata_out @@ -193,7 +193,7 @@ def enable_restricted_web(): cpedata_out = re.sub(b'(dboa\S+.\s+\S+.\s+)0000',b'\g<1>2221',cpedata_out, 0, re.DOTALL) logger.log(lerr,_("Unlocked restricted web pages")) get_info(cpedata_out) # update router status info - + def enable_restricted_cli(): global cpedata_out cpedata_out = re.sub(b'(clis\S+.\s+\S+.\s+)0000',b'\g<1>2221',cpedata_out, 0, re.DOTALL) @@ -208,8 +208,8 @@ def fix_dlinkddns(): global cpedata_out cpedata_out = re.sub(b'dlinkdns.com',b'dlinkddns.com',cpedata_out, 0, re.DOTALL) logger.log(lerr,_("Fixed dlinkdns -> dlinkddns")) - get_info(cpedata_out) # update router status info - + get_info(cpedata_out) # update router status info + #------------------------------------------------------------------------------ # get_info setup router info textvariables # input xml_str binary string, xml or cpe xml conf file @@ -241,7 +241,7 @@ def get_info (xml_str): print("rtr_fwupgrade.get():" + rtr_fwupgrade.get() + ":") if rtr_fwupgrade.get() == blank20 : rtr_fwupgrade.set('undef') - + for i in xmlroot.findall(".//DeviceInfo/X_DLINK_customer_ID"): rtr_customerid.set(i.text) @@ -253,7 +253,7 @@ def get_info (xml_str): print("rtr_fwupgrade.get():" + rtr_fwupgrade.get() + ":") if rtr_fwdowngrade.get() == blank20 : rtr_fwdowngrade.set('undef') - + for i in xmlroot.findall(".//IP/Interface/IPv4Address/IPAddress"): parent = i.getparent() granpa = parent.getparent() @@ -283,11 +283,11 @@ def get_info (xml_str): rtr_fixddns.set(_('Fixed')) else: rtr_fixddns.set(_('Not Fixed')) - + #------------------------------------------------------------------------------ # get_passwords return a string text file with passwords xml string # input xml_str binary string, xml or cpe xml conf file -# rturn text string +# rturn text string #------------------------------------------------------------------------------ def get_passwords (xml_str): mystr = re.sub(b'