Browse Source

Add proper setup.py and stuff

tags/v1.0.0
Cassidy Dingenskirchen 3 months ago
parent
commit
02bf7ae8e8
Signed by: StDingenskirchen GPG Key ID: 14FE9712CC42FE8B
16 changed files with 58 additions and 25 deletions
  1. +3
    -1
      .gitignore
  2. +10
    -1
      README.md
  3. +4
    -0
      blimp/__init__.py
  4. +9
    -3
      blimp/__main__.py
  5. +1
    -1
      blimp/cogs/alias.py
  6. +1
    -1
      blimp/cogs/board.py
  7. +1
    -1
      blimp/cogs/logging.py
  8. +2
    -2
      blimp/cogs/malarkey.py
  9. +1
    -2
      blimp/cogs/reminders.py
  10. +1
    -1
      blimp/cogs/rolekiosk.py
  11. +1
    -1
      blimp/cogs/tools.py
  12. +1
    -1
      blimp/cogs/welcome.py
  13. +1
    -1
      blimp/customizations.py
  14. +14
    -0
      default.nix
  15. +8
    -0
      setup.py
  16. +0
    -9
      shell.nix

+ 3
- 1
.gitignore View File

@@ -1,3 +1,5 @@
__pycache__
blimp.cfg
blimp.db
blimp.db
*.egg-info
result

+ 10
- 1
README.md View File

@@ -4,12 +4,21 @@
A Discord misc. tooling Bot, spiritual successor of Bampersand.
To run, you need [Nix](https://nixos.org/). BLIMP is written in Python.

Running in **development**:
```
$ cd blimp
$ nix-shell
[nix-shell:/blimp]$ python blimp
[nix-shell:/blimp]$ python -m blimp
```

Building the package for **production**:
```
$ cd blimp
$ nix build
$ ./result/bin/blimp
```


---

Copyright 2020 Cassidy Dingenskirchen and Contributors


+ 4
- 0
blimp/__init__.py View File

@@ -2,3 +2,7 @@
Ignore this file. The interesting thing happens in __main__.py.
Python's obsession with underscores is fun.
"""

from .customizations import *
from .eff_large_wordlist import *
from .objects import *

+ 9
- 3
blimp/__main__.py View File

@@ -9,8 +9,9 @@ from typing import Optional
import discord
from discord.ext import commands

from customizations import Blimp
import cogs
from .customizations import Blimp
from . import cogs


config = ConfigParser()
config.read("blimp.cfg")
@@ -147,4 +148,9 @@ async def on_command_error(ctx, error):
)


bot.run(config["discord"]["token"])
def main():
bot.run(config["discord"]["token"])


if __name__ == "__main__":
main()

+ 1
- 1
blimp/cogs/alias.py View File

@@ -4,7 +4,7 @@ from typing import Union
import discord
from discord.ext import commands

from customizations import Blimp
from ..customizations import Blimp


class Aliasing(Blimp.Cog):


+ 1
- 1
blimp/cogs/board.py View File

@@ -5,7 +5,7 @@ import re
import discord
from discord.ext import commands

from customizations import Blimp
from ..customizations import Blimp
from .alias import MaybeAliasedTextChannel




+ 1
- 1
blimp/cogs/logging.py View File

@@ -1,6 +1,6 @@
from discord.ext import commands

from customizations import Blimp
from ..customizations import Blimp
from .alias import MaybeAliasedTextChannel




+ 2
- 2
blimp/cogs/malarkey.py View File

@@ -4,8 +4,8 @@ import random
import discord
from discord.ext import commands

from customizations import Blimp
from eff_large_wordlist import WORDS
from ..customizations import Blimp
from ..eff_large_wordlist import WORDS


class Malarkey(Blimp.Cog):


+ 1
- 2
blimp/cogs/reminders.py View File

@@ -5,7 +5,7 @@ from typing import Union, Optional
import discord
from discord.ext import commands, tasks

from customizations import Blimp, ParseableDatetime, ParseableTimedelta
from ..customizations import Blimp, ParseableDatetime, ParseableTimedelta


class Reminders(Blimp.Cog):
@@ -37,7 +37,6 @@ class Reminders(Blimp.Cog):
self.log.warn(
f"Failed to deliver reminder {entry['id']}, origin {self.bot.represent_object(invoke_msg)}"
)
pass
finally:
self.bot.database.execute(
"DELETE FROM reminders_entries WHERE id=:id", {"id": entry["id"]},


+ 1
- 1
blimp/cogs/rolekiosk.py View File

@@ -6,7 +6,7 @@ import discord
from discord.ext import commands
from discord.ext.commands import UserInputError

from customizations import Blimp
from ..customizations import Blimp
from .alias import MaybeAliasedMessage




+ 1
- 1
blimp/cogs/tools.py View File

@@ -3,7 +3,7 @@ import asyncio
import discord
from discord.ext import commands

from customizations import Blimp, ParseableTimedelta
from ..customizations import Blimp, ParseableTimedelta
from .alias import MaybeAliasedCategoryChannel




+ 1
- 1
blimp/cogs/welcome.py View File

@@ -4,7 +4,7 @@ from string import Template
import discord
from discord.ext import commands

from customizations import Blimp
from ..customizations import Blimp
from .alias import MaybeAliasedTextChannel




+ 1
- 1
blimp/customizations.py View File

@@ -10,7 +10,7 @@ import discord
from discord import Activity, ActivityType
from discord.ext import commands

from objects import BlimpObjects
from .objects import BlimpObjects


class Blimp(commands.Bot):


+ 14
- 0
default.nix View File

@@ -0,0 +1,14 @@
with import (builtins.fetchTarball {
# nixos-unstable on 2020-07-18
url =
"https://github.com/NixOS/nixpkgs/tarball/d7e20ee25ed8aa1f0f24a9ca77026c6ef217f6ba";
sha256 = "1ar7prnrmmlqj17g57nqp82hgy5283dxb94akaqrwpbaz7qfwi4y";
}) { };

python3Packages.buildPythonPackage {
pname = "blimp";
version = "0.0.1";
src = ./.;
buildInputs = with python3Packages; [ black pylint ];
propagatedBuildInputs = with python3Packages; [ discordpy ];
}

+ 8
- 0
setup.py View File

@@ -0,0 +1,8 @@
from setuptools import setup, find_packages

setup(
name="blimp",
version="0.0.1",
packages=find_packages(),
entry_points={"console_scripts": ["blimp=blimp.__main__:main"]},
)

+ 0
- 9
shell.nix View File

@@ -1,9 +0,0 @@
with import (builtins.fetchTarball {
# nixos-unstable on 2020-07-18
url = "https://github.com/NixOS/nixpkgs/tarball/d7e20ee25ed8aa1f0f24a9ca77026c6ef217f6ba";
sha256 = "1ar7prnrmmlqj17g57nqp82hgy5283dxb94akaqrwpbaz7qfwi4y";
}) {};

mkShell {
buildInputs = [ python3 python3Packages.discordpy python3Packages.black python3Packages.pylint ];
}

Loading…
Cancel
Save