__init__.py (8328:03cfd2ecf6bb) __init__.py (8453:82fc1267d3bb)
1# Copyright (c) 2008-2009 The Hewlett-Packard Development Company
2# Copyright (c) 2004-2006 The Regents of The University of Michigan
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met: redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer;

--- 162 unchanged lines hidden (view full) ---

171 try:
172 subp = Popen(cmd, **kwargs)
173 except Exception, e:
174 if no_exception:
175 return exception
176 raise
177
178 return subp.communicate()[0]
1# Copyright (c) 2008-2009 The Hewlett-Packard Development Company
2# Copyright (c) 2004-2006 The Regents of The University of Michigan
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met: redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer;

--- 162 unchanged lines hidden (view full) ---

171 try:
172 subp = Popen(cmd, **kwargs)
173 except Exception, e:
174 if no_exception:
175 return exception
176 raise
177
178 return subp.communicate()[0]
179
180def makeDir(path):
181 """Make a directory if it doesn't exist. If the path does exist,
182 ensure that it is a directory"""
183 if os.path.exists(path):
184 if not os.path.isdir(path):
185 raise AttributeError, "%s exists but is not directory" % path
186 else:
187 os.mkdir(path)