]> git.0d.be Git - empathy.git/commitdiff
Update release script to take actions in command line options
authorXavier Claessens <xclaesse@src.gnome.org>
Fri, 18 Apr 2008 16:14:44 +0000 (16:14 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Fri, 18 Apr 2008 16:14:44 +0000 (16:14 +0000)
svn path=/trunk/; revision=963

release.py

index 3f85ceb48b7e76fe30ae69ccd41fa803cf736a0d..ce0ef96a9d7d4cffc0f49e1518ec0b92da56b502 100755 (executable)
@@ -6,6 +6,7 @@ import urllib
 import csv
 import datetime
 from string import Template
+from optparse import OptionParser
 
 username = 'xclaesse'
 upload_server = 'master.gnome.org'
@@ -274,8 +275,25 @@ class Project:
                self.upload_tarball()
                print self.get_release_notes()
 
-p = Project()
-#print p.generate_news()
-#p.write_news()
-#p.release()
-#print p.get_release_notes()
+if __name__ == '__main__':
+       p = Project()
+       parser = OptionParser()
+       parser.add_option("-n", "--print-news", action="store_true",\
+               dest="print_news", help="Generate and print news")
+       parser.add_option("-p", "--print-notes", action="store_true",\
+               dest="print_notes", help="Generate and print the release notes")
+       parser.add_option("-w", "--write-news", action="store_true",\
+               dest="write_news", help="Generate and write news into the NEWS file")
+       parser.add_option("-r", "--release", action="store_true",\
+               dest="release", help="Release the tarball")
+
+       (options, args) = parser.parse_args ()
+       if (options.print_news):
+               print p.generate_news ()
+       if (options.print_notes):
+               print p.get_release_notes ()
+       if (options.write_news):
+               p.write_news ()
+       if (options.release):
+               p.release ()
+