GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ogdf-python/src/ogdf_python/pythonize/string.py at master · ogdf/ogdf-python

Expand file tree

/

string.py

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
47 lines (35 loc) · 1.48 KB
/

string.py

Copy path

File metadata and controls

47 lines (35 loc) · 1.48 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
from ogdf_python.utils import *
def node_repr(node):
if is_nullptr(node):
return "typed_nullptr(ogdf.node)"
return "G.nodes.byid(%s)" % node.index()
def node_str(node):
if is_nullptr(node):
return "nullptr (of type ogdf::node)"
adjs = ["e%s%sn%s" % (adj.theEdge().index(), "->" if adj.isSource() else "<-", adj.twinNode().index())
for adj in node.adjEntries]
return "n%s °(%si+%so=%s) [%s]" % (node.index(), node.indeg(), node.outdeg(), node.degree(), ", ".join(adjs))
def edge_repr(edge):
if is_nullptr(edge):
return "typed_nullptr(ogdf.edge)"
return "G.edges.byid(%s)" % edge.index()
def edge_str(edge):
if is_nullptr(edge):
return "nullptr (of type ogdf::edge)"
return "n%s--e%s->n%s" % (edge.source().index(), edge.index(), edge.target().index())
def adjEntry_repr(adj):
if is_nullptr(adj):
return "typed_nullptr(ogdf.adjEntry)"
if adj.isSource():
return "G.edges.byid(%s).adjSource()" % adj.theEdge().index()
else:
return "G.edges.byid(%s).adjTarget()" % adj.theEdge().index()
def adjEntry_str(adj):
if is_nullptr(adj):
return "nullptr (of type ogdf::adjEntry)"
if adj.isSource():
return "(n%s--a%s)e%s->n%s" % (
adj.theNode().index(), adj.index(), adj.theEdge().index(), adj.twinNode().index())
else:
return "(n%s<-a%s)e%s--n%s" % (
adj.theNode().index(), adj.index(), adj.theEdge().index(), adj.twinNode().index())
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.