Merge "Add Windows as supported operating system"

This commit is contained in:
Jenkins 2016-04-05 18:37:42 +00:00 committed by Gerrit Code Review
commit 54961eb3b4
3 changed files with 7 additions and 2 deletions

View File

@ -71,5 +71,7 @@ def main(argv=None, stdout=None):
out = requirement.to_content(out_reqs, prefix=False)
with open(args[0] + '.tmp', 'wt') as f:
f.write(out)
if os.path.exists(args[0]):
os.remove(args[0])
os.rename(args[0] + '.tmp', args[0])
return 0

View File

@ -105,7 +105,7 @@ def _safe_read(project, filename, output=None):
if output is None:
output = project
try:
path = project['root'] + '/' + filename
path = os.path.join(project['root'], filename)
with io.open(path, 'rt', encoding="utf-8") as f:
output[filename] = f.read()
except IOError as e:
@ -166,10 +166,12 @@ def write(project, actions, stdout, verbose, noop=False):
elif type(action) is File:
if noop:
continue
fullname = project['root'] + '/' + action.filename
fullname = os.path.join(project['root'], action.filename)
tmpname = fullname + '.tmp'
with open(tmpname, 'wt') as f:
f.write(action.content)
if os.path.exists(fullname):
os.remove(fullname)
os.rename(tmpname, fullname)
elif type(action) is StdOut:
stdout.write(action.message)

View File

@ -12,6 +12,7 @@ classifier =
Intended Audience :: System Administrators
License :: OSI Approved :: Apache Software License
Operating System :: POSIX :: Linux
Operating System :: Microsoft :: Windows
Programming Language :: Python
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7