From 81645eadef0c214e492f437036e76c8a1db732bb Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Sat, 6 Feb 2021 21:51:47 +0200 Subject: [PATCH] Remove import from debug from openclpow, remove shebang, format --- src/openclpow.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/openclpow.py b/src/openclpow.py index a086c81f..b8acbd4b 100644 --- a/src/openclpow.py +++ b/src/openclpow.py @@ -1,16 +1,24 @@ -#!/usr/bin/env python2.7 """ Module for Proof of Work using OpenCL """ +import logging import os from struct import pack import paths from bmconfigparser import BMConfigParser -from debug import logger from state import shutdown -libAvailable = True +try: + import numpy + import pyopencl as cl + libAvailable = True +except ImportError: + libAvailable = False + + +logger = logging.getLogger('default') + ctx = False queue = False program = False @@ -19,17 +27,10 @@ enabledGpus = [] vendors = [] hash_dt = None -try: - import pyopencl as cl - import numpy -except ImportError: - libAvailable = False - def initCL(): """Initlialise OpenCL engine""" - # pylint: disable=global-statement - global ctx, queue, program, hash_dt, libAvailable + global ctx, queue, program, hash_dt # pylint: disable=global-statement if libAvailable is False: return del enabledGpus[:]