Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring - Sorting imports with isort #139

Merged
merged 1 commit into from
Jul 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#
import os
import sys

sys.path.insert(0, os.path.abspath('../../src/honeybot/'))


Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/honeybot/api/init.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
15 changes: 7 additions & 8 deletions src/honeybot/api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions src/honeybot/api/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os

import pkg_resources

_package_name = "honeybot"
Expand Down
10 changes: 5 additions & 5 deletions src/honeybot/manage.py
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
2 changes: 1 addition & 1 deletion src/honeybot/plugins/downloaded/blackjack/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"""


import poker_assets.deck
import poker_assets.card
import poker_assets.deck
import poker_assets.hand
import poker_assets.player

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# pylint: disable=E1601, W0612

import random

import card


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# pylint: disable=E1601, W0612

import deck
import board
import deck
import hand
import player
import pot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import board
import deck
import game_init
import hand
import player
import pot
import game_init

# import game_init

Expand Down
3 changes: 2 additions & 1 deletion src/honeybot/plugins/downloaded/comic/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
returns a url of a random comic
"""

import requests
from random import randint

import requests


class Plugin:
def __init__(self):
Expand Down
3 changes: 2 additions & 1 deletion src/honeybot/plugins/downloaded/converter/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
.convert help
shows a list of currencies supported
"""
import requests
import math

import requests
from bs4 import BeautifulSoup


Expand Down
5 changes: 3 additions & 2 deletions src/honeybot/plugins/downloaded/corona/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
.corona <<country>>
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):
Expand Down
2 changes: 1 addition & 1 deletion src/honeybot/plugins/downloaded/mail/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
3 changes: 2 additions & 1 deletion src/honeybot/plugins/downloaded/monero/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
Examples: USD, EUR, BTC, GBP
"""

from requests import Session
import json

from requests import Session


class Plugin:
def __init__(self):
Expand Down
2 changes: 1 addition & 1 deletion src/honeybot/plugins/downloaded/monopoly/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@

import random

import monopoly_assets.monopoly_player
import monopoly_assets.monopoly_assets
import monopoly_assets.monopoly_player


class Plugin:
Expand Down
2 changes: 1 addition & 1 deletion src/honeybot/plugins/downloaded/news/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion src/honeybot/plugins/downloaded/onthisday/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/"

Expand Down
2 changes: 1 addition & 1 deletion src/honeybot/plugins/downloaded/password_generator/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
special characters of specified length where length >= 4
"""

import string
import random
import secrets
import string


class Plugin:
Expand Down
5 changes: 3 additions & 2 deletions src/honeybot/plugins/downloaded/repostats/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
1 change: 1 addition & 0 deletions src/honeybot/plugins/downloaded/story/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"""

import random

import requests
from bs4 import BeautifulSoup

Expand Down
3 changes: 2 additions & 1 deletion src/honeybot/plugins/downloaded/sysinfo/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
3 changes: 2 additions & 1 deletion src/honeybot/plugins/downloaded/tpbquote/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
[Commands]
>>>.quote <count>
"""
import requests
import random

import requests
from bs4 import BeautifulSoup


Expand Down
14 changes: 5 additions & 9 deletions src/honeybot/plugins/downloaded/translate/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ###

Expand Down
2 changes: 1 addition & 1 deletion src/honeybot/store.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
import importlib
import json
import os

BASE_DIR = "plugins/downloaded"
STORE_DIR = "../../honeybot-store"
Expand Down
23 changes: 9 additions & 14 deletions workshop/normalbot/honeybot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 9 additions & 12 deletions workshop/tkinterhybridircclient/shut.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Loading