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

Side by Side Diff: third_party/twisted_8_1/twisted/scripts/tapconvert.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 # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
2 # See LICENSE for details.
3
4 from twisted.python import usage
5 from twisted.application import app
6 from twisted.persisted import sob
7 import sys, getpass
8
9 class ConvertOptions(usage.Options):
10 synopsis = "Usage: tapconvert [options]"
11 optParameters = [
12 ['in', 'i', None, "The filename of the tap to read from"],
13 ['out', 'o', None, "A filename to write the tap to"],
14 ['typein', 'f', 'guess',
15 "The format to use; this can be 'guess', 'python', "
16 "'pickle', 'xml', or 'source'."],
17 ['typeout', 't', 'source',
18 "The output format to use; this can be 'pickle', 'xml', or 'source'."],
19 ]
20
21 optFlags = [
22 ['decrypt', 'd', "The specified tap/aos/xml file is encrypted."],
23 ['encrypt', 'e', "Encrypt file before writing"]
24 ]
25 #zsh_altArgDescr = {"foo":"use this description for foo instead"}
26 #zsh_multiUse = ["foo", "bar"]
27 #zsh_mutuallyExclusive = [("foo", "bar"), ("bar", "baz")]
28 zsh_actions = {"typein":"(guess python pickle xml source)",
29 "typeout":"(pickle xml source)"}
30 zsh_actionDescr = {"in":"tap file to read from",
31 "out":"tap file to write to"}
32
33 def postOptions(self):
34 if self['in'] is None:
35 raise usage.UsageError("%s\nYou must specify the input filename."
36 % self)
37 if self["typein"] == "guess":
38 try:
39 self["typein"] = sob.guessType(self["in"])
40 except KeyError:
41 raise usage.UsageError("Could not guess type for '%s'" %
42 self["typein"])
43
44 def run():
45 options = ConvertOptions()
46 try:
47 options.parseOptions(sys.argv[1:])
48 except usage.UsageError, e:
49 print e
50 else:
51 app.convertStyle(options["in"], options["typein"],
52 options.opts['decrypt'] or getpass.getpass('Passphrase: '),
53 options["out"], options['typeout'], options["encrypt"])
OLDNEW
« no previous file with comments | « third_party/twisted_8_1/twisted/scripts/tap2rpm.py ('k') | third_party/twisted_8_1/twisted/scripts/test/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698