MCPcopy Create free account
hub / github.com/apenwarr/sshuttle / OptDict

Class OptDict

options.py:6–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4import sys, os, textwrap, getopt, re, struct
5
6class OptDict:
7 def __init__(self):
8 self._opts = {}
9
10 def __setitem__(self, k, v):
11 if k.startswith('no-') or k.startswith('no_'):
12 k = k[3:]
13 v = not v
14 self._opts[k] = v
15
16 def __getitem__(self, k):
17 if k.startswith('no-') or k.startswith('no_'):
18 return not self._opts[k[3:]]
19 return self._opts[k]
20
21 def __getattr__(self, k):
22 return self[k]
23
24
25def _default_onabort(msg):

Callers 1

parseMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected