Disable CAF sync for now
diff --git a/cm_crowdin_sync.py b/cm_crowdin_sync.py
index 6dae300..dd65464 100755
--- a/cm_crowdin_sync.py
+++ b/cm_crowdin_sync.py
@@ -203,42 +203,42 @@
except:
sys.exit('You have not installed repo. Terminating.')
-print('\nSTEP 1: Create cm_caf.xml')
+#print('\nSTEP 1: Create cm_caf.xml')
# Load caf.xml
-print('Loading caf.xml')
-xml = minidom.parse('caf.xml')
-items = xml.getElementsByTagName('item')
+#print('Loading caf.xml')
+#xml = minidom.parse('caf.xml')
+#items = xml.getElementsByTagName('item')
# Store all created cm_caf.xml files in here.
# Easier to remove them afterwards, as they cannot be committed
-cm_caf = []
+#cm_caf = []
-for item in items:
- # Create tmp dir for download of AOSP base file
- path_to_values = item.attributes["path"].value
- subprocess.call(['mkdir', '-p', 'tmp/' + path_to_values])
- # Create cm_caf.xml - header
- f = codecs.open(path_to_values + '/cm_caf.xml', 'w', 'utf-8')
- f.write('<?xml version="1.0" encoding="utf-8"?>\n')
- f.write('<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">\n')
- # Create cm_caf.xml - contents
- # This means we also support multiple base files (e.g. checking if strings.xml and arrays.xml are changed)
- contents = []
- item_aosp = item.getElementsByTagName('aosp')
- for aosp_item in item_aosp:
- url = aosp_item.firstChild.nodeValue
- xml_file = aosp_item.attributes["file"].value
- path_to_base = 'tmp/' + path_to_values + '/' + xml_file
- path_to_cm = path_to_values + '/' + xml_file
- urlretrieve(url, path_to_base)
- contents = contents + get_caf_additions(path_to_base, path_to_cm)
- for addition in contents:
- f.write(addition + '\n')
- # Create cm_caf.xml - the end
- f.write('</resources>')
- f.close()
- cm_caf.append(path_to_values + '/cm_caf.xml')
- print('Created ' + path_to_values + '/cm_caf.xml')
+#for item in items:
+# # Create tmp dir for download of AOSP base file
+# path_to_values = item.attributes["path"].value
+# subprocess.call(['mkdir', '-p', 'tmp/' + path_to_values])
+# # Create cm_caf.xml - header
+# f = codecs.open(path_to_values + '/cm_caf.xml', 'w', 'utf-8')
+# f.write('<?xml version="1.0" encoding="utf-8"?>\n')
+# f.write('<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">\n')
+# # Create cm_caf.xml - contents
+# # This means we also support multiple base files (e.g. checking if strings.xml and arrays.xml are changed)
+# contents = []
+# item_aosp = item.getElementsByTagName('aosp')
+# for aosp_item in item_aosp:
+# url = aosp_item.firstChild.nodeValue
+# xml_file = aosp_item.attributes["file"].value
+# path_to_base = 'tmp/' + path_to_values + '/' + xml_file
+# path_to_cm = path_to_values + '/' + xml_file
+# urlretrieve(url, path_to_base)
+# contents = contents + get_caf_additions(path_to_base, path_to_cm)
+# for addition in contents:
+# f.write(addition + '\n')
+# # Create cm_caf.xml - the end
+# f.write('</resources>')
+# f.close()
+# cm_caf.append(path_to_values + '/cm_caf.xml')
+# print('Created ' + path_to_values + '/cm_caf.xml')
print('\nSTEP 2: Upload Crowdin source translations')
# Execute 'crowdin-cli upload sources' and show output
@@ -248,15 +248,15 @@
# Execute 'crowdin-cli download' and show output
print(subprocess.check_output(['crowdin-cli', "download"]))
-print('STEP 4A: Clean up of source cm_caf.xmls')
-# Remove all cm_caf.xml files, which you can find in the list 'cm_caf'
-for cm_caf_file in cm_caf:
- print ('Removing ' + cm_caf_file)
- os.remove(cm_caf_file)
+#print('STEP 4A: Clean up of source cm_caf.xmls')
+## Remove all cm_caf.xml files, which you can find in the list 'cm_caf'
+#for cm_caf_file in cm_caf:
+# print ('Removing ' + cm_caf_file)
+# os.remove(cm_caf_file)
-print('\nSTEP 4B: Clean up of temp dir')
-# We are done with cm_caf.xml files, so remove tmp/
-shutil.rmtree(os.getcwd() + '/tmp')
+#print('\nSTEP 4B: Clean up of temp dir')
+## We are done with cm_caf.xml files, so remove tmp/
+#shutil.rmtree(os.getcwd() + '/tmp')
print('\nSTEP 4C: Clean up of empty translations')
# Some line of code that I found to find all XML files