Changed release to 0.1.0

Some flake8 improvements
This commit is contained in:
lomion 2020-06-23 20:12:43 +02:00
parent c698cafa02
commit 2c5d3607f3
2 changed files with 13 additions and 13 deletions

View file

@ -1,6 +1,6 @@
maubot: 0.1.0
id: lomion.tmdb
version: 0.0.3
version: 0.1.0
license: AGPL 3.0
modules:
- tmdb

View file

@ -15,17 +15,18 @@ along with tmdb-bot. If not, see <https://www.gnu.org/licenses/>.
'''
from html import escape
from mautrix.types import TextMessageEventContent, MediaMessageEventContent, MessageType, Format, RelatesTo, RelationType
from mautrix.types import TextMessageEventContent, MediaMessageEventContent, MessageType, Format
from maubot import Plugin, MessageEvent
from maubot.handlers import command
from tmdb.tmdb_api import Movie
from sqlalchemy import (Column, String, Integer, ForeignKey, Table, MetaData,
select, and_)
from sqlalchemy import (Column, String, Integer, Table, MetaData,
select)
from sqlalchemy.engine.base import Engine
class Database:
db: Engine
@ -48,9 +49,10 @@ class Database:
def get_language(self, user_id):
rows = self.db.execute(select([self.language.c.language])
.where(self.language.c.user_id == user_id))
.where(self.language.c.user_id == user_id))
return rows.fetchone()
class TmdbBot(Plugin):
db: Database
@ -67,7 +69,7 @@ class TmdbBot(Plugin):
three_dotts = ""
cast = "Acting: "
for actor in movie.cast[:3]:
cast+= f'{actor}, '
cast += f'{actor}, '
cast = cast[:-2]
html_message = f"""<p><b>{escape(movie.title)}</b></p>
<p>{escape(movie.overview)[:200]}{three_dotts}</p>
@ -84,7 +86,6 @@ class TmdbBot(Plugin):
url=f"{mxc_uri}")
await evt.respond(content)
@command.new("movie-id", help="Movie lookup by id")
@command.argument("message", pass_raw=True, required=True)
async def movie_id(self, evt: MessageEvent, message: str = "") -> None:
@ -95,7 +96,6 @@ class TmdbBot(Plugin):
movie.query_details(message)
await self.send_movie_info(evt, movie)
@command.new("movie-search", help="Movie lookup by Title")
@command.argument("message", pass_raw=True, required=True)
async def movie_search(self, evt: MessageEvent, message: str = "") -> None: