Skip to content

Instantly share code, notes, and snippets.

@zhangchunlin
Created November 5, 2013 02:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zhangchunlin/7313016 to your computer and use it in GitHub Desktop.
Save zhangchunlin/7313016 to your computer and use it in GitHub Desktop.
repo manifest
#! /usr/bin/env python
#coding=utf-8
MANIFEST_HEADER = r'''<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote fetch="https://github.com/" name="github" review="review.cyanogenmod.org"/>
<default remote="github" revision="refs/heads/cm-10.2"/>
'''
MANIFEST_FOOTER = r'''
</manifest>
'''
def main():
import xml.etree.ElementTree as ET
f = open("default.xml","w")
f.write(MANIFEST_HEADER)
tree = ET.parse('../android/default.xml')
root = tree.getroot()
for c in root:
if c.tag=='project' and c.attrib.get('remote','github')=='github':
f.write(' <project name="%s" />\n'%(c.attrib['name']))
f.write(MANIFEST_FOOTER)
f.close()
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment