Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
Darkness4 committed Feb 19, 2021
1 parent a9a45ab commit 2d03811
Show file tree
Hide file tree
Showing 16 changed files with 100 additions and 9 deletions.
14 changes: 14 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Module",
"type": "python",
"request": "launch",
"module": "csgo_gsi_arduino_lcd"
}
]
}
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pyqt5 = "*"
[dev-packages]
pylama = "*"
black = "*"
pyinstaller = "*"

[requires]
python_version = "3.8"
Expand Down
45 changes: 44 additions & 1 deletion Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion csgo_gsi_arduino_lcd/__main__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from csgo_gsi_arduino_lcd.main import main

main()
if __name__ == "__main__":
main()
4 changes: 4 additions & 0 deletions csgo_gsi_arduino_lcd/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ def main():
app = QApplication(sys.argv)
w = CsgoWindow()
sys.exit(app.exec_())


if __name__ == "__main__":
main()
12 changes: 5 additions & 7 deletions csgo_gsi_arduino_lcd/ui/csgo_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@
from serial.tools import list_ports


def get_exec_path():
try:
sFile = os.path.abspath(sys.modules["__main__"].__file__)
except Exception:
sFile = sys.executable
return os.path.dirname(sFile)
def resource_path(relative_path: str):
if hasattr(sys, "_MEIPASS"):
return os.path.join(sys._MEIPASS, relative_path)
return os.path.join(os.path.abspath("."), relative_path)


class CsgoWindow(QWidget):
Expand Down Expand Up @@ -72,7 +70,7 @@ def __init__(self):
app_icon = QIcon()
for i in (16, 20, 24, 32, 48, 64, 128, 256, 512):
app_icon.addFile(
os.path.join(get_exec_path(), f"assets/csgo-{i}.ico"),
resource_path(f"assets/csgo-{i}.ico"),
QSize(i, i),
)

Expand Down
30 changes: 30 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
from setuptools import setup
import sys

scripts = ["csgogsilcd"]
if sys.platform == "win32":
scripts.append("csgogsilcd.bat")
setup(
name="csgo_gsi_arduino_lcd",
version="1.4.0",
description="CSGO's informations displayed on an Arduino featuring a bomb timer.",
author="Marc NGUYEN",
author_email="nguyen_marc@live.fr",
license="MIT",
url="https://github.com/Darkness4/csgo-gsi-arduino-lcd",
packages=["csgo_gsi_arduino_lcd"],
classifiers=[
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
],
scripts=scripts,
package_data={"assets": ["*"]},
install_requires=[
"PyQt5",
"pyserial",
"QtPy",
],
zip_safe=False,
)

0 comments on commit 2d03811

Please sign in to comment.