Skip to content

Commit 70c8299

Browse files
Merge pull request #33 from Moduland/workflows
Workflows
2 parents 327e883 + f7fef9d commit 70c8299

File tree

4 files changed

+59
-10
lines changed

4 files changed

+59
-10
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
name: Upload Python Package
5+
6+
on:
7+
push:
8+
# Sequence of patterns matched against refs/tags
9+
tags:
10+
- '*' # Push events to matching v*, i.e. v1.0, v20.15.10
11+
12+
jobs:
13+
deploy:
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Set up Python
20+
uses: actions/setup-python@v1
21+
with:
22+
python-version: '3.x'
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install setuptools wheel twine
27+
- name: Build and publish
28+
env:
29+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
30+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
31+
run: |
32+
python setup.py sdist bdist_wheel
33+
twine upload dist/*.tar.gz
34+
twine upload dist/*.whl

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77
## [Unreleased]
88
### Added
99
- `FUNDING.yml`
10+
- `hibernate` function
1011
### Changed
1112
- `dev-requirements.txt` modified
1213
- Test system modified

README.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -214,38 +214,42 @@ orangetool.hdmi_size(1280,720) # this function change hdmi display resolution
214214

215215
orangetool.sleep() # put system in sleep mode
216216

217-
#2- halt
217+
#2- hibernate
218+
219+
orangetool.hibernate() # put system in hibernate mode
220+
221+
#3- halt
218222

219223
orangetool.halt() # poweroff system
220224

221-
#3- restart
225+
#4- restart
222226

223227
orangetool.restart() # restart system
224228

225-
#4- wakeup
229+
#5- wakeup
226230

227231
orangetool.wakeup(day=1,hour=0,minute=1) # set rtc wakeuptime
228232

229-
#5- get_temp
233+
#6- get_temp
230234

231235
temp=orangetool.get_temp() # this function return cpu temperature as string
232236

233-
#6- uptime
237+
#7- uptime
234238

235239
time=orangetool.uptime() # this function return uptime of system
236240

237-
#7- idletime
241+
#8- idletime
238242

239243
time=orangetool.idletime() # this function return idle of system ( all cores)
240244

241245

242-
#8- version
246+
#9- version
243247

244248
orangetool.version() # return orangetool version for test
245249

246-
#9- check_update
250+
#10- check_update
247251

248-
orangetool.check_update # Return True if new version is available
252+
orangetool.check_update() # Return True if new version is available
249253

250254
```
251255

@@ -255,7 +259,7 @@ orangetool.check_update # Return True if new version is available
255259
- `local_ip` and `global_ip` originally are available in ipz package [Link](http://github.com/sepandhaghighi/ipz)
256260
- RAM functions in this version need psutil package
257261
- Running `set_ip` function remotely will freeze your terminal so it's better to set `restart` parameter to True
258-
- Running `halt`,`restart` & `sleep` functions remotely will freeze your terminal
262+
- Running `halt`,`restart`,`hibernate` & `sleep` functions remotely will freeze your terminal
259263
- Some of funtions need root access so it's better to run ```sudo -s``` before use this tool
260264

261265

orangetool/orangetool_system.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,16 @@ def sleep(DEBUG=False):
200200
"""
201201
power_control("pm-suspend", DEBUG)
202202

203+
def hibernate(DEBUG=False):
204+
"""
205+
Shortcut for hibernate command (need sudo).
206+
207+
:param DEBUG: flag for using Debug mode
208+
:type DEBUG:bool
209+
:return: None
210+
"""
211+
power_control("pm-hibernate", DEBUG)
212+
203213

204214
def halt(DEBUG=False):
205215
"""

0 commit comments

Comments
 (0)