Skip to content

Commit

Permalink
remove pycairo
Browse files Browse the repository at this point in the history
fix missing data in dict I#16

offer resume option after abort
  • Loading branch information
txoof committed Feb 26, 2022
1 parent ead1ee8 commit ae1b16e
Show file tree
Hide file tree
Showing 5 changed files with 180 additions and 54 deletions.
22 changes: 14 additions & 8 deletions install/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ SYSTEMD_UNIT_PATH="/etc/systemd/system/$SYSTEMD_UNIT_FILE_NAME"
CONFIG_FILE_NAME=$APPNAME.ini
SYSTEM_CONFIG_PATH=/etc/default/$CONFIG_FILE_NAME

function abort {
# abort installation with message
printf "%s\n" "$@"
printf "%s\n\nThis installer can be resumed with '$0'"
exit 1
}


# install requirements from the plugin requirements-*.txt files
Expand Down Expand Up @@ -124,7 +130,7 @@ function check_deb_packages {
echo ""
echo "stopping install"

exit 1
abort
else
echo "required packages installed"
fi
Expand Down Expand Up @@ -178,7 +184,7 @@ function check_py_packages {
echo "sudo pip3 install ${missing[*]}"
echo ""
echo "stopping install"
exit 1
abort
fi
}

Expand Down Expand Up @@ -206,15 +212,15 @@ function add_user {
then
echo "failed to add user"
echo "install aborted"
exit 1
abort
fi

/usr/sbin/usermod -a -G spi,gpio $APPNAME
if [ $? -ne 0 ]
then
echo "failed to add user to groups: spi, gpio"
echo "install aborted"
exit 1
abort
fi
fi

Expand All @@ -240,7 +246,7 @@ function install_unit_file {
then
echo "failed to copy unit file"
echo "exiting"
exit 1
abort
fi

echo "reloading systemd unit files"
Expand All @@ -249,7 +255,7 @@ function install_unit_file {
then
echo "failed to reload systemd untit files"
echo "exiting"
exit 1
abort
fi

echo "enabling systemd unit file"
Expand All @@ -258,7 +264,7 @@ function install_unit_file {
then
echo "failed to enable systemd untit files"
echo "exiting"
exit 1
abort
fi
fi

Expand All @@ -272,7 +278,7 @@ function install_unit_file {
echo "try to stop manually with:"
echo "$ sudo systemctl stop $SYSTEMD_UNIT_FILE_NAME"
echo "exiting"
exit 1
abort
fi

echo "removing $SYSTEMD_UNIT_PATH"
Expand Down
134 changes: 134 additions & 0 deletions paperpi/config/paperpi.ini
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,137 @@ refresh_rate = 30
min_display_time = 60
max_priority = 2**15

[xPlugin: Reddit Quotes]
layout = layout
plugin = reddit_quote
refresh_rate = 100
min_display_time = 50
max_priority = 2
# maximum length of quote (in characters) including spaces, a la Twitter
max_length = 144

[xPlugin: Librespot]
layout = layout
plugin = librespot_client
refresh_rate = 10
max_priority = 0
min_display_time = 15
# name of librespot player
player_name = SpoCon-Spotify
# time in seconds before plugin is removed from the display loop
idle_timeout = 10

[xPlugin: Moon Phase]
# default layout
layout = layout
plugin = moon_phase
min_display_time = 30
max_priority = 2
# your email address for MET.no API access -- failure to specify may lead to a perma-ban
email = you@host.diamond
# Timezone locale name in Region/City format (see --run_plugin_func moon_phase.list_country_locales)
# Use a known city in your timezone; this is critical for calculating the moonrise time
location_name = Europe/Amsterdam
# lat/lon of your physical location (optional) (see --run_plugin_func moon_phase.get_coord)
lat = 52.3
lon = 4.9

[xPlugin: LMS - Your Player Name]
layout = layout
plugin = lms_client
player_name = Your Player Name
refresh_rate = 5
min_display_time = 30
max_priority = 0
idle_timeout = 15

[xPlugin: Basic Clock]
layout = layout
plugin = basic_clock
refresh_rate = 30
min_display_time = 50
max_priority = 2

[xPlugin: XKCD Comic Plugin]
# default layout
layout = layout
plugin = xkcd_comic
refresh_rate = 1200
min_display_time = 120
# maximum x dimension of comic image
max_x = 800
# maximum y dimension of comic image
max_y = 600
# max attempts to find a suitable comic image
# 0 do not rsize small comics / 1 maximize small comics to max_x, max_y
resize = 0
max_retries = 10
max_priority = 2

[xPlugin: Word Clock]
layout = layout
plugin = word_clock
refresh_rate = 125
min_display_time = 255
max_priority = 2

[xPlugin: A Demo Plugin]
# this is a sample config users can use to help setup the plugin
# default layout
layout = layout
# the literal name of your module
plugin = demo_plugin
# recommended display time
min_display_time = 30
# maximum priority in display loop
max_priority = 1
# your name
your_name = Slartybartfast
# your favorite color
your_color = chartreuse

[xPlugin: New Yorker Comic]
layout = layout
plugin = newyorker
day_range = 5 # number of past days to choose from
refresh_rate = 120
min_display_time = 60
max_priority = 2

[xPlugin: Weather Adis Ababa]
layout = layout
plugin = met_no
refresh_rate = 300
min_display_time = 40
max_priority = 2
location_name = Adis Ababa
lat = 9.000
lon = 38.750
# this is required by Met.no -- please use a real value
email = you@host.diamond

[xPlugin: Crypto Bitcoin v USD]
plugin = crypto
layout = layout
# fiat currency to use for comparison
fiat = usd
# crypto currency to track
coin = bitcoin
# days of data to display
days = 14
# interval to show on sparkline
interval = hourly
# rss news feed to display
rss_feed = https://bitcoinmagazine.com/.rss/full/
min_display_time = 30
# refresh data every 5 minutes
refresh_rate = 300
max_priority = 2

[xPlugin: decimal binary clock]
layout = layout
plugin = dec_bin_clock
refresh_rate = 30
min_display_time = 50
max_priority = 2

1 change: 0 additions & 1 deletion paperpi/plugins/crypto/requirements-crypto_hidden.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
cairocffi
pycairo
cffi
CairoSVG
57 changes: 27 additions & 30 deletions utilities/create_docs.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,26 @@
"cells": [
{
"cell_type": "code",
"execution_count": null,
"execution_count": 39,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The autoreload extension is already loaded. To reload it, use:\n",
" %reload_ext autoreload\n"
]
}
],
"source": [
"%load_ext autoreload\n",
"%autoreload 2"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 40,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -22,7 +31,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 41,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -36,7 +45,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 42,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -48,7 +57,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 43,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -65,7 +74,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 44,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -74,7 +83,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 45,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -83,7 +92,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 53,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -173,7 +182,11 @@
" \n",
" # setup plugin\n",
" if skip_layouts:\n",
"# print('skipping creating full layouts and creating images due to command line switch (-s)')\n",
" plugin_dict[plugin].append({'plugin': plugin,\n",
" 'module': module,\n",
" 'plugin_obj': None,\n",
" 'doc_path': plugin_path/plugin,\n",
" 'layout': None })\n",
" continue\n",
" else:\n",
" for name, layout in all_layouts.items():\n",
Expand Down Expand Up @@ -209,7 +222,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 57,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -269,7 +282,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 48,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -388,22 +401,6 @@
" file.write(post) "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# update_plugin_docs(plugin_d, '../documentation')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -476,15 +473,15 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 61,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[NbConvertApp] Converting notebook create_docs.ipynb to python\n",
"[NbConvertApp] Writing 14375 bytes to create_docs.py\n"
"[NbConvertApp] Writing 14511 bytes to create_docs.py\n"
]
}
],
Expand Down
Loading

0 comments on commit ae1b16e

Please sign in to comment.