Skip to content

Commit c57fdcd

Browse files
Create PyPI package files
1 parent 281b5ee commit c57fdcd

File tree

8 files changed

+134
-41
lines changed

8 files changed

+134
-41
lines changed

MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
include PyAvatar/images.py
2+
include PyAvatar/links.py
3+
include PyAvatar/images/*

__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Initialize PyPI Package
2+
3+
__all__ = ["main.avatars"]

__main__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from main import avatars
2+
3+
if __name__ == '__main__':
4+
avatars()

main.py

Lines changed: 46 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -19,53 +19,58 @@
1919
from tkinter import *
2020
import webbrowser
2121

22-
# Build Window
23-
window = Tk()
24-
window.title("Online Account Avatars and Banners")
22+
# Account Avatar Function
23+
row_count = 2
24+
column_count = 1
2525

26-
# Window Title
27-
title = Label(window, text = "Online Account Avatars and Banners", fg = "blue", font = "Consolas 20")
28-
title.grid(row = 1, column = 1, columnspan = 5)
26+
# PyAvatar Window
27+
def avatars():
28+
# Build Window
29+
window = Tk()
30+
window.title("Online Account Avatars and Banners")
2931

30-
# Placeholder Image Constant
31-
PLACEHOLDER = PhotoImage(file = "PyAvatar/images/placeholder.gif")
32+
# Window Title
33+
title = Label(window, text = "Online Account Avatars and Banners", fg = "blue", font = "Consolas 20")
34+
title.grid(row = 1, column = 1, columnspan = 5)
3235

33-
# Account Link Function
34-
def link(url):
35-
webbrowser.open_new(url)
36+
# Placeholder Image Constant
37+
PLACEHOLDER = PhotoImage(file = "PyAvatar/images/placeholder.gif")
3638

37-
# Account Avatar Function
38-
row_count = 2
39-
column_count = 1
40-
def accounts(image, name, hyperlink):
41-
global row_count
42-
global column_count
39+
# Account Link Function
40+
def link(url):
41+
webbrowser.open_new(url)
42+
43+
def accounts(image, name, hyperlink):
44+
# Build each account frame
45+
account = Frame(window)
46+
img_account = image # needs to be a GIF
47+
title_account = Label(account, image = img_account)
48+
text_account = Label(account, text = name)
49+
hyperlink_account = Label(account, text = hyperlink, fg = "blue", cursor = "hand2")
4350

44-
# Build each account frame
45-
account = Frame(window)
46-
img_account = image # needs to be a GIF
47-
title_account = Label(account, image = img_account)
48-
text_account = Label(account, text = name)
49-
hyperlink_account = Label(account, text = hyperlink, fg = "blue", cursor = "hand2")
51+
# Layout elements in frame
52+
title_account.pack(side = TOP)
53+
text_account.pack(side = BOTTOM)
54+
hyperlink_account.pack(side = BOTTOM)
55+
hyperlink_account.bind("<Button-1>", lambda e: link(hyperlink))
5056

51-
# Layout elements in frame
52-
title_account.pack(side = TOP)
53-
text_account.pack(side = BOTTOM)
54-
hyperlink_account.pack(side = BOTTOM)
55-
hyperlink_account.bind("<Button-1>", lambda e: link(hyperlink))
57+
# Layout elements in window
58+
global row_count
59+
global column_count
60+
if column_count <= 5:
61+
account.grid(row = row_count, column = column_count, padx= 5, pady= 5)
62+
column_count += 1
63+
else:
64+
row_count += 1
65+
column_count = 1
66+
account.grid(row = row_count, column = column_count, padx = 5, pady = 5)
5667

57-
# Layout elements in window
58-
if column_count <= 5:
59-
account.grid(row = row_count, column = column_count, padx= 5, pady= 5)
60-
column_count += 1
61-
else:
62-
row_count += 1
63-
column_count = 1
64-
account.grid(row = row_count, column = column_count, padx = 5, pady = 5)
68+
# Account Profiles
69+
accounts(PLACEHOLDER, "GitHub", "https://github.com")
70+
accounts(PLACEHOLDER, "GitLab", "https://gitlab.com")
6571

66-
# Account Profiles
67-
accounts(PLACEHOLDER, "Github", "https://github.com")
68-
accounts(PLACEHOLDER, "GitLab", "https://gitlab.com")
72+
# Sustain Window
73+
window.mainloop()
6974

70-
# Sustain Window
71-
window.mainloop()
75+
if __name__ == '__main__':
76+
avatars()

pyproject.toml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[build-system]
2+
build-backend = "setuptools.build_meta"
3+
requires = ["setuptools", "wheel"]
4+
5+
[project]
6+
name = "PyAvatar"
7+
version = "0.2.0"
8+
authors = [
9+
{ name= "willtheorangeguy" },
10+
]
11+
description = "Easily display all of your creative avatars to keep them consistent across websites."
12+
readme = "README.md"
13+
license = { file="LICENSE.md" }
14+
requires-python = ">=3.9"
15+
classifiers = [
16+
'Development Status :: 3 - Alpha',
17+
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
18+
'Natural Language :: English',
19+
'Operating System :: OS Independent',
20+
'Topic :: Utilities',
21+
]
22+
23+
[project.urls]
24+
"Homepage" = "https://github.com/Dog-Face-Development/PyAvatar"
25+
"Bug Tracker" = "https://github.com/Dog-Face-Development/PyAvatar/issues"
26+
27+
[tool.setuptools]
28+
include-package-data = true
29+
30+
[tool.setuptools.packages.find]
31+
where = ["PyAvatar"]

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Project Requirements

setup.cfg

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[metadata]
2+
name = pyavatar
3+
version = 0.2.0
4+
5+
[options]
6+
packages = find:
7+
package_dir =
8+
= PyAvatar
9+
include_package_data = True
10+
11+
[options.packages.find]
12+
where = PyAvatar
13+
14+
[options.entry_points]
15+
console_scripts =
16+
pyavatar = main:avatars

setup.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
from setuptools import setup, find_packages
2+
3+
def readme():
4+
with open('README.md') as f:
5+
return f.read()
6+
7+
setup(
8+
name='pyavatar',
9+
version='0.2.0',
10+
description="Easily display all of your creative avatars to keep them consistent across websites.",
11+
long_description=readme(),
12+
classifiers=[
13+
'Development Status :: 3 - Alpha',
14+
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
15+
'Natural Language :: English',
16+
'Operating System :: OS Independent',
17+
'Topic :: Utilities',
18+
],
19+
keywords='avatar web accounts gui',
20+
url='https://github.com/Dog-Face-Development/PyAvatar',
21+
author='willtheorangeguy',
22+
packages=find_packages(where="PyAvatar"),
23+
package_dir={"": "PyAvatar"},
24+
include_package_data=True,
25+
entry_points={
26+
'console_scripts': [
27+
'pyavatar=main:avatars'
28+
]
29+
},
30+
)

0 commit comments

Comments
 (0)