xref: /third_party/skia/bin/sysopen
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/skia/bin/
1cb93a386Sopenharmony_ci#! /usr/bin/env python2
2cb93a386Sopenharmony_ci# Copyright 2017 Google Inc.
3cb93a386Sopenharmony_ci# Use of this source code is governed by a BSD-style license that can be
4cb93a386Sopenharmony_ci# found in the LICENSE file.
5cb93a386Sopenharmony_ci
6cb93a386Sopenharmony_ciimport os
7cb93a386Sopenharmony_ciimport subprocess
8cb93a386Sopenharmony_ciimport sys
9cb93a386Sopenharmony_ci
10cb93a386Sopenharmony_cidef spawn(cmd):
11cb93a386Sopenharmony_ci  with open(os.devnull, 'w') as o:
12cb93a386Sopenharmony_ci    subprocess.Popen(cmd, stdout=o, stderr=o)
13cb93a386Sopenharmony_ci
14cb93a386Sopenharmony_cidef sysopen(arg):
15cb93a386Sopenharmony_ci  plat = sys.platform
16cb93a386Sopenharmony_ci  if plat.startswith('darwin'):
17cb93a386Sopenharmony_ci    spawn(["open", arg])
18cb93a386Sopenharmony_ci  elif plat.startswith('win'):
19cb93a386Sopenharmony_ci    os.startfile(arg)
20cb93a386Sopenharmony_ci  else:
21cb93a386Sopenharmony_ci    spawn(["xdg-open", arg])
22cb93a386Sopenharmony_ci
23cb93a386Sopenharmony_ciif __name__ == '__main__':
24cb93a386Sopenharmony_ci  for a in sys.argv[1:]:
25cb93a386Sopenharmony_ci    sysopen(a)
26

Indexes created Thu Nov 07 10:32:03 CST 2024