forked from nocproject/noc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpythonpath.py
36 lines (28 loc) · 950 Bytes
/
pythonpath.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# ---------------------------------------------------------------------
# display PYTHONPATH
# ---------------------------------------------------------------------
# Copyright (C) 2007-2010 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
# Python modules
import sys
# NOC modules
from noc.core.management.base import BaseCommand
class Command(BaseCommand):
help = "Display PYTHONPATH"
def add_arguments(self, parser):
parser.add_argument(
"--list",
"-l",
dest="one_column",
action="store_true",
help="Display one path per line",
default=False,
)
def handle(self, *args, **options):
if options.get("one_column", False):
self.print("\n".join(sys.path))
else:
self.print(":".join(sys.path))
if __name__ == "__main__":
Command().run()