Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: packager.py

Issue 9190147: Allow metadata file to inherit values from another configuration file (Closed)
Patch Set: Created Jan. 18, 2013, 11:40 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« chainedconfigparser.py ('K') | « chainedconfigparser.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packager.py
===================================================================
--- a/packager.py
+++ b/packager.py
@@ -15,33 +15,28 @@
# You should have received a copy of the GNU General Public License
# along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
# Note: These are the base functions common to all packagers, the actual
# packagers are implemented in packagerGecko and packagerChrome.
import sys, os, re, codecs, subprocess, json, zipfile, jinja2
from StringIO import StringIO
-from ConfigParser import SafeConfigParser
+from chainedconfigparser import ChainedConfigParser
import buildtools
def getDefaultFileName(baseDir, metadata, version, ext):
return os.path.join(baseDir, '%s-%s.%s' % (metadata.get('general', 'basename'), version, ext))
def getMetadataPath(baseDir):
return os.path.join(baseDir, 'metadata')
def readMetadata(baseDir):
- metadata = SafeConfigParser()
- metadata.optionxform = str
- file = codecs.open(getMetadataPath(baseDir), 'rb', encoding='utf-8')
- metadata.readfp(file)
- file.close()
- return metadata
+ return ChainedConfigParser(getMetadataPath(baseDir))
def getBuildNum(baseDir):
try:
(result, dummy) = subprocess.Popen(['hg', 'id', '-R', baseDir, '-n'], stdout=subprocess.PIPE).communicate()
return re.sub(r'\D', '', result)
except Exception:
return '0'
« chainedconfigparser.py ('K') | « chainedconfigparser.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld