| Total Complexity | 1 |
| Total Lines | 15 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 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 |