File tree 1 file changed +15
-7
lines changed
1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change 1
1
from configparser import ConfigParser
2
+ from shutil import copyfile
2
3
import logging
3
- import os
4
4
import math
5
- from shutil import copyfile
5
+ import sys
6
+ import os
6
7
7
8
import utils
8
9
@@ -117,15 +118,22 @@ def create_config(config_file=None):
117
118
BLACK = 0
118
119
PAPIRUSROT = 0
119
120
if "papirus" in conf ["atm" ]["display" ]:
120
- from papirus import Papirus
121
+ try :
122
+ from papirus import Papirus
123
+ PAPIRUS = Papirus (rotation = PAPIRUSROT )
124
+ except ImportError :
125
+ logger .warning ("Papirus display library not installed." )
126
+ sys .exit ("Exiting..." )
121
127
122
- PAPIRUS = Papirus (rotation = PAPIRUSROT )
123
128
124
129
# Display - Waveshare 2.13 is 250 * 122 pixels
125
130
if "waveshare" in conf ["atm" ]["display" ]:
126
- from waveshare_epd import epd2in13_V2
127
-
128
- WAVESHARE = epd2in13_V2 .EPD ()
131
+ try :
132
+ from waveshare_epd import epd2in13_V2
133
+ WAVESHARE = epd2in13_V2 .EPD ()
134
+ except ImportError :
135
+ logger .warning ("Waveshare display library not installed." )
136
+ sys .exit ("Exiting..." )
129
137
130
138
# API URL for coingecko
131
139
COINGECKO_URL_BASE = "https://api.coingecko.com/api/v3/"
You can’t perform that action at this time.
0 commit comments