Skip to content

Commit

Permalink
Added OS info to dsmr-debuginfo #1130
Browse files Browse the repository at this point in the history
  • Loading branch information
dennissiemensma committed Sep 29, 2020
1 parent 457a784 commit 59d89be
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion dsmr_backend/management/commands/dsmr_debuginfo.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import platform

from django.conf import settings
from django.core.management.base import BaseCommand
from django.db import connection
Expand Down Expand Up @@ -25,6 +27,7 @@ def add_arguments(self, parser):

def handle(self, **options):
self._print_start()
self._dump_os_info()
self._dump_application_info()
self._dump_data_info()
self._dump_pg_size()
Expand All @@ -34,6 +37,12 @@ def handle(self, **options):

self._print_end()

def _dump_os_info(self):
self._print_header('OS')
self._pretty_print_short('Python version', 'v{}'.format(platform.python_version()))
self._pretty_print_short('Platform', '{} ({})'.format(platform.system(), platform.processor()))
self._pretty_print_short('System', '{}'.format(platform.platform()))

def _dump_application_info(self):
pending_migrations = []

Expand Down Expand Up @@ -122,7 +131,10 @@ def _print_start(self):
print('```')

def _pretty_print(self, what, value):
print(' {:55}{:>15}'.format(what, value))
print(' {:70}{:>20}'.format(what, value))

def _pretty_print_short(self, what, value):
print(' {:20}{:>70}'.format(what, value))

def _print_header(self, what):
print()
Expand Down

0 comments on commit 59d89be

Please sign in to comment.