Skip to content

Commit

Permalink
basic config
Browse files Browse the repository at this point in the history
  • Loading branch information
bigsk05 committed Oct 14, 2024
1 parent fafe488 commit b96a458
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 4 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ cython_debug/
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
.idea/

# ---> VisualStudio
## Ignore Visual Studio temporary files, build results, and
Expand Down Expand Up @@ -596,7 +596,8 @@ FodyWeavers.xsd
.LSOverride

# Icon must end with two \r
Icon
Icon


# Thumbnails
._*
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# Richka
# Richka - Python Async Download Engine

Python Async Download Engine
1 change: 1 addition & 0 deletions richka/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .config import *
Empty file added richka/__main__.py
Empty file.
8 changes: 8 additions & 0 deletions richka/__version__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
__title__ = "richka"
__description__ = "Python Async Download Engine."
__url__ = "https://github.com/ghinknet/richka"
__version__ = '0.0.1'
__author__ = "Ian Xia"
__author_email__ = "xia@ghink.net"
__license__ = "MIT"
__copyright__ = "Copyright Ian Xia"
13 changes: 13 additions & 0 deletions richka/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import richka

__VERSION = ("Alpha", 0, 0, 1)
USER_AGENT = f"Richka{__VERSION[0]}/{__VERSION[1]}.{__VERSION[2]}.{__VERSION[3]}"
HEADERS = {"user-agent": USER_AGENT}

def set_user_agent(user_agent: str) -> None:
richka.USER_AGENT = user_agent
richka.HEADERS["user-agent"] = user_agent

def set_headers(headers: dict) -> None:
for key, value in headers.items():
richka.HEADERS[key.lower()] = value
Empty file added richka/core.py
Empty file.
42 changes: 42 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import os
import sys

from setuptools import setup, find_packages

about = {}
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, "richka", "__version__.py"), "r") as f:
exec(f.read(), about)

with open("README.md", "r") as f:
readme = f.read()

if sys.argv[-1] == "publish":
os.system("python setup.py sdist bdist_wheel")
os.system("twine upload dist/*")
sys.exit()

setup(
name=about["__title__"],
version=about["__version__"],
description=about["__description__"],
packages=find_packages(),
url=about["__url__"],
license=about["__license__"],
author=about["__author__"],
author_email=about["__author_email__"],
long_description_content_type="text/markdown",
long_description=readme,
install_requires=[
],
classifiers=[
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3 :: Only',
],
entry_points={
'console_scripts': ['richka=richka.__main__:main'],
},
package_data={'': ['README.md']},
include_package_data=True,
zip_safe=False)

0 comments on commit b96a458

Please sign in to comment.