|
6 | 6 | import argparse
|
7 | 7 | import shutil
|
8 | 8 | from argparse import ArgumentParser, SUPPRESS as SUPPRESS
|
9 |
| -from os import path, getenv, environ, remove, chmod, makedirs |
| 9 | +from os import path, getenv, environ, remove, chmod, makedirs, rmdir |
10 | 10 | from sys import platform, version_info, executable
|
11 | 11 | from contextlib import contextmanager
|
12 | 12 | from platform import system
|
@@ -389,7 +389,7 @@ def shell():
|
389 | 389 | import subprocess
|
390 | 390 | r = None
|
391 | 391 | script = None
|
392 |
| - script = '/home/spiros/projects/my-gits/pyradio/devel/fix_pyradio_desktop_file' |
| 392 | + #script = '/home/spiros/projects/my-gits/pyradio/devel/fix_pyradio_desktop_file' |
393 | 393 | if script is None:
|
394 | 394 | try:
|
395 | 395 | from urllib.request import urlretrieve
|
@@ -986,6 +986,17 @@ def read_config(pyradio_config):
|
986 | 986 | if pyradio_config.xdg_compliant:
|
987 | 987 | pyradio_config.migrate_xdg()
|
988 | 988 |
|
| 989 | + ''' check if ~/pyradio-recordings is created |
| 990 | + but is not used and should be deleted |
| 991 | + ''' |
| 992 | + chk = path.join(path.expanduser('~'), 'pyradio-recordings') |
| 993 | + if path.exists(chk): |
| 994 | + if pyradio_config.recording_dir != chk: |
| 995 | + try: |
| 996 | + rmdir(chk) |
| 997 | + except (FileNotFoundError, OSError): |
| 998 | + pass |
| 999 | + |
989 | 1000 | def save_config(pyradio_config):
|
990 | 1001 | ret = pyradio_config.save_config(from_command_line=True)
|
991 | 1002 | if ret == -1:
|
|
0 commit comments