Example #1
0
 def postOptions(self):
     super(_CreateBaseOptions, self).postOptions()
     if self['hide-ip']:
         if tor_provider._import_txtorcon(
         ) is None and i2p_provider._import_txi2p() is None:
             raise UsageError(
                 "--hide-ip was specified but neither 'txtorcon' nor 'txi2p' "
                 "are installed.\nTo do so:\n   pip install tahoe-lafs[tor]\nor\n"
                 "   pip install tahoe-lafs[i2p]")
Example #2
0
 def postOptions(self):
     super(_CreateBaseOptions, self).postOptions()
     if self['hide-ip']:
         if tor_provider._import_txtorcon() is None and i2p_provider._import_txi2p() is None:
             raise UsageError(
                 "--hide-ip was specified but neither 'txtorcon' nor 'txi2p' "
                 "are installed.\nTo do so:\n   pip install tahoe-lafs[tor]\nor\n"
                 "   pip install tahoe-lafs[i2p]"
             )
Example #3
0
def validate_i2p_options(o):
    use_i2p = "i2p" in o["listen"].split(",")
    if use_i2p or any((o["i2p-launch"], o["i2p-sam-port"])):
        if i2p_provider._import_txi2p() is None:
            raise UsageError(
                "Specifying any I2P options requires the 'txi2p' module")
    if not use_i2p:
        if o["i2p-launch"]:
            raise UsageError("--i2p-launch requires --listen=i2p")
        if o["i2p-sam-port"]:
            raise UsageError("--i2p-sam-port= requires --listen=i2p")
    if o["i2p-launch"] and o["i2p-sam-port"]:
        raise UsageError(
            "use either --i2p-launch or --i2p-sam-port=, not both")
    if o["i2p-launch"]:
        raise UsageError("--i2p-launch is under development")
Example #4
0
def validate_i2p_options(o):
    use_i2p = "i2p" in o["listen"].split(",")
    if use_i2p or any((o["i2p-launch"], o["i2p-sam-port"])):
        if i2p_provider._import_txi2p() is None:
            raise UsageError(
                "Specifying any I2P options requires the 'txi2p' module"
            )
    if not use_i2p:
        if o["i2p-launch"]:
            raise UsageError("--i2p-launch requires --listen=i2p")
        if o["i2p-sam-port"]:
            raise UsageError("--i2p-sam-port= requires --listen=i2p")
    if o["i2p-launch"] and o["i2p-sam-port"]:
        raise UsageError("use either --i2p-launch or --i2p-sam-port=, not both")
    if o["i2p-launch"]:
        raise UsageError("--i2p-launch is under development")