diff --git a/docs/source/conf.py b/docs/source/conf.py index abe7bb8..dd8ab7e 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -12,6 +12,7 @@ # import os import sys + sys.path.insert(0, os.path.abspath('../../src/honeybot/')) diff --git a/setup.py b/setup.py index d8959a1..bd412ce 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,8 @@ # black inspired -from setuptools import setup, find_packages -import sys import os +import sys + +from setuptools import find_packages, setup assert sys.version_info >= (3, 7, 0), "honeybot requires Python 3.7.0" from pathlib import Path # noqa E402 diff --git a/src/honeybot/api/init.py b/src/honeybot/api/init.py index cdf6b90..52a5409 100644 --- a/src/honeybot/api/init.py +++ b/src/honeybot/api/init.py @@ -1,6 +1,6 @@ +import os import shutil from pathlib import Path # noqa E402 -import os CURRENT_DIR = Path(__file__).parent MAIN_DIR = CURRENT_DIR.parent diff --git a/src/honeybot/api/main.py b/src/honeybot/api/main.py index 2e14114..5c9d3a7 100644 --- a/src/honeybot/api/main.py +++ b/src/honeybot/api/main.py @@ -3,23 +3,22 @@ import configparser import importlib import logging +import os +import pathlib import socket +import subprocess import sys import time -import os -import pathlib + import pkg_resources -import subprocess # import setuptools # from pathlib import Path try: - from honeybot.api import commands - from honeybot.api.utils import prevent_none - from honeybot.api.utils import configfile_to_list - from honeybot.api.utils import get_requirements - from honeybot.api import memory + from honeybot.api import commands, memory + from honeybot.api.utils import (configfile_to_list, get_requirements, + prevent_none) except Exception as e: raise e diff --git a/src/honeybot/api/utils.py b/src/honeybot/api/utils.py index ead3bb3..991ea67 100644 --- a/src/honeybot/api/utils.py +++ b/src/honeybot/api/utils.py @@ -1,4 +1,5 @@ import os + import pkg_resources _package_name = "honeybot" diff --git a/src/honeybot/manage.py b/src/honeybot/manage.py index 6c59afa..385f7ea 100644 --- a/src/honeybot/manage.py +++ b/src/honeybot/manage.py @@ -1,15 +1,15 @@ #!/usr/bin/env python3 -import logging -import sys import argparse +import logging import os +import sys try: - from honeybot.api.main import Bot_core - from honeybot.api.print import print_connect_settings - from honeybot.api.print import print_honeybot_manifesto from honeybot.api.generate import gen_pluginsinfo from honeybot.api.init import init + from honeybot.api.main import Bot_core + from honeybot.api.print import (print_connect_settings, + print_honeybot_manifesto) except Exception as e: print(e) diff --git a/src/honeybot/plugins/downloaded/blackjack/main.py b/src/honeybot/plugins/downloaded/blackjack/main.py index d342fab..0a2e47b 100644 --- a/src/honeybot/plugins/downloaded/blackjack/main.py +++ b/src/honeybot/plugins/downloaded/blackjack/main.py @@ -24,8 +24,8 @@ """ -import poker_assets.deck import poker_assets.card +import poker_assets.deck import poker_assets.hand import poker_assets.player diff --git a/src/honeybot/plugins/downloaded/blackjack/poker_assets/deck.py b/src/honeybot/plugins/downloaded/blackjack/poker_assets/deck.py index 9d13fd4..4b50419 100644 --- a/src/honeybot/plugins/downloaded/blackjack/poker_assets/deck.py +++ b/src/honeybot/plugins/downloaded/blackjack/poker_assets/deck.py @@ -3,6 +3,7 @@ # pylint: disable=E1601, W0612 import random + import card diff --git a/src/honeybot/plugins/downloaded/blackjack/poker_assets/game_init.py b/src/honeybot/plugins/downloaded/blackjack/poker_assets/game_init.py index ac7c382..0d94f2d 100644 --- a/src/honeybot/plugins/downloaded/blackjack/poker_assets/game_init.py +++ b/src/honeybot/plugins/downloaded/blackjack/poker_assets/game_init.py @@ -2,8 +2,8 @@ # pylint: disable=E1601, W0612 -import deck import board +import deck import hand import player import pot diff --git a/src/honeybot/plugins/downloaded/blackjack/poker_assets/test.py b/src/honeybot/plugins/downloaded/blackjack/poker_assets/test.py index 96668b2..c847fda 100644 --- a/src/honeybot/plugins/downloaded/blackjack/poker_assets/test.py +++ b/src/honeybot/plugins/downloaded/blackjack/poker_assets/test.py @@ -2,10 +2,10 @@ import board import deck +import game_init import hand import player import pot -import game_init # import game_init diff --git a/src/honeybot/plugins/downloaded/comic/main.py b/src/honeybot/plugins/downloaded/comic/main.py index fb9e199..6851a6d 100644 --- a/src/honeybot/plugins/downloaded/comic/main.py +++ b/src/honeybot/plugins/downloaded/comic/main.py @@ -14,9 +14,10 @@ returns a url of a random comic """ -import requests from random import randint +import requests + class Plugin: def __init__(self): diff --git a/src/honeybot/plugins/downloaded/converter/main.py b/src/honeybot/plugins/downloaded/converter/main.py index d3142e9..1c3856c 100644 --- a/src/honeybot/plugins/downloaded/converter/main.py +++ b/src/honeybot/plugins/downloaded/converter/main.py @@ -14,8 +14,9 @@ .convert help shows a list of currencies supported """ -import requests import math + +import requests from bs4 import BeautifulSoup diff --git a/src/honeybot/plugins/downloaded/corona/main.py b/src/honeybot/plugins/downloaded/corona/main.py index ec7cc74..83b7b32 100644 --- a/src/honeybot/plugins/downloaded/corona/main.py +++ b/src/honeybot/plugins/downloaded/corona/main.py @@ -16,11 +16,12 @@ .corona <> returns coronavirus information for a specific country """ -from bs4 import BeautifulSoup -import requests import datetime import string +import requests +from bs4 import BeautifulSoup + class Plugin: def __init__(self): diff --git a/src/honeybot/plugins/downloaded/mail/main.py b/src/honeybot/plugins/downloaded/mail/main.py index e5a78a1..3e8606c 100644 --- a/src/honeybot/plugins/downloaded/mail/main.py +++ b/src/honeybot/plugins/downloaded/mail/main.py @@ -23,9 +23,9 @@ .subject testing subject" """ +import configparser import smtplib from email.mime.text import MIMEText -import configparser # open config file for user credentials to email email_config = configparser.ConfigParser() diff --git a/src/honeybot/plugins/downloaded/monero/main.py b/src/honeybot/plugins/downloaded/monero/main.py index e4c6c05..8068c90 100644 --- a/src/honeybot/plugins/downloaded/monero/main.py +++ b/src/honeybot/plugins/downloaded/monero/main.py @@ -17,9 +17,10 @@ Examples: USD, EUR, BTC, GBP """ -from requests import Session import json +from requests import Session + class Plugin: def __init__(self): diff --git a/src/honeybot/plugins/downloaded/monopoly/main.py b/src/honeybot/plugins/downloaded/monopoly/main.py index 2b42496..b89bc94 100644 --- a/src/honeybot/plugins/downloaded/monopoly/main.py +++ b/src/honeybot/plugins/downloaded/monopoly/main.py @@ -47,8 +47,8 @@ import random -import monopoly_assets.monopoly_player import monopoly_assets.monopoly_assets +import monopoly_assets.monopoly_player class Plugin: diff --git a/src/honeybot/plugins/downloaded/news/main.py b/src/honeybot/plugins/downloaded/news/main.py index cff940f..667631d 100644 --- a/src/honeybot/plugins/downloaded/news/main.py +++ b/src/honeybot/plugins/downloaded/news/main.py @@ -12,8 +12,8 @@ >>> .news returns string of ten news headlines with newlines between """ -from bs4 import BeautifulSoup import requests +from bs4 import BeautifulSoup class Plugin: diff --git a/src/honeybot/plugins/downloaded/onthisday/main.py b/src/honeybot/plugins/downloaded/onthisday/main.py index 0035cb5..0bd68c7 100644 --- a/src/honeybot/plugins/downloaded/onthisday/main.py +++ b/src/honeybot/plugins/downloaded/onthisday/main.py @@ -11,11 +11,12 @@ returns fact's about today """ -import requests import datetime import json import random +import requests + # URL where we are getting the facts from: URL = "https://byabbe.se/on-this-day/" diff --git a/src/honeybot/plugins/downloaded/password_generator/main.py b/src/honeybot/plugins/downloaded/password_generator/main.py index c19f413..cb8b40c 100644 --- a/src/honeybot/plugins/downloaded/password_generator/main.py +++ b/src/honeybot/plugins/downloaded/password_generator/main.py @@ -24,9 +24,9 @@ special characters of specified length where length >= 4 """ -import string import random import secrets +import string class Plugin: diff --git a/src/honeybot/plugins/downloaded/repostats/main.py b/src/honeybot/plugins/downloaded/repostats/main.py index d21853b..428a161 100644 --- a/src/honeybot/plugins/downloaded/repostats/main.py +++ b/src/honeybot/plugins/downloaded/repostats/main.py @@ -15,10 +15,11 @@ """ -import requests -import bs4 as bs from urllib.parse import urlparse +import bs4 as bs +import requests + class Plugin: def __init__(self): diff --git a/src/honeybot/plugins/downloaded/story/main.py b/src/honeybot/plugins/downloaded/story/main.py index 36df565..d2e48cf 100644 --- a/src/honeybot/plugins/downloaded/story/main.py +++ b/src/honeybot/plugins/downloaded/story/main.py @@ -17,6 +17,7 @@ """ import random + import requests from bs4 import BeautifulSoup diff --git a/src/honeybot/plugins/downloaded/sysinfo/main.py b/src/honeybot/plugins/downloaded/sysinfo/main.py index 5f816d8..0dd1afb 100644 --- a/src/honeybot/plugins/downloaded/sysinfo/main.py +++ b/src/honeybot/plugins/downloaded/sysinfo/main.py @@ -14,10 +14,11 @@ returns General System Information, Boot Date and time, CPU information, Memory information, Disk Information and Network Information. """ -import psutil import platform from datetime import datetime +import psutil + class Plugin: def __init__(self): diff --git a/src/honeybot/plugins/downloaded/tpbquote/main.py b/src/honeybot/plugins/downloaded/tpbquote/main.py index b35f573..b1dcb9a 100644 --- a/src/honeybot/plugins/downloaded/tpbquote/main.py +++ b/src/honeybot/plugins/downloaded/tpbquote/main.py @@ -12,8 +12,9 @@ [Commands] >>>.quote """ -import requests import random + +import requests from bs4 import BeautifulSoup diff --git a/src/honeybot/plugins/downloaded/translate/main.py b/src/honeybot/plugins/downloaded/translate/main.py index 4d1f455..afb7dea 100644 --- a/src/honeybot/plugins/downloaded/translate/main.py +++ b/src/honeybot/plugins/downloaded/translate/main.py @@ -89,18 +89,14 @@ Yiddish yi """ -import os.path -import urllib.parse import gzip import json +import os.path +import urllib.parse +from urllib.request import (HTTPDefaultErrorHandler, HTTPError, + HTTPRedirectHandler, build_opener, urlparse) + from httplib2 import FileCache, Http -from urllib.request import ( - HTTPRedirectHandler, - HTTPDefaultErrorHandler, - HTTPError, - build_opener, - urlparse, -) # Hard-coded variables ### diff --git a/src/honeybot/store.py b/src/honeybot/store.py index cf9839d..f1891f7 100644 --- a/src/honeybot/store.py +++ b/src/honeybot/store.py @@ -1,6 +1,6 @@ -import os import importlib import json +import os BASE_DIR = "plugins/downloaded" STORE_DIR = "../../honeybot-store" diff --git a/workshop/normalbot/honeybot.py b/workshop/normalbot/honeybot.py index 9467725..07b5b3f 100644 --- a/workshop/normalbot/honeybot.py +++ b/workshop/normalbot/honeybot.py @@ -69,25 +69,20 @@ #. imports # #.################################################################################ -from tkinter import* - +import _thread # unused +import json +import math +import os +import random import re - import smtplib -from email.mime.multipart import MIMEMultipart -from email.mime.text import MIMEText -from email.header import Header - -import _thread#unused import socket import time -import os - import urllib.request -import json - -import random -import math +from email.header import Header +from email.mime.multipart import MIMEMultipart +from email.mime.text import MIMEText +from tkinter import * #from wordpress_xmlrpc import Client, WordPressPost #from wordpress_xmlrpc.methods import posts # NewPost diff --git a/workshop/tkinterhybridircclient/shut.py b/workshop/tkinterhybridircclient/shut.py index 897bab1..139f2e9 100644 --- a/workshop/tkinterhybridircclient/shut.py +++ b/workshop/tkinterhybridircclient/shut.py @@ -4,22 +4,19 @@ #me and david salinas #irc clent / tkinter dev is moxi +import json +import math +import multiprocessing +import os +import queue +import random import socket -import tkinter -from tkinter import * +import threading import time -import os - +import tkinter import urllib.request -import json - -import threading -import random -import multiprocessing from multiprocessing import Queue -import queue - -import math +from tkinter import * localtime = time.asctime( time.localtime(time.time()) ) key='put here your code' diff --git a/workshop/tkinterhybridircclient/v2000l.py b/workshop/tkinterhybridircclient/v2000l.py index 639be07..f465a9c 100644 --- a/workshop/tkinterhybridircclient/v2000l.py +++ b/workshop/tkinterhybridircclient/v2000l.py @@ -7,24 +7,21 @@ #Honeybot's disparities in code style is because of a trying out of Python #see the features in the honeybotfeatures.txt -import socket -import tkinter -from tkinter import * -import time -import os -import sys - -import urllib.request import json - -import threading -import random +import math import multiprocessing -from multiprocessing import Queue +import os import queue - -import math +import random +import socket +import sys +import threading +import time +import tkinter +import urllib.request from datetime import datetime +from multiprocessing import Queue +from tkinter import * localtime = time.asctime( time.localtime(time.time()) ) WUNDERGROUND_KEY=''