Skip to content
Snippets Groups Projects
Commit 6a582aae authored by Ellis Percival's avatar Ellis Percival
Browse files

Change gcd import

parent af003226
No related branches found
No related tags found
No related merge requests found
......@@ -2,26 +2,24 @@ import argparse
import json
import logging
import logging.config
import yaml
import sys
import socket
import ssl
from time import sleep, time
from importlib import import_module
from hashlib import sha1
import threading # For callback functions
from fractions import gcd # for calculating the callback periodic time
import sys
import threading
from functools import reduce
from hashlib import sha1
from importlib import import_module
from math import gcd
from time import sleep, time
import paho.mqtt.client as mqtt
import cerberus
import paho.mqtt.client as mqtt
import yaml
from pi_mqtt_gpio import CONFIG_SCHEMA
from pi_mqtt_gpio.modules import PinPullup, PinDirection, InterruptEdge, BASE_SCHEMA
from pi_mqtt_gpio.modules import BASE_SCHEMA, InterruptEdge, PinDirection, PinPullup
from pi_mqtt_gpio.scheduler import Scheduler, Task
LOG_LEVEL_MAP = {
mqtt.MQTT_LOG_INFO: logging.INFO,
mqtt.MQTT_LOG_NOTICE: logging.INFO,
......@@ -317,7 +315,7 @@ def install_missing_requirements(module):
if pkgs_installed.find(pkg_resources.Requirement.parse(req)) is None:
pkgs_required.append(req)
if pkgs_required:
from subprocess import check_call, CalledProcessError
from subprocess import CalledProcessError, check_call
try:
check_call([sys.executable, "-m", "pip", "install"] + pkgs_required)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment