Skip to content

Adding vim plugin to save and load from pastila.nl#32

Draft
Felixoid wants to merge 3 commits intomasterfrom
vim-plugin
Draft

Adding vim plugin to save and load from pastila.nl#32
Felixoid wants to merge 3 commits intomasterfrom
vim-plugin

Conversation

@Felixoid
Copy link
Member

No description provided.

- Replace requests by embedded urllib
- Add type hinting
- Make file loadable by `__name__ = "__main__"`
- Make "fingerprint" a random in the `save` url
- Use f-strings
- Use urlparse instead of regexps
@Felixoid
Copy link
Member Author

We need to think of parametric pastila.py to cover other endpoints. I will cover it within the scope of this PR.

@Felixoid Felixoid requested a review from Copilot July 22, 2025 23:10

This comment was marked as outdated.

@Felixoid Felixoid requested a review from Copilot July 22, 2025 23:27
@Felixoid
Copy link
Member Author

> pacman -Qi python-cryptography | ./pastila.py
https://pastila.nl/?06252529/dea1d129db4f8ac5cc2cf319a9336868#O6bLQva3VEr6KMw64Yf41g==
> ./pastila.py https://pastila.nl/?06252529/dea1d129db4f8ac5cc2cf319a9336868#O6bLQva3VEr6KMw64Yf41g==
Name            : python-cryptography
Version         : 45.0.5-1
Description     : A package designed to expose cryptographic recipes and primitives to Python developers
Architecture    : x86_64
URL             : https://github.com/pyca/cryptography
Licenses        : Apache-2.0 OR BSD-3-Clause
Groups          : None
Provides        : None
Depends On      : gcc-libs  glibc  openssl  python  python-cffi
Optional Deps   : None
Required By     : python-pip
Optional For    : python-telegram-bot
Conflicts With  : None
Replaces        : None
Installed Size  : 5.23 MiB
Packager        : Carl Smedstad <carsme@archlinux.org>
Build Date      : Wed 02 Jul 2025 16:37:17
Install Date    : Sat 12 Jul 2025 20:04:42
Install Reason  : Installed as a dependency for another package
Install Script  : No
Validated By    : Signature

This comment was marked as outdated.

@Felixoid Felixoid requested a review from Copilot July 22, 2025 23:39
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors a Python script for uploading/downloading content to/from pastila.nl, modernizing the code with improved type hints, error handling, and styling. The changes focus on replacing the requests library with urllib, adding type annotations, and improving code structure.

  • Modernized import statements and added comprehensive type hints
  • Replaced requests library with Python's built-in urllib for HTTP requests
  • Simplified the save function to always encrypt content and improved URL parsing in load function

@Felixoid
Copy link
Member Author

Following plan: adding the vim plugin to read buffer from or post to Pastila.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants