parameters: (jsdata, **options)
docstring: change app_name value in branding.xml
docstring_summary: change app_name value in branding.xml
docstring_tokens: change app_name value in branding . xml
function: def step_update_branding_xml(jsdata, **options):
      """ change app_name value in branding.xml """
  
      move_to_android_placeholder()
  
      # copy and rewrite res/values/branding.xml
      branding_xml = os.path.join(ANDROID_PATH, 'res', 'values', 'branding.xml')
      soup = soup = BeautifulSoup(open(branding_xml, 'r'),
                                  'xml', from_encoding='utf-8')
      for elem in soup.findAll('string'):
          elem.string.replace_with(
              elem.text.replace('Kiwix', jsdata.get('app_name')))
      flushxml(soup, 'resources', branding_xml)
  
      # remove all non-default branding.xml files
      for folder in os.listdir(os.path.join(ANDROID_PATH, 'res')):
          if re.match(r'^values\-[a-z]{2}$', folder):
              lbx = os.path.join(ANDROID_PATH, 'res', folder, 'branding.xml')
              if os.path.exists(lbx):
                  os.remove(lbx)
function_tokens: def step_update_branding_xml ( jsdata , * * options ) : move_to_android_placeholder ( ) # copy and rewrite res/values/branding.xml branding_xml = os . path . join ( ANDROID_PATH , 'res' , 'values' , 'branding.xml' ) soup = soup = BeautifulSoup ( open ( branding_xml , 'r' ) , 'xml' , from_encoding = 'utf-8' ) for elem in soup . findAll ( 'string' ) : elem . string . replace_with ( elem . text . replace ( 'Kiwix' , jsdata . get ( 'app_name' ) ) ) flushxml ( soup , 'resources' , branding_xml ) # remove all non-default branding.xml files for folder in os . listdir ( os . path . join ( ANDROID_PATH , 'res' ) ) : if re . match ( r'^values\-[a-z]{2}$' , folder ) : lbx = os . path . join ( ANDROID_PATH , 'res' , folder , 'branding.xml' ) if os . path . exists ( lbx ) : os . remove ( lbx )