From 00501f09133131f1bc1187d7d89c1b0b28f87997 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 23 Sep 2013 20:38:35 +0200 Subject: [PATCH] Added code to move old octoprint folder out of the way Might be left over after an update due to contained .pyc files that then cause the actual application start-up to fail. --- run | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/run b/run index ec6c02ea..634809ee 100755 --- a/run +++ b/run @@ -6,11 +6,25 @@ print """ !!! Please perform 'sudo python setup.py install' and !!! !!! use the 'octoprint' executable instead. !!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - """ +import os import sys -sys.path.append("src") + +basedir = os.path.dirname(os.path.realpath(__file__)) + +old = os.path.join(basedir, "octoprint") +if os.path.exists(old): + # rename left-overs from old file structure + print """ +Found left-overs from old file structure, renaming to +"octoprint.backup". Please remove this manually (I don't +dare to do so myself since you might have changes in there +I don't know anything about). +""" + os.rename(old, os.path.join(basedir, "octoprint.backup")) + +sys.path.append(os.path.join(basedir, "src")) import octoprint octoprint.main()