Compare commits

...

7 Commits

Author SHA1 Message Date
Hugh Rundle 52f7fd302d update docs 2023-06-18 19:22:15 +10:00
Hugh Rundle c3f366bf3f
Merge pull request #83 from hughrun/killpoetry
replace poetry with setuptools
2023-06-18 18:19:25 +10:00
Hugh Rundle 6a066a368c update requests minimum requirement 2023-06-18 18:19:00 +10:00
Hugh Rundle a5f6935e99
Merge pull request #82 from hughrun/add-boosts-only
Add boosts only
2023-06-18 18:16:53 +10:00
Hugh Rundle 0fe4f75df6 fix "not boosts only" check 2023-06-18 14:56:28 +10:00
Hugh Rundle 6296022d1b replace poetry with setuptools 2023-06-18 14:36:22 +10:00
wgahnagl 345621411c adds the option to only remove boosts 2020-09-18 19:33:20 -04:00
5 changed files with 34 additions and 25 deletions

1
MANIFEST.in Normal file
View File

@ -0,0 +1 @@
tests/*

View File

@ -1,8 +1,9 @@
# 🥳 ==> 🧼 ==> 😇
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://makeapullrequest.com)
**ephemetoot** is a Python command line tool for deleting old toots.
As Mastodon now has similar functionality built in, `ephemetoot` is now in maintenance mode - no new features will be added, only security updates.
## Quickstart
You should have Python3 and pip installed, and an app access token on hand. More detail information is available in [the docs](https://ephemetoot.hugh.run)
@ -46,9 +47,9 @@ You can use `ephemetoot` to delete [Mastodon](https://github.com/tootsuite/masto
* they are individually listed to be kept
## Contributing
ephemetoot is packaged using `poetry` and tested using `pytest`.
ephemetoot is tested using `pytest`.
For all bugs, suggestions, pull requests or other contributions, please check the [contributing guide](./docs/contributing.md).
For bugs or other contributions, please check the [contributing guide](./docs/contributing.md).
## License
This project and all contributions are [licensed](./LICENSE) under the GPL 3.0 or future version

View File

@ -62,6 +62,7 @@ Calling `--init` will save your configuration file as `config.yaml` in the curre
| base_url | **required** - The base url of your Mastodon server, without the 'https://'. e.g. `ausglam.space`|
| days_to_keep | Number of days to keep toots e.g. `30`. If no value is provided the default number is 365 |
| keep_pinned | Either `true` or `false` - if `true`, any pinned toots will be kept regardless of age |
| boosts_only | Either `true` or `false`. |
| toots_to_keep | A list of toot ids indicating toots to be kept regardless of other settings. The ID of a toot is the last part of its individual URL. e.g. for [https://ausglam.space/@hugh/101294246770105799](https://ausglam.space/@hugh/101294246770105799) the id is `101294246770105799` |
| hashtags_to_keep | A list of hashtags, where any toots with any of these hashtags will be kept regardless of age. Do not include the '#' symbol. Do remember the [rules for hashtags](https://docs.joinmastodon.org/user/posting/#hashtags) |
| visibility_to_keep | Toots with any of the visibility settings in this list will be kept regardless of age. Options are: `public`, `unlisted`, `private`, `direct`. |
@ -83,4 +84,4 @@ As of version 2, you can use a single `ephemetoot` installation to delete toots
* [Home](index.md)
* [Options](options.md)
* [Upgrading and uninstalling](upgrade.md)
* [Contributing](contributing.md)
* [Contributing](contributing.md)

View File

@ -192,6 +192,7 @@ def init():
conf_url = compulsory_input(tags, "Base URL", "(e.g. example.social):")
conf_days = digit_input(tags, "Days to keep", "(default 365):")
conf_pinned = yes_no_input(tags, "Keep pinned toots?")
conf_boosts_only = yes_no_input(tags, "Only remove boosted toots?")
conf_keep_toots = optional_input(
tags, "Toots to keep", "(optional list of IDs separated by commas):"
)
@ -219,6 +220,7 @@ def init():
configfile.write("\n base_url: " + conf_url)
configfile.write("\n days_to_keep: " + conf_days)
configfile.write("\n keep_pinned: " + conf_pinned)
configfile.write("\n boosts_only: " + conf_boosts_only)
if len(conf_keep_toots) > 0:
keep_list = conf_keep_toots.split(",")
@ -424,6 +426,7 @@ def retry_on_error(options, mastodon, toot, attempts=0):
def process_toot(config, options, mastodon, toot, deleted_count=0):
keep_pinned = "keep_pinned" in config and config["keep_pinned"]
boosts_only = "boosts_only" in config and config["boosts_only"]
toots_to_keep = config["toots_to_keep"] if "toots_to_keep" in config else []
visibility_to_keep = (
config["visibility_to_keep"] if "visibility_to_keep" in config else []
@ -491,7 +494,7 @@ def process_toot(config, options, mastodon, toot, deleted_count=0):
mastodon.status_unreblog(toot.reblog)
else:
elif not boosts_only:
console_print(
"❌ deleting toot " + str(toot.id) + " tooted " + tooted_date(toot),
options,

View File

@ -1,35 +1,38 @@
[tool.poetry]
[project]
name = "ephemetoot"
version = "3.1.4"
version = "3.2.0"
description = "A command line tool to delete your old toots"
authors = ["Hugh Rundle <ephemetoot@hugh.run>"]
license = "GPL-3.0-or-later"
requires-python = ">=3.8"
authors = [
{name = "Hugh Rundle", email = "ephemetoot@hugh.run"}
]
license = { text = "GPL-3.0-or-later"}
readme = "pypi-readme.md"
homepage = "https://ephemetoot.hugh.run"
repository = "https://github.com/hughrun/ephemetoot"
keywords = ["mastodon", "api", "microblogging"]
classifiers = [
"Environment :: Console",
"Operating System :: OS Independent",
"Topic :: Communications"
]
include = [
"LICENSE",
"tests"
dependencies = [
"requests>=2.31.0",
"mastodon.py>=1.4.3",
"pyyaml>=5.0"
]
[tool.poetry.dependencies]
python = "^3.8"
requests = "^2.22.0"
"mastodon.py" = "^1.4.3"
pyyaml = "^5.0"
[project.optional-dependencies]
dev = ["pytest>=6"]
[tool.poetry.dev-dependencies]
pytest = "^6"
[tool.poetry.scripts]
[project.scripts]
ephemetoot = 'ephemetoot.console:main'
[project.urls]
homepage = "https://ephemetoot.hugh.run"
repository = "https://github.com/hughrun/ephemetoot"
[build-system]
requires = ["poetry-core>=1.0.0a5"]
build-backend = "poetry.core.masonry.api"
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
[tool.setuptools]
packages = ["ephemetoot"]