/usr/share/pyshared/pycallgraph/output/ubigraph.py is in python-pycallgraph 1.0.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | try:
from xmlrpclib import Server
except ImportError:
from xmlrpc.client import Server
# from ..exceptions import PyCallGraphException
from .output import Output
class UbigraphOutput(Output):
def __init__(self, **kwargs):
self.fp = None
self.server_url = 'http://127.0.0.1:20738/RPC2'
Output.__init__(self, **kwargs)
def start(self):
server = Server(self.server_url)
self.graph = server.ubigraph
# Create a graph
for i in range(0, 10):
self.graph.new_vertex_w_id(i)
# Make some edges
for i in range(0, 10):
self.graph.new_edge(i, (i + 1) % 10)
def should_update(self):
return True
def update(self):
pass
@classmethod
def add_arguments(cls, subparsers, parent_parser, usage):
defaults = cls()
subparser = subparsers.add_parser(
'ubigraph',
help='Update an Ubigraph visualization in real time',
parents=[parent_parser], usage=usage,
)
subparser.add_argument(
'-s', '--server-url', type=str, default=defaults.server_url,
help='The Ubigraph server',
)
return subparser
def done(self):
pass
|