chiark / gitweb /
Make metadata.py a proper module (renamed to common.py)
authorHenrik Tunedal <tunedal@gmail.com>
Thu, 17 Feb 2011 20:16:26 +0000 (21:16 +0100)
committerHenrik Tunedal <tunedal@gmail.com>
Thu, 17 Feb 2011 20:16:26 +0000 (21:16 +0100)
.gitignore
build.py [changed mode: 0644->0755]
common.py [moved from metadata.py with 98% similarity]
update.py [changed mode: 0644->0755]

index eeabf9ea75280d8df6c7a750fdcec6e30359372e..e35a4b72bfdd4e706f108c8fb2dbed76969d2086 100644 (file)
@@ -3,3 +3,4 @@ repo/
 built/
 build_*/
 *~
+*.pyc
old mode 100644 (file)
new mode 100755 (executable)
index 248bb7f..3f816d1
--- a/build.py
+++ b/build.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python2
 # -*- coding: utf-8 -*-
 #
 # build.py - part of the FDroid server tools
@@ -19,7 +20,6 @@
 import sys
 import os
 import shutil
-import glob
 import subprocess
 import re
 import zipfile
@@ -29,10 +29,11 @@ import shlex
 from xml.dom.minidom import Document
 from optparse import OptionParser
 
+import common
+
 #Read configuration...
 execfile('config.py')
 
-execfile('metadata.py')
 
 # Parse command line...
 parser = OptionParser()
@@ -45,7 +46,7 @@ parser.add_option("-c", "--clean", action="store_true", default=False,
 (options, args) = parser.parse_args()
 
 # Get all apps...
-apps = read_metadata()
+apps = common.read_metadata()
 
 #Clear and/or create the 'built' directory, depending on mode:
 built_dir = 'built'
similarity index 98%
rename from metadata.py
rename to common.py
index d6b6d22aafef405e745c41d2a31045d838091d8b..835d5c0d0c9010a95234dc6cf490a10558aa5fb3 100644 (file)
+++ b/common.py
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 #
-# metadata.py - part of the FDroid server tools
+# common.py - part of the FDroid server tools
 # Copyright (C) 2010, Ciaran Gultnieks, ciaran@ciarang.com
 #
 # This program is free software: you can redistribute it and/or modify
@@ -16,6 +16,8 @@
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+import glob, os, sys
+
 def read_metadata(verbose=False):
 
     apps = []
old mode 100644 (file)
new mode 100755 (executable)
index b12f147..fa8c1d1
--- a/update.py
+++ b/update.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python2
 # -*- coding: utf-8 -*-
 #
 # update.py - part of the FDroid server tools
@@ -34,7 +35,7 @@ repo_icon = None
 repo_url = None
 execfile('config.py')
 
-execfile('metadata.py')
+import common
 
 # Parse command line...
 parser = OptionParser()
@@ -66,7 +67,7 @@ if (repo_url is None or repo_name is None or
     sys.exit(1)
 
 # Get all apps...
-apps = read_metadata(verbose=options.verbose)
+apps = common.read_metadata(verbose=options.verbose)
 
 # Copy apks and source tarballs for stuff we've built from source that
 # is flagged to be included in the repo...