mrworf / photoframe

Software to pull random photos from Google Photos and show them, like a photo frame
GNU General Public License v3.0
215 stars 38 forks source link

Update svc_usb.py #175

Closed dadr closed 3 years ago

dadr commented 3 years ago

Added filter to ignore linux/macos "dot" files. The main reason to do this is to eliminate long logs of Command '['/usr/bin/identify', u'/mnt/usb1/photoframe/test/.DS_Store']' returned non-zero exit status 1

dadr commented 3 years ago

Here's an example of before and after from the photoframe log:

Feb 15 11:57:38 photoframe1 photoframe[524]:     raise CalledProcessError(retcode, cmd, output=output)
Feb 15 11:57:38 photoframe1 photoframe[524]: CalledProcessError: Command '['/usr/bin/identify', u'/mnt/usb1/photoframe/test/.DS_Store']' returned non-zero exit status 1
Feb 15 11:57:39 photoframe1 photoframe[524]: 2021-02-15 11:57:39,729 - WARNING - File /mnt/usb1/photoframe/test/.DS_Store has unknown format, skipping
Feb 15 11:58:28 photoframe1 photoframe[524]: 2021-02-15 11:58:28,699 - INFO - All images have been shown, resetting counters
Feb 15 11:58:28 photoframe1 photoframe[524]: 2021-02-15 11:58:28,700 - INFO - Photoframe's memory was reset. Already displayed images will be shown again!
Feb 15 11:58:28 photoframe1 photoframe[524]: 2021-02-15 11:58:28,702 - INFO - test was 0 hours old when we refreshed
Feb 15 11:58:48 photoframe1 photoframe[524]: 2021-02-15 11:58:48,088 - ERROR - Failed to run identify to get image dimensions on /mnt/usb1/photoframe/test/.DS_Store
Feb 15 11:58:48 photoframe1 photoframe[524]: Traceback (most recent call last):
Feb 15 11:58:48 photoframe1 photoframe[524]:   File "/root/photoframe/modules/helper.py", line 172, in getImageSize
Feb 15 11:58:48 photoframe1 photoframe[524]:     output = subprocess.check_output(['/usr/bin/identify', filename], stderr=void)
Feb 15 11:58:48 photoframe1 photoframe[524]:   File "/usr/lib/python2.7/subprocess.py", line 223, in check_output
Feb 15 11:58:48 photoframe1 photoframe[524]:     raise CalledProcessError(retcode, cmd, output=output)
Feb 15 11:58:48 photoframe1 photoframe[524]: CalledProcessError: Command '['/usr/bin/identify', u'/mnt/usb1/photoframe/test/.DS_Store']' returned non-zero exit status 1
Feb 15 11:58:48 photoframe1 photoframe[524]: 2021-02-15 11:58:48,102 - WARNING - File /mnt/usb1/photoframe/test/.DS_Store has unknown format, skipping
Feb 15 11:59:06 photoframe1 photoframe[524]: 2021-02-15 11:59:06,129 - ERROR - Failed to run identify to get image dimensions on /mnt/usb1/photoframe/test/.DS_Store
Feb 15 11:59:06 photoframe1 photoframe[524]: Traceback (most recent call last):
Feb 15 11:59:06 photoframe1 photoframe[524]:   File "/root/photoframe/modules/helper.py", line 172, in getImageSize
Feb 15 11:59:06 photoframe1 photoframe[524]:     output = subprocess.check_output(['/usr/bin/identify', filename], stderr=void)
Feb 15 11:59:06 photoframe1 photoframe[524]:   File "/usr/lib/python2.7/subprocess.py", line 223, in check_output
Feb 15 11:59:06 photoframe1 photoframe[524]:     raise CalledProcessError(retcode, cmd, output=output)
Feb 15 11:59:06 photoframe1 photoframe[524]: CalledProcessError: Command '['/usr/bin/identify', u'/mnt/usb1/photoframe/test/.DS_Store']' returned non-zero exit status 1
Feb 15 11:59:06 photoframe1 photoframe[524]: 2021-02-15 11:59:06,178 - WARNING - File /mnt/usb1/photoframe/test/.DS_Store has unknown format, skipping
Feb 15 12:02:01 photoframe1 photoframe[524]: 2021-02-15 12:02:01,536 - ERROR - Failed to run identify to get image dimensions on /mnt/usb1/photoframe/test/.DS_Store
Feb 15 12:02:01 photoframe1 photoframe[524]: Traceback (most recent call last):
Feb 15 12:02:01 photoframe1 photoframe[524]:   File "/root/photoframe/modules/helper.py", line 172, in getImageSize
Feb 15 12:02:01 photoframe1 photoframe[524]:     output = subprocess.check_output(['/usr/bin/identify', filename], stderr=void)
Feb 15 12:02:01 photoframe1 photoframe[524]:   File "/usr/lib/python2.7/subprocess.py", line 223, in check_output
Feb 15 12:02:01 photoframe1 photoframe[524]:     raise CalledProcessError(retcode, cmd, output=output)
Feb 15 12:02:01 photoframe1 photoframe[524]: CalledProcessError: Command '['/usr/bin/identify', u'/mnt/usb1/photoframe/test/.DS_Store']' returned non-zero exit status 1
Feb 15 12:02:01 photoframe1 photoframe[524]: 2021-02-15 12:02:01,552 - WARNING - File /mnt/usb1/photoframe/test/.DS_Store has unknown format, skipping
Feb 15 12:06:45 photoframe1 photoframe[524]: 2021-02-15 12:06:45,164 - ERROR - Failed to run identify to get image dimensions on /mnt/usb1/photoframe/test/.DS_Store
Feb 15 12:06:45 photoframe1 photoframe[524]: Traceback (most recent call last):
Feb 15 12:06:45 photoframe1 photoframe[524]:   File "/root/photoframe/modules/helper.py", line 172, in getImageSize
Feb 15 12:06:45 photoframe1 photoframe[524]:     output = subprocess.check_output(['/usr/bin/identify', filename], stderr=void)
Feb 15 12:06:45 photoframe1 photoframe[524]:   File "/usr/lib/python2.7/subprocess.py", line 223, in check_output
Feb 15 12:06:45 photoframe1 photoframe[524]:     raise CalledProcessError(retcode, cmd, output=output)
Feb 15 12:06:45 photoframe1 photoframe[524]: CalledProcessError: Command '['/usr/bin/identify', u'/mnt/usb1/photoframe/test/.DS_Store']' returned non-zero exit status 1
Feb 15 12:06:45 photoframe1 photoframe[524]: 2021-02-15 12:06:45,177 - WARNING - File /mnt/usb1/photoframe/test/.DS_Store has unknown format, skipping
Feb 15 12:09:36 photoframe1 photoframe[23208]: 2021-02-15 12:09:36,287 - INFO - Loading service SimpleUrl from svc_simpleurl.py
Feb 15 12:09:36 photoframe1 photoframe[23208]: 2021-02-15 12:09:36,292 - INFO - Loading service PicasaWeb from svc_picasaweb.py
Feb 15 12:09:36 photoframe1 photoframe[23208]: 2021-02-15 12:09:36,320 - INFO - Loading service USB_Photos from svc_usb.py
Feb 15 12:09:36 photoframe1 photoframe[23208]: 2021-02-15 12:09:36,326 - INFO - Loading service GooglePhotos from svc_googlephotos.py
Feb 15 12:09:37 photoframe1 photoframe[23208]: 2021-02-15 12:09:37,466 - WARNING - Unable to determine which storage device is mounted to '/mnt/usb1'
Feb 15 12:09:37 photoframe1 photoframe[23208]: 2021-02-15 12:09:37,469 - INFO - No SMB subsystem, color sensor unavailable
Feb 15 12:09:37 photoframe1 photoframe[23208]: 2021-02-15 12:09:37,473 - INFO - GPIO shutdown can be triggered by GPIO 3
Feb 15 12:09:37 photoframe1 photoframe[23208]: 2021-02-15 12:09:37,476 - INFO - Cache is set to True
Feb 15 12:09:37 photoframe1 photoframe[23208]: 2021-02-15 12:09:37,486 - INFO - No http-auth.json found, disabling http authentication
Feb 15 12:09:37 photoframe1 photoframe[23208]: 2021-02-15 12:09:37,503 - INFO - Registering URL /debug to RouteDebug (simple)
Feb 15 12:09:37 photoframe1 photoframe[23208]: 2021-02-15 12:09:37,510 - INFO - Registering URL /options/ to RouteOptions (simple)
Feb 15 12:09:37 photoframe1 photoframe[23208]: 2021-02-15 12:09:37,515 - INFO - Registering URL /options// to RouteOptions (simple)
Feb 15 12:09:37 photoframe1 photoframe[23208]: 2021-02-15 12:09:37,527 - INFO - Registering URL / to RoutePages (simple)
Feb 15 12:09:37 photoframe1 photoframe[23208]: 2021-02-15 12:09:37,532 - INFO - Registering URL / to RoutePages (simple)
Feb 15 12:09:37 photoframe1 photoframe[23208]: 2021-02-15 12:09:37,559 - INFO - Registering URL /setting to RouteSettings
Feb 15 12:09:37 photoframe1 photoframe[23208]: 2021-02-15 12:09:37,563 - INFO - Registering URL /setting/ to RouteSettings
Feb 15 12:09:37 photoframe1 photoframe[23208]: 2021-02-15 12:09:37,567 - INFO - Registering URL /setting// to RouteSettings
Feb 15 12:09:37 photoframe1 photoframe[23208]: 2021-02-15 12:09:37,573 - INFO - Registering URL /keywords//help to RouteKeywords
Feb 15 12:09:37 photoframe1 photoframe[23208]: 2021-02-15 12:09:37,578 - INFO - Registering URL /keywords/ to RouteKeywords
Feb 15 12:09:37 photoframe1 photoframe[23208]: 2021-02-15 12:09:37,582 - INFO - Registering URL /keywords//add to RouteKeywords
Feb 15 12:09:37 photoframe1 photoframe[23208]: 2021-02-15 12:09:37,587 - INFO - Registering URL /keywords//delete to RouteKeywords
Feb 15 12:09:37 photoframe1 photoframe[23208]: 2021-02-15 12:09:37,592 - INFO - Registering URL /keywords//source/ to RouteKeywords
Feb 15 12:09:37 photoframe1 photoframe[23208]: 2021-02-15 12:09:37,598 - INFO - Registering URL /keywords//details/ to RouteKeywords
Feb 15 12:09:37 photoframe1 photoframe[23208]: 2021-02-15 12:09:37,605 - INFO - Registering URL /rotation to RouteOrientation
Feb 15 12:09:37 photoframe1 photoframe[23208]: 2021-02-15 12:09:37,609 - INFO - Registering URL /rotation/ to RouteOrientation
Feb 15 12:09:37 photoframe1 photoframe[23208]: 2021-02-15 12:09:37,614 - INFO - Registering URL /overscan to RouteOverscan
Feb 15 12:09:37 photoframe1 photoframe[23208]: 2021-02-15 12:09:37,617 - INFO - Registering URL /overscan/ to RouteOverscan
Feb 15 12:09:37 photoframe1 photoframe[23208]: 2021-02-15 12:09:37,622 - INFO - Registering URL /maintenance/ to RouteMaintenance
Feb 15 12:09:37 photoframe1 photoframe[23208]: 2021-02-15 12:09:37,627 - INFO - Registering URL /details/ to RouteDetails
Feb 15 12:09:37 photoframe1 photoframe[23208]: 2021-02-15 12:09:37,631 - INFO - Registering URL /upload/ to RouteUpload
Feb 15 12:09:37 photoframe1 photoframe[23208]: 2021-02-15 12:09:37,636 - INFO - Registering URL /callback to RouteOAuthLink
Feb 15 12:09:37 photoframe1 photoframe[23208]: 2021-02-15 12:09:37,640 - INFO - Registering URL /service//link to RouteOAuthLink
Feb 15 12:09:37 photoframe1 photoframe[23208]: 2021-02-15 12:09:37,644 - INFO - Registering URL /service//oauth to RouteOAuthLink
Feb 15 12:09:37 photoframe1 photoframe[23208]: 2021-02-15 12:09:37,649 - INFO - Registering URL /service/ to RouteService
Feb 15 12:09:37 photoframe1 photoframe[23208]: 2021-02-15 12:09:37,652 - INFO - Registering URL /control/ to RouteControl
Feb 15 12:09:37 photoframe1 photoframe[23208]: 2021-02-15 12:09:37,656 - INFO - Registering URL /events to RouteEvents
Feb 15 12:09:37 photoframe1 photoframe[23208]: 2021-02-15 12:09:37,658 - INFO - Registering URL /events/ to RouteEvents
Feb 15 12:09:37 photoframe1 photoframe[23208]: 2021-02-15 12:09:37,661 - INFO - Registering URL /events/remove/ to RouteEvents
Feb 15 12:09:38 photoframe1 photoframe[23208]:  * Serving Flask app "modules.server" (lazy loading)
Feb 15 12:09:38 photoframe1 photoframe[23208]:  * Environment: production
Feb 15 12:09:38 photoframe1 photoframe[23208]:    WARNING: Do not use the development server in a production environment.
Feb 15 12:09:38 photoframe1 photoframe[23208]:    Use a production WSGI server instead.
Feb 15 12:09:38 photoframe1 photoframe[23208]:  * Debug mode: off
Feb 15 12:10:12 photoframe1 photoframe[23208]: 2021-02-15 12:10:12,940 - INFO - Starting presentation
Feb 15 12:32:18 photoframe1 photoframe[23208]: 2021-02-15 12:32:18,122 - INFO - All images have been shown, resetting counters
Feb 15 12:32:18 photoframe1 photoframe[23208]: 2021-02-15 12:32:18,126 - INFO - Photoframe's memory was reset. Already displayed images will be shown again!
Feb 15 12:32:18 photoframe1 photoframe[23208]: 2021-02-15 12:32:18,129 - INFO - test was 0 hours old when we refreshed
Feb 15 12:52:35 photoframe1 photoframe[23208]: 2021-02-15 12:52:35,774 - INFO - All images have been shown, resetting counters
Feb 15 12:52:35 photoframe1 photoframe[23208]: 2021-02-15 12:52:35,775 - INFO - Photoframe's memory was reset. Already displayed images will be shown again!
Feb 15 12:52:35 photoframe1 photoframe[23208]: 2021-02-15 12:52:35,777 - INFO - test was 0 hours old when we refreshed
Feb 15 13:13:33 photoframe1 photoframe[23208]: 2021-02-15 13:13:33,821 - INFO - All images have been shown, resetting counters
Feb 15 13:13:33 photoframe1 photoframe[23208]: 2021-02-15 13:13:33,823 - INFO - Photoframe's memory was reset. Already displayed images will be shown again!
Feb 15 13:13:33 photoframe1 photoframe[23208]: 2021-02-15 13:13:33,825 - INFO - test was 0 hours old when we refreshed
Feb 15 13:34:58 photoframe1 photoframe[23208]: 2021-02-15 13:34:58,324 - INFO - All images have been shown, resetting counters
Feb 15 13:34:58 photoframe1 photoframe[23208]: 2021-02-15 13:34:58,326 - INFO - Photoframe's memory was reset. Already displayed images will be shown again!
Feb 15 13:34:58 photoframe1 photoframe[23208]: 2021-02-15 13:34:58,328 - INFO - test was 0 hours old when we refreshed
Feb 15 13:54:03 photoframe1 photoframe[23208]: 2021-02-15 13:54:03,950 - INFO - All images have been shown, resetting counters
Feb 15 13:54:03 photoframe1 photoframe[23208]: 2021-02-15 13:54:03,955 - INFO - Photoframe's memory was reset. Already displayed images will be shown again!
Feb 15 13:54:03 photoframe1 photoframe[23208]: 2021-02-15 13:54:03,958 - INFO - test was 0 hours old when we refreshed
Feb 15 14:13:15 photoframe1 photoframe[23208]: 2021-02-15 14:13:15,168 - INFO - All images have been shown, resetting counters
Feb 15 14:13:15 photoframe1 photoframe[23208]: 2021-02-15 14:13:15,170 - INFO - Photoframe's memory was reset. Already displayed images will be shown again!
Feb 15 14:13:15 photoframe1 photoframe[23208]: 2021-02-15 14:13:15,172 - INFO - test was 0 hours old when we refreshed
mrworf commented 3 years ago

Merged since the error is unrelated, looked good to me