From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0E117A00C5; Wed, 12 Jan 2022 16:29:20 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DB1C442705; Wed, 12 Jan 2022 16:29:19 +0100 (CET) Received: from mail-ot1-f52.google.com (mail-ot1-f52.google.com [209.85.210.52]) by mails.dpdk.org (Postfix) with ESMTP id 05DEE42703 for ; Wed, 12 Jan 2022 16:29:19 +0100 (CET) Received: by mail-ot1-f52.google.com with SMTP id o3-20020a9d4043000000b0058f31f4312fso2946576oti.1 for ; Wed, 12 Jan 2022 07:29:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nns/6SFKPANnDQiFZjTKLRejrZiWI5bhQ1i+JI2flyc=; b=jQcbDS82llm0ZSLNR+Y/6XRyBzutHRUuPEwZsOXXEJKIlcS7YVPSSF4h58Dueh16VD 9eQ9XfXQCTNc1X1ecusW84jymUon7WPbzz23yLk+oIlbl8IkhmtY64mzmD1YNJ13Qrdq ou0JDDYld3kjIm9ZFhSvg66d1ogXnONLc7dtg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nns/6SFKPANnDQiFZjTKLRejrZiWI5bhQ1i+JI2flyc=; b=MO/kS4OJnWqtZyv918wQMn5+dcet5ddkGtt/2I6cpCrKebZX5qTZxKu/oAAsUn7dSd B31czqD76WrldTKrK19nMBcEFDVjEH655MRpeUlKesf5Obq91Fl5A9dYwHTaRQwf1Oun 9Pccu6ZJnuL6RDabt4OlSsxKZUTJJc2YOC/xJdmX3/iHi2lmGh6nj0qvkbcjKY/Clzso HHQxeGE9DU7LaZSt/d/mUW2pjMeJ9TOMfhh1m1gyb9LhvQ/gouuCQxKV31wCJ5jGcB2O D/HD6mk4PPgjtAyhWNYfM/+MPPcYIJtchogpmzma+K4SzHnanSt+SC4bz3qqpIcANVwP 9Prg== X-Gm-Message-State: AOAM531lcgSLezNDViN+EBiYJiDP5yHJ+oHc56NVZWo8fn9NjD9/6Ec9 zaEzEuIvlm+c/rljGhmu9Lt0YrYBfOY4Rm9vdav36w== X-Google-Smtp-Source: ABdhPJwyhMUvya3fcycPJzxmtAWQG+W1/qHYEWVOGcNFtJOwNDrJMjlhmOU4b7BvOm32zAiU45uK+BV7O9P+qpX6650= X-Received: by 2002:a9d:12c:: with SMTP id 41mr219801otu.322.1642001358356; Wed, 12 Jan 2022 07:29:18 -0800 (PST) MIME-Version: 1.0 References: <20211117085444.2254-1-junx.dong@intel.com> <20211117085444.2254-3-junx.dong@intel.com> In-Reply-To: <20211117085444.2254-3-junx.dong@intel.com> From: Owen Hilyard Date: Wed, 12 Jan 2022 10:28:42 -0500 Message-ID: Subject: Re: [dts] [PATCH V1 3/4] framework/*: removed makefile from framework To: DongJunX , "Tu, Lijuan" Cc: qinx.sun@intel.com, "Ling, WeiX" , yanx.xia@intel.com, yux.jiang@intel.com, zhiminx.huang@intel.com, "Xu, HailinX" , songx.jiale@intel.com, dts@dpdk.org Content-Type: multipart/alternative; boundary="000000000000af9a5105d5643b0d" X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org --000000000000af9a5105d5643b0d Content-Type: text/plain; charset="UTF-8" > > - build_type = load_global_setting(HOST_BUILD_TYPE_SETTING) > - set_build_options = getattr(self, 'set_build_options_%s' % > (build_type)) > + set_build_options = getattr(self, 'set_build_options_meson') > set_build_options(config_parms, config_file) > It seems like this could just be: set_build_options_meson(config_parms, config_file) That avoids using reflection to get the function and is much easer to read in my opinion build_install_dpdk = getattr(self, 'build_install_dpdk_%s_meson' % > self.get_os_type()) While changes are being made here, could you convert this to use a chain of if statements? build_dpdk_apps = getattr(self, 'build_dpdk_apps_%s_meson' % > self.get_os_type()) Same as the last one. --000000000000af9a5105d5643b0d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 build_type =3D load_global_= setting(HOST_BUILD_TYPE_SETTING)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 set_build_= options =3D getattr(self, 'set_build_options_%s' % (build_type))+=C2=A0 =C2=A0 =C2=A0 =C2=A0 set_build_options =3D getattr(self, 'set_= build_options_meson')
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0set_build_op= tions(config_parms, config_file)

It see= ms like this could just be:

set_build_optio= ns_meson(config_parms, config_file)=C2=A0

T= hat avoids using reflection to get the function and is much easer to read i= n my opinion

=C2= =A0build_install_dpdk =3D getattr(self, 'build_install_dpdk_%s_meson= 9; % self.get_os_type())

While changes are = being made here, could you convert this to use a chain of if statements?=C2= =A0

=C2=A0build_dp= dk_apps =3D getattr(self, 'build_dpdk_apps_%s_meson' % self.get_os_= type())

Same as the last one.=C2=A0=C2=A0
--000000000000af9a5105d5643b0d--