Browse Source

Remove support for upgrading very old data on OSX.

Also clean up some missed cache_dir references.
pull/92/merge
shypike 12 years ago
parent
commit
9516d80746
  1. 32
      SABnzbd.py
  2. 1
      sabnzbd/constants.py
  3. 2
      sabnzbd/interface.py

32
SABnzbd.py

@ -763,36 +763,6 @@ def check_for_sabnzbd(url, upload_nzbs, allow_browser=True):
return False
def copy_old_files(newpath):
""" OSX only:
If no INI file found but old one exists, copy it
When copying the INI, also copy rss and watched-data
"""
if not os.path.exists(os.path.join(newpath, DEF_INI_FILE)):
if not os.path.exists(newpath):
os.mkdir(newpath)
oldpath = os.environ['HOME'] + "/.sabnzbd"
oldini = os.path.join(oldpath, DEF_INI_FILE)
if os.path.exists(oldini):
import shutil
try:
shutil.copy(oldini, newpath)
except:
pass
oldpath = os.path.join(oldpath, DEF_CACHE_DIR)
newpath = os.path.join(newpath, DEF_CACHE_DIR)
if not os.path.exists(newpath):
os.mkdir(newpath)
try:
shutil.copy(os.path.join(oldpath, RSS_FILE_NAME), newpath)
except:
pass
try:
shutil.copy(os.path.join(oldpath, SCAN_FILE_NAME), newpath)
except:
pass
def evaluate_inipath(path):
""" Derive INI file path from a partial path.
Full file path: if file does not exist the name must contain a dot
@ -1088,8 +1058,6 @@ def main():
inifile = os.path.abspath(sabnzbd.DIR_PROG + '/' + DEF_INI_FILE)
if not os.path.exists(inifile) and not os.path.exists(inifile + '.bak'):
inifile = os.path.abspath(sabnzbd.DIR_LCLDATA + '/' + DEF_INI_FILE)
if sabnzbd.DARWIN:
copy_old_files(sabnzbd.DIR_LCLDATA)
# If INI file at non-std location, then use program dir as $HOME
if sabnzbd.DIR_LCLDATA != os.path.dirname(inifile):

1
sabnzbd/constants.py

@ -77,7 +77,6 @@ DB_QUEUE_NAME = 'queue%s.db' % DB_QUEUE_VERSION
DEF_DOWNLOAD_DIR = 'Downloads/incomplete'
DEF_COMPLETE_DIR = 'Downloads/complete'
DEF_CACHE_DIR = 'cache'
DEF_ADMIN_DIR = 'admin'
DEF_LOG_DIR = 'logs'
DEF_NZBBACK_DIR = ''

2
sabnzbd/interface.py

@ -1109,7 +1109,7 @@ def orphan_add(kwargs):
#------------------------------------------------------------------------------
LIST_DIRPAGE = ( \
'download_dir', 'download_free', 'complete_dir', 'cache_dir', 'admin_dir',
'download_dir', 'download_free', 'complete_dir', 'admin_dir',
'nzb_backup_dir', 'dirscan_dir', 'dirscan_speed', 'script_dir',
'email_dir', 'permissions', 'log_dir', 'password_file'
)

Loading…
Cancel
Save