mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-23 23:02:25 +00:00
Extract Parameters type in scripts.types_.
This commit is contained in:
parent
189608e113
commit
602a06e5cb
@ -3,8 +3,7 @@ from __future__ import print_function
|
|||||||
import os.path, re, fnmatch
|
import os.path, re, fnmatch
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from typing import List, Sequence, Any
|
from allmydata.scripts.types_ import SubCommands, Parameters
|
||||||
from allmydata.scripts.types_ import SubCommands
|
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ -26,7 +25,7 @@ class FileStoreOptions(BaseOptions):
|
|||||||
"This overrides the URL found in the --node-directory ."],
|
"This overrides the URL found in the --node-directory ."],
|
||||||
["dir-cap", None, None,
|
["dir-cap", None, None,
|
||||||
"Specify which dirnode URI should be used as the 'tahoe' alias."]
|
"Specify which dirnode URI should be used as the 'tahoe' alias."]
|
||||||
] # type: List[Sequence[Any]]
|
] # type: Parameters
|
||||||
|
|
||||||
def postOptions(self):
|
def postOptions(self):
|
||||||
self["quiet"] = self.parent["quiet"]
|
self["quiet"] = self.parent["quiet"]
|
||||||
|
@ -5,7 +5,8 @@ import codecs
|
|||||||
from os.path import join
|
from os.path import join
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from typing import Optional, Sequence, List, Any
|
from typing import Optional
|
||||||
|
from .types_ import Parameters
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ -69,7 +70,7 @@ class BasedirOptions(BaseOptions):
|
|||||||
optParameters = [
|
optParameters = [
|
||||||
["basedir", "C", None, "Specify which Tahoe base directory should be used. [default: %s]"
|
["basedir", "C", None, "Specify which Tahoe base directory should be used. [default: %s]"
|
||||||
% quote_local_unicode_path(_default_nodedir)],
|
% quote_local_unicode_path(_default_nodedir)],
|
||||||
] # type: List[Sequence[Any]]
|
] # type: Parameters
|
||||||
|
|
||||||
def parseArgs(self, basedir=None):
|
def parseArgs(self, basedir=None):
|
||||||
# This finds the node-directory option correctly even if we are in a subcommand.
|
# This finds the node-directory option correctly even if we are in a subcommand.
|
||||||
@ -106,7 +107,7 @@ class NoDefaultBasedirOptions(BasedirOptions):
|
|||||||
|
|
||||||
optParameters = [
|
optParameters = [
|
||||||
["basedir", "C", None, "Specify which Tahoe base directory should be used."],
|
["basedir", "C", None, "Specify which Tahoe base directory should be used."],
|
||||||
] # type: List[Sequence[Any]]
|
] # type: Parameters
|
||||||
|
|
||||||
# This is overridden in order to ensure we get a "Wrong number of arguments."
|
# This is overridden in order to ensure we get a "Wrong number of arguments."
|
||||||
# error when more than one argument is given.
|
# error when more than one argument is given.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from typing import List, Tuple, Type
|
from typing import List, Tuple, Type, Sequence, Any
|
||||||
from allmydata.scripts.common import BaseOptions
|
from allmydata.scripts.common import BaseOptions
|
||||||
|
|
||||||
|
|
||||||
@ -8,3 +8,5 @@ from allmydata.scripts.common import BaseOptions
|
|||||||
SubCommand = Tuple[str, None, Type[BaseOptions], str]
|
SubCommand = Tuple[str, None, Type[BaseOptions], str]
|
||||||
|
|
||||||
SubCommands = List[SubCommand]
|
SubCommands = List[SubCommand]
|
||||||
|
|
||||||
|
Parameters = List[Sequence[Any]]
|
||||||
|
Loading…
Reference in New Issue
Block a user