From patchwork Mon Jan 22 00:44:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Martincoski X-Patchwork-Id: 864127 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="SEsVkHpB"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zPt9b34bNz9s1h for ; Mon, 22 Jan 2018 11:49:23 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 3997587537; Mon, 22 Jan 2018 00:49:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KART1uR8WPgy; Mon, 22 Jan 2018 00:49:18 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 2F3A387560; Mon, 22 Jan 2018 00:49:18 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id C75581C29B1 for ; Mon, 22 Jan 2018 00:49:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id C370287885 for ; Mon, 22 Jan 2018 00:49:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GgnBkhbvW78b for ; Mon, 22 Jan 2018 00:49:12 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qt0-f176.google.com (mail-qt0-f176.google.com [209.85.216.176]) by whitealder.osuosl.org (Postfix) with ESMTPS id 1231787876 for ; Mon, 22 Jan 2018 00:49:12 +0000 (UTC) Received: by mail-qt0-f176.google.com with SMTP id z10so16973523qti.5 for ; Sun, 21 Jan 2018 16:49:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1j6RJP/f/0P9pfhsytAGfJ1ahPELF5991a7EXCTKflU=; b=SEsVkHpBQYQ9nsbq8qfRnTYmOXdGX7RHVFsUP2u+2k+gheSIYGjaOjG97iSZxIeNTw k4mp5SCuZBDDXl5p7mk/NXVkSo+NYPTRMp7htd3HuyvuR2lDsyi0MjcNLK+NqI07el8q pg/n03oXpWaDSjAsDKbFfPsZ6EFuLqhrT4Rk7ScDvpHhETgej+lzopcJrHKNvNmMujg2 mJ4eJjE0YeAwvKV4yc004G3McDvTrk7+Sp8g5fqQfTSYc5G90ZwjsYySn2WpisGb3Rbi Q0aCrXSg3FJkNVutsJmUV+ipIMkyg/w2iRUCZRjeJs0CdtmqEyYrShyvXRXi6UTYEl+d 4lSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1j6RJP/f/0P9pfhsytAGfJ1ahPELF5991a7EXCTKflU=; b=gJN5BO5tTcmlCzKTq1bgS0qhP5f6Cd0bW4B4KOj5E6j2GRNypWJ/b/jd6BVevch2hb /HnrJUeaIe8mK5aUViyHNsxt4LzRZbrH6mpQJozBConnFAYCGDAAmau5Ekps8oLSwEd0 eJrWkg089+hPweB5bSocrsnrnZRYvTHFgLaQB4wah7VI4sjcFWB/CEQ4LfaHkSF5aLP/ 6Hf0XgbsacZDK/c2OLdqhtt188QECictLMMD3ESwo8ftlKhyABvR2wNYoj/U/NyDywLl BPbVCZyK5fCzr7xoMrGjO9pqdsbRBjyJz7HdZwSYG8SlpDTQVkvgqTW+LMGr12Lng8Ej FLRw== X-Gm-Message-State: AKwxyteVR8u4R67UlUNqHMXvPBSRfN41XnmRBkI9NK1iMih+Z0UfBdxV 4pGtG7bxTaQEzh7wtVOU95be1Q== X-Google-Smtp-Source: AH8x227+bljSHC2cIYmesDiVWRprQJmy0QxfLqMjp3I1Nwe0NQvCBJc+J2+OwnrnPA4FpS2DcloMhg== X-Received: by 10.55.212.129 with SMTP id s1mr8135063qks.44.1516582150962; Sun, 21 Jan 2018 16:49:10 -0800 (PST) Received: from ultri3.home ([179.176.184.241]) by smtp.gmail.com with ESMTPSA id s72sm9608703qki.22.2018.01.21.16.49.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 21 Jan 2018 16:49:10 -0800 (PST) From: Ricardo Martincoski To: buildroot@buildroot.org Date: Sun, 21 Jan 2018 22:44:39 -0200 Message-Id: <1516581882-30582-12-git-send-email-ricardo.martincoski@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516581882-30582-1-git-send-email-ricardo.martincoski@gmail.com> References: <1516581882-30582-1-git-send-email-ricardo.martincoski@gmail.com> Subject: [Buildroot] [PATCH 11/14] scanpypi: fix code style X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , Ricardo Martincoski MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Fix these warnings: E101 indentation contains mixed spaces and tabs E128 continuation line under-indented for visual indent E231 missing whitespace after ',' E261 at least two spaces before inline comment E302 expected 2 blank lines, found 1 E305 expected 2 blank lines after class or function definition, found 1 W191 indentation contains tabs Ignore these warnings: E402 module level import not at top of file Signed-off-by: Ricardo Martincoski Cc: Thomas Petazzoni Cc: Yegor Yefremov Reviewed-by: Yegor Yefremov --- utils/scanpypi | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/utils/scanpypi b/utils/scanpypi index 88fcb4a..d043135 100755 --- a/utils/scanpypi +++ b/utils/scanpypi @@ -35,6 +35,7 @@ except ImportError: 'pip install spdx_lookup') liclookup = None + def setup_decorator(func, method): """ Decorator for distutils.core.setup and setuptools.setup. @@ -55,11 +56,12 @@ def setup_decorator(func, method): return closure # monkey patch -import setuptools +import setuptools # noqa E402 setuptools.setup = setup_decorator(setuptools.setup, 'setuptools') -import distutils +import distutils # noqa E402 distutils.core.setup = setup_decorator(setuptools.setup, 'distutils') + def find_file_upper_case(filenames, path='./'): """ List generator: @@ -91,9 +93,11 @@ def pkg_buildroot_name(pkg_name): name = pattern.sub(r'python-\1', name) return name + class DownloadFailed(Exception): pass + class BuildrootPackage(): """This class's methods are not meant to be used individually please use them in the correct order: @@ -267,14 +271,14 @@ class BuildrootPackage(): # called through the if __name__ == '__main__' directive. # In this case, we can only pray that it is called through a # function called main() in setup.py. - setup.main() # Will raise AttributeError if not found + setup.main() # Will raise AttributeError if not found self.setup_metadata = self.setup_args[self.metadata_name] # Here we must remove the module the hard way. # We must do this because of a very specific case: if a package calls # setup from the __main__ but does not come with a 'main()' function, # for some reason setup.main() will successfully call the main # function of a previous package... - sys.modules.pop('setup',None) + sys.modules.pop('setup', None) del setup os.chdir(current_dir) sys.path.remove(self.tmp_extract) @@ -694,5 +698,6 @@ def main(): finally: shutil.rmtree(tmp_path) + if __name__ == "__main__": main()