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

Unified Diff: packagerEdge.py

Issue 29542744: Issue 5666 - Replace 4th component of version in AppxManifest.xml with 0 (Closed)
Patch Set: Improved docstring for compliance with PEP-257 Created Sept. 12, 2017, 9:33 p.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
« no previous file with comments | « no previous file | tests/test_packagerEdge.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packagerEdge.py
===================================================================
--- a/packagerEdge.py
+++ b/packagerEdge.py
@@ -70,10 +70,15 @@
return json.loads(files[path])
-def pad_version(version):
- """Make sure version number has 4 groups of digits."""
- groups = (version.split('.') + ['0', '0', '0'])[:4]
- return '.'.join(groups)
+def fix_version(version):
+ """Prepare a version number for usage in AppxManifest.xml.
+
tlucas 2017/09/12 21:38:08 Flake8 fails on this line: ./packagerEdge.py:75:1:
Sebastian Noack 2017/09/12 21:41:18 Argh, sorry, I forgot to run tox/flake8, again. Ap
+ As required by the Windows Store, the returned version string has
+ four components with the last component being zero (e.g. 12.34.56.0).
+ """
+ components = version.split('.')[:3]
+ components.extend(['0'] * (4 - len(components)))
+ return '.'.join(components)
def create_appx_manifest(params, files, release_build=False):
@@ -82,7 +87,7 @@
metadata = params['metadata']
w = params['windows_version'] = {}
w['min'], w['max'] = metadata.get('compat', 'windows').split('/')
- params['version'] = pad_version(params['version'])
+ params['version'] = fix_version(params['version'])
metadata_suffix = 'release' if release_build else 'devbuild'
app_extension_id = 'extension_id_' + metadata_suffix
« no previous file with comments | « no previous file | tests/test_packagerEdge.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld