qapi/common.py: Add indent manager
commitcbe8f87f975264ee5b61795dc86f70915fb5f5f3
authorJohn Snow <jsnow@redhat.com>
Fri, 9 Oct 2020 16:15:33 +0000 (9 12:15 -0400)
committerMarkus Armbruster <armbru@redhat.com>
Sat, 10 Oct 2020 09:37:47 +0000 (10 11:37 +0200)
treed13a4d82f5a97832712b3861adf1269fe946709f
parent341f6afbac5afb41eb3291a060332f92bbb0f9c7
qapi/common.py: Add indent manager

Code style tools really dislike the use of global keywords, because it
generally involves re-binding the name at runtime which can have strange
effects depending on when and how that global name is referenced in
other modules.

Make a little indent level manager instead.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Cleber Rosa <crosa@redhat.com>
Message-Id: <20201009161558.107041-12-jsnow@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
scripts/qapi/common.py
scripts/qapi/visit.py