Browse Source

Split up and prepare for packaging

master
parent
commit
abe109d9b4
No known key found for this signature in database GPG Key ID: DA34C790D267C164
6 changed files with 40 additions and 12 deletions
  1. +1
    -0
      .gitignore
  2. +21
    -0
      LICENSE
  3. +0
    -7
      README.md
  4. +6
    -0
      TODO.md
  5. +8
    -1
      pyproject.toml
  6. +4
    -4
      tildee/models.py

+ 1
- 0
.gitignore View File

@ -1,2 +1,3 @@
__pycache__/
tildee.egg-info/
dist/

+ 21
- 0
LICENSE View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2019 deing <admin@15318.de>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

+ 0
- 7
README.md View File

@ -8,10 +8,3 @@ This uses [Poetry](https://poetry.eustace.io/) to manage dependencies and [Black
## Development
To install dependencies, run `poetry install`. You can run a python shell in the environment using `poetry run python` (I'd recommend using `ipython`, too). Format your code before committing by running `black .`.
## Todo
- Tests if I find a way to do this meaningfully
- 2FA support for logging in
- Stabilize, clean up and publish on PyPI
- Implement applying comment labels
- Implement parsing topic logs and vote counts

+ 6
- 0
TODO.md View File

@ -0,0 +1,6 @@
## Todo
- Tests if I find a way to do this meaningfully
- 2FA support for logging in
- Stabilize, clean up and publish on PyPI
- Implement applying comment labels
- Implement parsing topic logs and vote counts

+ 8
- 1
pyproject.toml View File

@ -1,9 +1,16 @@
[tool.poetry]
name = "tildee"
version = "0.1.0"
version = "0.2.0"
description = "A client for tildes.net"
license = "MIT"
readme = "README.md"
authors = ["deing <admin@15318.de>"]
classifiers = [
"Operating System :: OS Independent",
"Topic :: Internet :: WWW/HTTP",
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
]
[tool.poetry.dependencies]
python = "^3.7"


+ 4
- 4
tildee/models.py View File

@ -14,9 +14,9 @@ class TildesTopic:
self.title = self._tree.cssselect("article.topic-full > header > h1")[0].text
try:
self.content_html = etree.tostring(
self.content_html = str(etree.tostring(
self._tree.cssselect("div.topic-full-text")[0]
)
))
except IndexError:
self.content_html = None
@ -48,7 +48,7 @@ class TildesComment:
self.timestamp = self._tree.cssselect("time.comment-posted-time")[0].attrib[
"datetime"
]
self.content_html = etree.tostring(self._tree.cssselect("div.comment-text")[0])
self.content_html = str(etree.tostring(self._tree.cssselect("div.comment-text")[0]))
self.children = []
comments = self._tree.cssselect("ol.comment-tree-replies > li > article")
for comment in comments:
@ -101,4 +101,4 @@ class TildesMessage:
self.timestamp = self._tree.cssselect("time.time-responsive")[0].attrib[
"datetime"
]
self.content_html = etree.tostring(self._tree.cssselect("div.message-text")[0])
self.content_html = str(etree.tostring(self._tree.cssselect("div.message-text")[0]))

Loading…
Cancel
Save