Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: third_party/twisted_8_1/twisted/python/release.py

Issue 12261012: Remove third_party/twisted_8_1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 """
2 A release-automation toolkit.
3
4 Don't use this outside of Twisted.
5
6 Maintainer: U{Christopher Armstrong<mailto:radix@twistedmatrix.com>}
7 """
8
9 import os
10 import re
11
12
13 # errors
14
15 class DirectoryExists(OSError):
16 """Some directory exists when it shouldn't."""
17 pass
18
19
20
21 class DirectoryDoesntExist(OSError):
22 """Some directory doesn't exist when it should."""
23 pass
24
25
26
27 class CommandFailed(OSError):
28 pass
29
30
31
32 # utilities
33
34 def sh(command, null=True, prompt=False):
35 """
36 I'll try to execute `command', and if `prompt' is true, I'll
37 ask before running it. If the command returns something other
38 than 0, I'll raise CommandFailed(command).
39 """
40 print "--$", command
41
42 if prompt:
43 if raw_input("run ?? ").startswith('n'):
44 return
45 if null:
46 command = "%s > /dev/null" % command
47 if os.system(command) != 0:
48 raise CommandFailed(command)
49
50
51
52 def runChdirSafe(f, *args, **kw):
53 origdir = os.path.abspath('.')
54 try:
55 return f(*args, **kw)
56 finally:
57 os.chdir(origdir)
OLDNEW
« no previous file with comments | « third_party/twisted_8_1/twisted/python/reflect.py ('k') | third_party/twisted_8_1/twisted/python/roots.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698