@@ -2677,6 +2677,7 @@ class PyRadioSelectPlaylist(object):
26772677 def __init__ (self ,
26782678 parent ,
26792679 config_path ,
2680+ registers_path ,
26802681 default_playlist ,
26812682 include_registers = False ,
26822683 global_functions = None ):
@@ -2700,6 +2701,7 @@ def __init__(self,
27002701 ''' revert to old behavior '''
27012702 self ._parent_Y = 1
27022703 self ._config_path = config_path
2704+ self ._registers_path = registers_path
27032705 self .playlist = default_playlist
27042706 self ._orig_playlist = default_playlist
27052707 self ._selected_playlist = default_playlist
@@ -2802,9 +2804,9 @@ def _read_items(self):
28022804 if len (self ._items ) > 0 :
28032805 self ._items .sort ()
28042806 if self ._include_registers :
2805- self ._registers_path = path .join (self ._config_path , '.registers' )
2806- if platform == 'win32' :
2807- self ._registers_path .replace ('.reg' , '_reg' )
2807+ # self._registers_path = path.join(self._config_path, '.registers')
2808+ # if platform == 'win32':
2809+ # self._registers_path.replace('.reg', '_reg')
28082810 r_items = glob .glob (path .join (self ._registers_path , '*.csv' ))
28092811 if r_items :
28102812 r_items .sort ()
@@ -2869,11 +2871,13 @@ def _get_result(self):
28692871 if self ._include_registers :
28702872 if self ._items [self ._selected_playlist_id ].startswith ('Register: ' ):
28712873 ret = self ._items [self ._selected_playlist_id ].replace ('Register: ' , 'register_' )
2872- ret = path .join (self ._config_path , '.registers' , ret + '.csv' )
2874+ ret = path .join (self ._registers_path , ret + '.csv' )
2875+ logger .error (f'ret 1: { ret = } ' )
28732876 else :
2874- ret = path .join (self ._config_path , self ._items [self ._selected_playlist_id ] + '.csv' )
2875- if platform == 'win32' :
2876- ret .replace ('.registers' , '_registers' )
2877+ ret = path .join (self ._registers_path , self ._items [self ._selected_playlist_id ] + '.csv' )
2878+ logger .error (f'ret 2: { ret = } ' )
2879+ # if platform == 'win32':
2880+ # ret.replace('.registers', '_registers')
28772881 return 0 , ret
28782882
28792883 stationFile = path .join (self ._config_path , self ._items [self ._selected_playlist_id ] + '.csv' )
@@ -3086,7 +3090,7 @@ class PyRadioSelectStation(PyRadioSelectPlaylist):
30863090
30873091 _default_playlist = ''
30883092
3089- def __init__ (self , parent , config_path , default_playlist , default_station ,
3093+ def __init__ (self , parent , config_path , registers_dir , default_playlist , default_station ,
30903094 global_functions = None , is_from_schedule = False ):
30913095 self ._default_playlist = default_playlist
30923096 self ._orig_default_playlist = default_playlist
@@ -3098,7 +3102,7 @@ def __init__(self, parent, config_path, default_playlist, default_station,
30983102 if self ._is_from_schedule :
30993103 self ._config_path = config_path
31003104 default_station = self ._read_items (a_station = default_station )
3101- PyRadioSelectPlaylist .__init__ (self , parent , config_path , default_station )
3105+ PyRadioSelectPlaylist .__init__ (self , parent , config_path , registers_dir , default_station )
31023106 self ._global_functions = set_global_functions (global_functions )
31033107 self ._title = ' Station Selection '
31043108 ''' adding 2 to padding calculation
0 commit comments