Skip to content

Commit 64be92b

Browse files
author
AndyEveritt
committed
made python package
1 parent 6081947 commit 64be92b

6 files changed

Lines changed: 71 additions & 2 deletions

File tree

.gitignore

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# File created using '.gitignore Generator' for Visual Studio Code: https://bit.ly/vscode-gig
2+
3+
# Created by https://www.toptal.com/developers/gitignore/api/windows,python
4+
# Edit at https://www.toptal.com/developers/gitignore?templates=windows,python
5+
6+
### Python ###
17
# Byte-compiled / optimized / DLL files
28
__pycache__/
39
*.py[cod]
@@ -50,6 +56,7 @@ coverage.xml
5056
*.py,cover
5157
.hypothesis/
5258
.pytest_cache/
59+
pytestdebug.log
5360

5461
# Translations
5562
*.mo
@@ -70,6 +77,7 @@ instance/
7077

7178
# Sphinx documentation
7279
docs/_build/
80+
doc/_build/
7381

7482
# PyBuilder
7583
target/
@@ -109,6 +117,7 @@ venv/
109117
ENV/
110118
env.bak/
111119
venv.bak/
120+
pythonenv*
112121

113122
# Spyder project settings
114123
.spyderproject
@@ -127,4 +136,41 @@ dmypy.json
127136

128137
# Pyre type checker
129138
.pyre/
130-
testlocal.py
139+
140+
# pytype static type analyzer
141+
.pytype/
142+
143+
# profiling data
144+
.prof
145+
146+
### Windows ###
147+
# Windows thumbnail cache files
148+
Thumbs.db
149+
Thumbs.db:encryptable
150+
ehthumbs.db
151+
ehthumbs_vista.db
152+
153+
# Dump file
154+
*.stackdump
155+
156+
# Folder config file
157+
[Dd]esktop.ini
158+
159+
# Recycle Bin used on file shares
160+
$RECYCLE.BIN/
161+
162+
# Windows Installer files
163+
*.cab
164+
*.msi
165+
*.msix
166+
*.msm
167+
*.msp
168+
169+
# Windows shortcuts
170+
*.lnk
171+
172+
# End of https://www.toptal.com/developers/gitignore/api/windows,python
173+
174+
# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option)
175+
176+
.vscode/*

DuetWebAPI.py renamed to DuetWebAPI/DuetWebAPI.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def __init__(self,base_url):
3636
URL=(f'{self._base_url}'+'/machine/status')
3737
r = self.requests.get(URL,timeout=(2,60))
3838
j = self.json.loads(r.text)
39-
_=j['result']
39+
_=j['boards'][0]['firmwareVersion']
4040
self.pt = 3
4141
return
4242
except:

DuetWebAPI/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from DuetWebAPI import DuetWebAPI

requirement.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
requests==2.24.0

setup.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
from setuptools import find_packages, setup
2+
3+
setup(
4+
name="duetwebapi",
5+
version="0.0.1",
6+
include_package_data=True,
7+
packages=find_packages(),
8+
9+
install_requires=[
10+
"requests==2.24.0",
11+
],
12+
13+
author="Andy Everitt",
14+
author_email="andreweveritt@e3d-online.com",
15+
description="Python interface to Duet REST API",
16+
url="https://github.com/AndyEveritt/DuetWebAPI",
17+
classifiers=[
18+
"Programming Language :: Python :: 3",
19+
"Operating System :: OS Independent",
20+
],
21+
)

testDWA.py

Whitespace-only changes.

0 commit comments

Comments
 (0)