Skip to content

Version 0.45 #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 82 commits into from
Dec 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
9d6283d
Bump requests from 2.23.0 to 2.24.0
dependabot-preview[bot] Jun 22, 2020
914d946
Merge pull request #28 from Moduland/dependabot/pip/dev/requests-2.24.0
sepandhaghighi Jul 4, 2020
60725c0
Bump psutil from 5.7.0 to 5.7.2
dependabot-preview[bot] Jul 20, 2020
327e883
Merge pull request #29 from Moduland/dependabot/pip/dev/psutil-5.7.2
sepandhaghighi Jul 20, 2020
b0f700a
feat : pythonpublish.yml added
sepandhaghighi Jul 20, 2020
9baf775
doc : minor edit in README
sepandhaghighi Jul 20, 2020
7227b1d
feat : hibernate function added
sepandhaghighi Jul 20, 2020
f7fef9d
doc : CHANGELOG updated
sepandhaghighi Nov 14, 2020
70c8299
Merge pull request #33 from Moduland/workflows
sepandhaghighi Nov 15, 2020
98fab96
Bump art from 4.7 to 4.9
dependabot-preview[bot] Nov 15, 2020
f5d7d46
Merge pull request #31 from Moduland/dependabot/pip/dev/art-4.9
sepandhaghighi Nov 15, 2020
719836b
Bump psutil from 5.7.2 to 5.7.3
dependabot-preview[bot] Nov 15, 2020
fc68c28
Merge pull request #32 from Moduland/dependabot/pip/dev/psutil-5.7.3
sepandhaghighi Nov 15, 2020
1dae490
Bump requests from 2.24.0 to 2.25.0
dependabot-preview[bot] Nov 16, 2020
b3122f1
Merge pull request #34 from Moduland/dependabot/pip/dev/requests-2.25.0
sepandhaghighi Nov 16, 2020
125d468
fix : DEBUG param renamed to debug
sepandhaghighi Nov 16, 2020
b54c2f0
fix : __version__ added
sepandhaghighi Nov 16, 2020
3d07915
doc : CHANGELOG updated
sepandhaghighi Nov 16, 2020
9bd6c76
fix : minor edit in setup.py
sepandhaghighi Nov 16, 2020
fb6a7fb
doc : CHANGELOG updated
sepandhaghighi Nov 17, 2020
b1085a0
doc : docstrings updated
sepandhaghighi Nov 17, 2020
33ca44c
fix : VERSION renamed to ORANGETOOL_VERSION
sepandhaghighi Nov 20, 2020
192f6ff
fix : variables uppercased
sepandhaghighi Nov 20, 2020
f57eb44
fix : minor edit in __init__
sepandhaghighi Nov 20, 2020
56440e9
Merge pull request #37 from Moduland/debug
sepandhaghighi Nov 28, 2020
846dfe6
Bump art from 4.9 to 5.0
dependabot-preview[bot] Nov 28, 2020
285d62f
Merge pull request #39 from Moduland/dependabot/pip/dev/art-5.0
sepandhaghighi Nov 28, 2020
31f365f
feat : usb_control, usb_on and usb_off functions added #36
sepandhaghighi Nov 30, 2020
f398a2c
fix : new functions moved to orangetool_storage.py #36
sepandhaghighi Nov 30, 2020
0e249ae
doc : README updated #36
sepandhaghighi Nov 30, 2020
d37fe1a
doc : CHANGELOG updated #36
sepandhaghighi Nov 30, 2020
17ac645
fix : autopep8 #36
sepandhaghighi Nov 30, 2020
70ebe98
fix : minor edit in usb_control function #36
sepandhaghighi Dec 2, 2020
efc96b1
fix : minor edit in usb_control function #36
sepandhaghighi Dec 3, 2020
d212c75
Merge pull request #40 from Moduland/usb_control
sepandhaghighi Dec 6, 2020
ae93763
Bump art from 5.0 to 5.1
dependabot-preview[bot] Dec 7, 2020
163718f
Merge pull request #41 from Moduland/dependabot/pip/dev/art-5.1
sepandhaghighi Dec 7, 2020
6b0fdaa
doc : minor edits in docstrings
sepandhaghighi Dec 7, 2020
5e9631c
fix : ADDRESS parameter renamed to address
sepandhaghighi Dec 7, 2020
f31652e
fix : Zone parameter renamed to zone
sepandhaghighi Dec 7, 2020
5819421
fix : params moved to orangetool_params.py
sepandhaghighi Dec 7, 2020
a4a872b
fix : error messages updated
sepandhaghighi Dec 7, 2020
d7f578f
fix : error messages updated
sepandhaghighi Dec 7, 2020
536e3bd
doc : CHANGELOG updated
sepandhaghighi Dec 7, 2020
f87a936
fix : minor edit in version_check script
sepandhaghighi Dec 7, 2020
b4a910e
doc : docstrings updated
sepandhaghighi Dec 7, 2020
6bb1768
doc : CHANGELOG updated
sepandhaghighi Dec 7, 2020
b1a783f
fix : autopep8
sepandhaghighi Dec 7, 2020
d4fd9b7
fix : minor edit in test.sh
sepandhaghighi Dec 7, 2020
1c2e0db
doc : docstrings updated
sepandhaghighi Dec 7, 2020
378afc1
fix : uptime and idletime functions updated
sepandhaghighi Dec 7, 2020
8aa9fd9
doc : CHANGELOG updated
sepandhaghighi Dec 7, 2020
19c1421
fix : __init__ file updated
sepandhaghighi Dec 7, 2020
7fc5d13
fix : some functions moved to orangetool_utils.py
sepandhaghighi Dec 7, 2020
4e7ff30
doc : CHANGELOG updated
sepandhaghighi Dec 7, 2020
b7c5985
fix : orangetool_test.py added
sepandhaghighi Dec 7, 2020
56cd51d
Merge pull request #42 from Moduland/minor_edits
sepandhaghighi Dec 8, 2020
2af6d5d
feat : __main__.py added #43
sepandhaghighi Dec 8, 2020
293e69f
doc : CHANGELOG updated #43
sepandhaghighi Dec 8, 2020
79c4286
fix : .gitignore added
sepandhaghighi Dec 8, 2020
14bd339
doc : minor edit in README
sepandhaghighi Dec 8, 2020
16139b0
fix : test.sh updated #43
sepandhaghighi Dec 8, 2020
785b463
fix : minor edit in version_check script
sepandhaghighi Dec 10, 2020
1a30082
fix : minor bug fixed in mount_status function
sepandhaghighi Dec 10, 2020
ebb76c0
fix : minor edit in local_ip function
sepandhaghighi Dec 10, 2020
dc8afd5
fix : minor edit in set_ip function
sepandhaghighi Dec 10, 2020
ed5385d
doc : CHANGELOG updated
sepandhaghighi Dec 10, 2020
9fce3bf
doc : email updated
sepandhaghighi Dec 10, 2020
e77b4e7
del : FUNDING.yml removed
sepandhaghighi Dec 10, 2020
0029085
fix : minor edit in orangetool_test
sepandhaghighi Dec 10, 2020
20a55a5
doc : codebeat badge added to README
sepandhaghighi Dec 10, 2020
74e71c9
Merge pull request #44 from Moduland/main_script
sepandhaghighi Dec 19, 2020
56c141a
rel : migrate to version 0.45
sepandhaghighi Dec 20, 2020
8f5d09e
doc : CHANGELOG updated
sepandhaghighi Dec 20, 2020
911ea85
Bump psutil from 5.7.3 to 5.8.0
dependabot-preview[bot] Dec 21, 2020
5dc145c
Merge pull request #46 from Moduland/dependabot/pip/dev/psutil-5.8.0
sepandhaghighi Dec 21, 2020
48392c3
Bump requests from 2.25.0 to 2.25.1
dependabot-preview[bot] Dec 21, 2020
c3ffe35
Merge pull request #47 from Moduland/dependabot/pip/dev/requests-2.25.1
sepandhaghighi Dec 21, 2020
fb23400
doc : CHANGELOG updated
sepandhaghighi Dec 23, 2020
797b9dc
fix : minor edit in uptime and idletime functions
sepandhaghighi Dec 25, 2020
c2f4136
doc : CHANGELOG updated
sepandhaghighi Dec 25, 2020
b49adbe
doc : CHANGELOG updated
sepandhaghighi Dec 25, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at info@moduland.ir. All
reported by contacting the project team at info@orangetool.ir. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Expand Down
1 change: 0 additions & 1 deletion .github/FUNDING.yml

This file was deleted.

34 changes: 34 additions & 0 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- '*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*.tar.gz
twine upload dist/*.whl
100 changes: 100 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# Created by .ignore support plugin (hsz.mobi)
### Python template
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# dotenv
.env

# virtualenv
.venv/
venv/
ENV/

# Spyder project settings
.spyderproject

# Rope project settings
.ropeproject
### Example user template template
### Example user template

# IntelliJ project files
.idea
*.iml
out
gen
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ matrix:
install:
- pip install -r requirements.txt
- python setup.py install
- python -m orangetool
before_script:
- pip install --upgrade --upgrade-strategy=only-if-needed -r dev-requirements.txt
- chmod +x test.sh
Expand Down
17 changes: 15 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,23 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [0.45] - 2020-12-26
### Added
- `FUNDING.yml`
- `__main__.py`
- `__version__` variable
- `hibernate` function
- `usb_control`, `usb_on` and `usb_off` functions
### Changed
- `dev-requirements.txt` modified
- Test system modified
- `DEBUG` parameter renamed to `debug`
- All parameters moved to `orangetool_params.py`
- Some functions moved to `orangetool_utils.py`
- `ADDRESS` parameter renamed to `address`
- `Zone` parameter renamed to `zone`
- `uptime` and `idletime` functions updated
- Docstrings updated
- `README.md` modified
## [0.35] - 2019-06-01
### Added
- `version_check.py`
Expand Down Expand Up @@ -69,7 +81,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Added
- Some useful scripts for Orangepi/Raspberrypi boards

[Unreleased]: https://github.com/Moduland/Orangetool/compare/v0.35...dev
[Unreleased]: https://github.com/Moduland/Orangetool/compare/v0.45...dev
[0.45]: https://github.com/Moduland/Orangetool/compare/v0.35...v0.45
[0.35]: https://github.com/Moduland/Orangetool/compare/v0.25...v0.35
[0.25]: https://github.com/Moduland/Orangetool/compare/v0.24...v0.25
[0.24]: https://github.com/Moduland/Orangetool/compare/v0.23...v0.24
Expand Down
43 changes: 28 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ Tested on [Lubuntu](http://lubuntu.me/)
<table>
<tr>
<td align="center">Code Quality</td>
<td align="center"><a href="https://www.codacy.com/app/sepand-haghighi/Orangetool?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=Moduland/Orangetool&amp;utm_campaign=Badge_Grade"><img src="https://api.codacy.com/project/badge/Grade/ad9374e6e7b24a63b34d6a4f419497ac"/></a></td>
<td align="center"><a href="https://www.codacy.com/app/sepand-haghighi/Orangetool?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=Moduland/Orangetool&amp;utm_campaign=Badge_Grade"><img src="https://api.codacy.com/project/badge/Grade/ad9374e6e7b24a63b34d6a4f419497ac"/></a></td>
<td align="center"><a href="https://codebeat.co/projects/github-com-moduland-orangetool-dev"><img alt="codebeat badge" src="https://codebeat.co/badges/78f987a9-d504-4d29-b98d-21dd1f2d319e" /></a></td>
<td align="center"><a href="https://www.codefactor.io/repository/github/moduland/orangetool"><img src="https://www.codefactor.io/repository/github/moduland/orangetool/badge" alt="CodeFactor" /></a></td>
</tr>
</table>
Expand All @@ -83,13 +84,13 @@ By [Moduland Co](http://www.moduland.ir)

## Installation
### Source Code
- Download [Version 0.35](https://github.com/moduland/Orangetool/archive/v0.35.zip) or [Latest Source ](https://github.com/Moduland/Orangetool/archive/dev.zip)
- Download [Version 0.45](https://github.com/moduland/Orangetool/archive/v0.45.zip) or [Latest Source ](https://github.com/Moduland/Orangetool/archive/dev.zip)
- `pip3 install -r requirements.txt` or `pip install -r requirements.txt` (Need root access)
- `python3 setup.py install` or `python setup.py install`
### PyPI

- Check [Python Packaging User Guide](https://packaging.python.org/installing/)
- `pip3 install orangetool==0.35` or `pip install orangetool==0.35` (Need root access)
- `pip3 install orangetool==0.45` or `pip install orangetool==0.45` (Need root access)
<div align="center">
<a href="https://asciinema.org/a/141548" target="_blank"><img src="https://asciinema.org/a/141548.png" /></a>
</div>
Expand Down Expand Up @@ -128,7 +129,7 @@ ip_status=orangetool.ping(ip_address) #this function check ip and return True if

#5- set_ip

set_ip("192.168.1.46","eth0") #this function set static ip for system
orangetool.set_ip("192.168.1.46","eth0") #this function set static ip for system

#6- mac

Expand Down Expand Up @@ -188,6 +189,14 @@ orangetool.unmount_all() #This function unmount all of the mounted devices

orangetool.mount("sda1","/mnt/usb1") # This function mount input device in input addresses

#6- usb_on

orangetool.usb_on() # This function enable USB

#7- usb_off

orangetool.usb_off() # This function disable USB

```

### Display Functions
Expand All @@ -214,38 +223,42 @@ orangetool.hdmi_size(1280,720) # this function change hdmi display resolution

orangetool.sleep() # put system in sleep mode

#2- halt
#2- hibernate

orangetool.hibernate() # put system in hibernate mode

#3- halt

orangetool.halt() # poweroff system

#3- restart
#4- restart

orangetool.restart() # restart system

#4- wakeup
#5- wakeup

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

#5- get_temp
#6- get_temp

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

#6- uptime
#7- uptime

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

#7- idletime
#8- idletime

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


#8- version
#9- version

orangetool.version() # return orangetool version for test

#9- check_update
#10- check_update

orangetool.check_update # Return True if new version is available
orangetool.check_update() # Return True if new version is available

```

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



## Issues & Bug Reports

Just fill an issue and describe it. We'll check it ASAP!
or send an email to [info@moduland.ir](mailto:info@moduland.ir "info@moduland.ir").
or send an email to [info@orangetool.ir](mailto:info@orangetool.ir "info@orangetool.ir").

## Dependencies

Expand Down
6 changes: 3 additions & 3 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
psutil==5.7.0
requests==2.23.0
art==4.7
psutil==5.8.0
requests==2.25.1
art==5.1
setuptools>=40.8.0
vulture>=1.0
bandit>=1.5.1
Expand Down
34 changes: 7 additions & 27 deletions orangetool/__init__.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,11 @@
# -*- coding: utf-8 -*-
"""Orangetool modules."""
"""
MIT License

Copyright (c) 2017 Moduland Co
from .orangetool_display import hdmi_on, hdmi_off, hdmi_size
from .orangetool_ip import internet, local_ip, global_ip, set_ip, ping, mac
from .orangetool_system import check_update, get_temp, uptime, idletime, wakeup, version, sleep, hibernate, halt, restart
from .orangetool_ram import ram_total, ram_used, ram_free, ram_percent, freeup
from .orangetool_storage import mount_status, storage_status, unmount, unmount_all, mount, usb_on, usb_off
from .orangetool_params import ORANGETOOL_VERSION

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""

from .orangetool_display import *
from .orangetool_ip import *
from .orangetool_system import *
from .orangetool_ram import *
from .orangetool_storage import *
__version__ = ORANGETOOL_VERSION
7 changes: 7 additions & 0 deletions orangetool/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -*- coding: utf-8 -*-
"""Orangetool main."""

from .orangetool_system import version

if __name__ == "__main__":
version()
Loading