ore.management.commands.tikzdump.Command.handle()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 6
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nop 3
1
from django.core.management.base import BaseCommand
2
from ore.models import Graph
3
4
5
class Command(BaseCommand):
6
    args = '<graph_id>'
7
    help = 'Dumps the graph with the given ID into TIKZ'
8
9
    def handle(self, *args, **options):
10
        graph_id = int(args[0])
11
        graph = Graph.objects.get(pk=graph_id)
12
13
        print('Dumping graph %d' % (graph_id))
14
        print graph.to_tikz()
15