
import os
import subprocess
import sys

def Execute(args):
  process = subprocess.Popen(args)
  process.wait()
  return process.returncode

if __name__ == '__main__':
  args = ['python',  "dart/third_party/gyp/gyp", "--depth=dart",
                 "-Idart/tools/gyp/all.gypi", "dart/dart.gyp"]

  if sys.platform == 'win32':
    # Generate Visual Studio 2008 compatible files by default.
    if not os.environ.get('GYP_MSVS_VERSION'):
      args.extend(['-G', 'msvs_version=2008'])

  sys.exit(Execute(args))


import os
import subprocess
import sys

def execute(args):
  process = subprocess.Popen(args)
  process.wait()
  return process.returncode

def main():
  args = ['python', 'dart/third_party/gyp/gyp', '--depth=dart',
          '-Idart/tools/gyp/all.gypi', 'dart/dart.gyp']

  if sys.platform == 'win32':
    # Generate Visual Studio 2008 compatible files by default.
    if not os.environ.get('GYP_MSVS_VERSION'):
      args.extend(['-G', 'msvs_version=2008'])

  sys.exit(execute(args))

if __name__ == '__main__':
  main()

Make code follow the Python style guidelines
Make code follow the Python style guidelines

+ Use a doc string for the whole file.

+ Lower case function names.

+ Consistently use single-quotes for quoted strings.

+ align wrapped elements with opening delimiter.

+ use a main() function
Review URL: https://chromiumcodereview.appspot.com//10837127

git-svn-id: c93d8a2297af3b929165606efe145742a534bc71@10307 260f80e4-7a28-3924-810f-c04153c831b5

  
  import os
  import subprocess
  import sys
  
- def Execute(args):
+ def execute(args):
    process = subprocess.Popen(args)
    process.wait()
    return process.returncode
  
- if __name__ == '__main__':
+ def main():
-   args = ['python',  "dart/third_party/gyp/gyp", "--depth=dart",
+   args = ['python', 'dart/third_party/gyp/gyp', '--depth=dart',
-                  "-Idart/tools/gyp/all.gypi", "dart/dart.gyp"]
+           '-Idart/tools/gyp/all.gypi', 'dart/dart.gyp']
  
    if sys.platform == 'win32':
      # Generate Visual Studio 2008 compatible files by default.
      if not os.environ.get('GYP_MSVS_VERSION'):
        args.extend(['-G', 'msvs_version=2008'])
  
-   sys.exit(Execute(args))
+   sys.exit(execute(args))
  
+ if __name__ == '__main__':
+   main()
+ 
Make code follow the Python style guidelines
## Code Before:

import os
import subprocess
import sys

def Execute(args):
  process = subprocess.Popen(args)
  process.wait()
  return process.returncode

if __name__ == '__main__':
  args = ['python',  "dart/third_party/gyp/gyp", "--depth=dart",
                 "-Idart/tools/gyp/all.gypi", "dart/dart.gyp"]

  if sys.platform == 'win32':
    # Generate Visual Studio 2008 compatible files by default.
    if not os.environ.get('GYP_MSVS_VERSION'):
      args.extend(['-G', 'msvs_version=2008'])

  sys.exit(Execute(args))

## Instruction:
Make code follow the Python style guidelines
## Code After:

import os
import subprocess
import sys

def execute(args):
  process = subprocess.Popen(args)
  process.wait()
  return process.returncode

def main():
  args = ['python', 'dart/third_party/gyp/gyp', '--depth=dart',
          '-Idart/tools/gyp/all.gypi', 'dart/dart.gyp']

  if sys.platform == 'win32':
    # Generate Visual Studio 2008 compatible files by default.
    if not os.environ.get('GYP_MSVS_VERSION'):
      args.extend(['-G', 'msvs_version=2008'])

  sys.exit(execute(args))

if __name__ == '__main__':
  main()
