Skip to content

Commit

Permalink
Changed package structure
Browse files Browse the repository at this point in the history
  • Loading branch information
NecRaul committed Feb 21, 2024
1 parent 3ab75bb commit b294420
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 23 deletions.
23 changes: 1 addition & 22 deletions lain_upload/__init__.py
Original file line number Diff line number Diff line change
@@ -1,22 +1 @@
from .upload import upload_file
import argparse
import pyperclip


def main():
parser = argparse.ArgumentParser(description="Upload file to pomf.lain.la")
parser.add_argument("path", help="File path")

args = parser.parse_args()
response = upload_file(args.path)

if response:
url = response["files"][0]["url"]
pyperclip.copy(url)
print(f"File URL: {url}\nCopied to clipboard.")
else:
print("Upload failed.")


if __name__ == "__main__":
main()
name = "lain-upload"
22 changes: 22 additions & 0 deletions lain_upload/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from .upload import parse_file
import argparse
import pyperclip


def main():
parser = argparse.ArgumentParser(description="Upload file to pomf.lain.la")
parser.add_argument("path", help="File path")

args = parser.parse_args()
response = parse_file(args.path)

if response:
url = response["files"][0]["url"]
pyperclip.copy(url)
print(f"File URL: {url}\nCopied to clipboard.")
else:
print("Upload failed.")


if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
py_modules=["upload"],
entry_points={
"console_scripts": [
"lain-upload = lain_upload.__init__:main",
"lain-upload = lain_upload.main:main",
],
},
)

0 comments on commit b294420

Please sign in to comment.