Skip to content

Commit

Permalink
Merge branch 'task1' of https://github.com/Harshal662/PaperPi into task1
Browse files Browse the repository at this point in the history
  • Loading branch information
Harshal662 committed Jun 24, 2023
2 parents d8c1bbe + c5cf284 commit 1e65ab9
Show file tree
Hide file tree
Showing 32 changed files with 1,130 additions and 1,904 deletions.
17 changes: 16 additions & 1 deletion .wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,19 @@ Github
QueryLMS
GeoJSON
jpg
jpeg
jpeg
diskuse
diskuse_pct
diskfree
diskfree_pct
cpuload_5
ipaddress
cputemp
GigaByte
KiloByte
MegaByte
TeraByte
hostname
Hostname
cpu
cpuload
7 changes: 7 additions & 0 deletions documentation/Change_Log.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Change Log

## 0.5.3.0

* System_Info Plugin:
* Add plugin
* Utilities
* ignore local library imports that are not needed

## 0.5.2.0

* Moon_phase:
Expand Down
16 changes: 15 additions & 1 deletion documentation/Plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,22 @@ All plugins are configured through the `paperpi.ini` files. For a single-user co

[end: plugin_header]: #



[start: basic_clock]: #

### [basic_clock](../paperpi/plugins/basic_clock/README.md)

![basic_clock sample image](../paperpi/plugins/basic_clock/basic_clock.layout-L-sample.png)



[end: basic_clock]: #



[start: crypto]: #

### [crypto](../paperpi/plugins/crypto/README.md)
![crypto sample image](../paperpi/plugins/crypto/crypto.layout-L-sample.png)

Expand Down Expand Up @@ -87,12 +96,17 @@ All plugins are configured through the `paperpi.ini` files. For a single-user co

[end: splash_screen]: #

[start: system_info]: #
### [system_info](../paperpi/plugins/system_info/README.md) <font color="red">R</font><font color="green">G</font><font color="blue">B</font>
![system_info sample image](../paperpi/plugins/system_info/system_info.layout-L-sample.png)

[end: system_info]: #

[start: word_clock]: #
### [word_clock](../paperpi/plugins/word_clock/README.md) <font color="red">R</font><font color="green">G</font><font color="blue">B</font>
![word_clock sample image](../paperpi/plugins/word_clock/word_clock.layout-L-sample.png)

[end: word_clock]: #

[start: xkcd_comic]: #
### [xkcd_comic](../paperpi/plugins/xkcd_comic/README.md)
![xkcd_comic sample image](../paperpi/plugins/xkcd_comic/xkcd_comic.layout-L-sample.png)
Expand Down
51 changes: 39 additions & 12 deletions install/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,28 @@ function abort {
}


function stop_daemon {
echo "checking if $SYSTEMD_UNIT_FILE_NAME is running"

if /usr/bin/systemctl is-active --quiet $SYSTEMD_UNIT_FILE_NAME
then

echo "stopping PaperPi daemon"
/usr/bin/systemctl stop $SYSTEMD_UNIT_FILE_NAME
if [ $? -ne 0 ]
then
echo "failed to stop daemon"
echo "try to stop manually with:"
echo "$ sudo systemctl stop $SYSTEMD_UNIT_FILE_NAME"
echo "exiting"
abort
fi
else
echo " $SYSTEMD_UNIT_FILE_NAME not running"
fi
echo "done"
}

# install requirements from the plugin requirements-*.txt files
function install_plugin_requirements {

Expand Down Expand Up @@ -303,23 +325,25 @@ function install_unit_file {
echo ""
echo "you selected to run on demand"
echo "you can enable the daemon later by typing:"
echo "$ sudo systemctl enable $SYSTEMMD_UNIT_FILE_NAME"
echo "$ sudo systemctl enable $SYSTEMD_UNIT_FILE_NAME"
echo ""
fi
fi

if [ $UNINSTALL -gt 0 ] || [ $PURGE -gt 0 ]
then
echo "stopping daemon"
/usr/bin/systemctl stop $SYSTEMD_UNIT_FILE_NAME
if [ $? -ne 0 ]
then
echo "failed to stop daemon"
echo "try to stop manually with:"
echo "$ sudo systemctl stop $SYSTEMD_UNIT_FILE_NAME"
echo "exiting"
abort
fi

stop_daemon
# echo "stopping daemon"
# /usr/bin/systemctl stop $SYSTEMD_UNIT_FILE_NAME
# if [ $? -ne 0 ]
# then
# echo "failed to stop daemon"
# echo "try to stop manually with:"
# echo "$ sudo systemctl stop $SYSTEMD_UNIT_FILE_NAME"
# echo "exiting"
# abort
# fi

echo "removing $SYSTEMD_UNIT_PATH"

Expand Down Expand Up @@ -486,7 +510,9 @@ function check_permissions {
Try:
$ sudo $0
This installer will setup/uninstall $APPNAME to run at system boot and does the following:
This installer requires root permissions and will setup/uninstall
$APPNAME to run at system boot. The installer does the following:
* copy $APPNAME excutable to $BINPATH
* create configuration files in $SYSTEM_CONFIG_PATH
* setup systemd unit files in $SYSTEMD_UNIT_FILE_NAME
Expand Down Expand Up @@ -578,6 +604,7 @@ fi
# set the pipenv venv to be within the project directory (1)
export PIPENV_VENV_IN_PROJECT=1

stop_daemon
check_permissions
check_deb_packages
check_py_packages
Expand Down
16 changes: 16 additions & 0 deletions paperpi/config/paperpi.ini
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,22 @@ refresh_rate = 30
min_display_time = 60
max_priority = 2**15

[xPlugin: System Info]
# show basic facts about the system including IP, Hostname, CPU usage, temperature and storage
# default layout
layout = layout
# the literal name of your module
plugin = system_info
# recommended display time
min_display_time = 45
# maximum priority in display loop
max_priority = 2
# storage units in decimal: [KB] KiloByte 10^3; [MB] MegaByte 10^6; [GB] GigaByte 10^12; [TB] TeraByte 10^12
storage_unit = GB
# colors for RGB screens
text_color = BLUE
bkground_color = WHITE

[xPlugin: A Demo Plugin]
# this is a sample config users can use to help setup the plugin
# default layout
Expand Down
46 changes: 15 additions & 31 deletions paperpi/library/get_help.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,16 @@
" p = Path(root).resolve()\n",
" for i in p.glob('*'):\n",
" if i.is_dir() and i.name[0] not in ('_', '.'):\n",
" module_list.append(i.name)\n",
" return module_list"
" module_name = i.name\n",
" module_path = i / f\"{module_name}.py\"\n",
" if module_path.exists() and module_path.is_file():\n",
" module_list.append(module_name)\n",
" else:\n",
" if not module_path.exists():\n",
" print(f\"Warning: Plugin '{module_name}' does not have a corresponding '.py' file and will be ignored.\")\n",
" elif not module_path.is_file():\n",
" print(f\"Warning: Plugin '{module_name}' has a non-file entry with the same name and will be ignored.\")\n",
" return sorted(module_list)"
]
},
{
Expand Down Expand Up @@ -323,31 +331,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"id": "f835e662",
"metadata": {},
"outputs": [
{
"data": {
"application/javascript": [
"IPython.notebook.kernel.execute('nb_name = \"' + IPython.notebook.notebook_name + '\"')\n"
],
"text/plain": [
"<IPython.core.display.Javascript object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"%%javascript\n",
"IPython.notebook.kernel.execute('nb_name = \"' + IPython.notebook.notebook_name + '\"')"
]
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 2,
"id": "7011fce2",
"metadata": {},
"outputs": [
Expand All @@ -356,12 +340,12 @@
"output_type": "stream",
"text": [
"[NbConvertApp] Converting notebook get_help.ipynb to python\n",
"[NbConvertApp] Writing 7337 bytes to get_help.py\n"
"[NbConvertApp] Writing 7343 bytes to get_help.py\n"
]
}
],
"source": [
"!jupyter-nbconvert --to python --template python_clean {nb_name}"
"!jupyter-nbconvert --to python --template python_clean get_help.ipynb"
]
},
{
Expand All @@ -378,9 +362,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "paperpi-fN25Eeb-",
"display_name": "PaperPi-VBShxqF-",
"language": "python",
"name": "paperpi-fn25eeb-"
"name": "paperpi-vbshxqf-"
},
"language_info": {
"codemirror_mode": {
Expand Down
2 changes: 0 additions & 2 deletions paperpi/library/get_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,5 +304,3 @@ def get_help(module=None, print_help=True, plugin_path='./plugins'):





2 changes: 1 addition & 1 deletion paperpi/my_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
APP_NAME = 'PaperPi'
CONTACT='aaron.ciuffo@gmail.com'
DEVEL_NAME = f'com.txoof.{APP_NAME.lower()}'
VERSION='0.5.2.0 RGB'
VERSION='0.5.3.0 RGB'
URL = 'https://github.com/ txoof/PaperPi'


Expand Down
1 change: 1 addition & 0 deletions paperpi/plugins/met_no/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

version = "0.1.6"
name = "PaperPi Met No Weather plugin"
app_source = "github.com/txoof/PaperPi"

# open street maps location lookup
osm_endpoint = 'https://nominatim.openstreetmap.org/search/'
Expand Down
Loading

0 comments on commit 1e65ab9

Please sign in to comment.