From 6c873cdf3981c33fd87a251d49311100468e3b19 Mon Sep 17 00:00:00 2001 From: WillyPillow Date: Sat, 8 Aug 2020 14:57:22 +0800 Subject: [PATCH] qvm-template-postprocess: Make pylint happy. --- qubesadmin/tools/qvm_template_postprocess.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/qubesadmin/tools/qvm_template_postprocess.py b/qubesadmin/tools/qvm_template_postprocess.py index c6b51f7..36bbcdd 100644 --- a/qubesadmin/tools/qvm_template_postprocess.py +++ b/qubesadmin/tools/qvm_template_postprocess.py @@ -161,15 +161,15 @@ def import_appmenus(vm, source_dir): # separated by spaces should be ok as there should be no spaces in the file # name according to the FreeDesktop spec with open(os.path.join(source_dir, 'vm-whitelisted-appmenus.list'), 'r') \ - as f: - vm.features['default-menu-items'] = ' '.join([x.rstrip() for x in f]) + as fd: + vm.features['default-menu-items'] = ' '.join([x.rstrip() for x in fd]) with open(os.path.join(source_dir, 'whitelisted-appmenus.list'), 'r') \ - as f: - vm.features['menu-items'] = ' '.join([x.rstrip() for x in f]) + as fd: + vm.features['menu-items'] = ' '.join([x.rstrip() for x in fd]) with open( os.path.join(source_dir, 'netvm-whitelisted-appmenus.list'), 'r') \ - as f: - vm.features['netvm-menu-items'] = ' '.join([x.rstrip() for x in f]) + as fd: + vm.features['netvm-menu-items'] = ' '.join([x.rstrip() for x in fd]) # TODO: change this to qrexec calls to GUI VM, when GUI VM will be # implemented @@ -185,8 +185,8 @@ def import_appmenus(vm, source_dir): def parse_template_config(path): '''Parse template.conf from template package. (KEY=VALUE format)''' - with open(path, 'r') as f: - return dict(line.rstrip('\n').split('=', 1) for line in f) + with open(path, 'r') as fd: + return dict(line.rstrip('\n').split('=', 1) for line in fd) @asyncio.coroutine def call_postinstall_service(vm):