Skip to content

Commit

Permalink
Merge pull request OpenShot#2419 from ferdnyc/info-manages-path
Browse files Browse the repository at this point in the history
Disconnect path detection from classes.info
  • Loading branch information
DylanC authored Dec 13, 2018
2 parents c9a0a8a + 5265779 commit 2a6ec68
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
31 changes: 31 additions & 0 deletions src/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"""
@file openshot_qt/__init__.py
@brief Initialization code used when running OpenShot installed as a Python module
@author FeRD (Frank Dana) <ferdnyc AT gmail com>
@section LICENSE
Copyright (c) 2008-2018 OpenShot Studios, LLC
(http://www.openshotstudios.com). This file is part of
OpenShot Video Editor (http://www.openshot.org), an open-source project
dedicated to delivering high quality video editing and animation solutions
to the world.
OpenShot Video Editor is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenShot Video Editor is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
"""

import os

# Determine path to this module
OPENSHOT_PATH = os.path.dirname(os.path.realpath(__file__))
5 changes: 3 additions & 2 deletions src/launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@
from classes import info
print("Loaded modules from current directory: %s" % info.PATH)
except ImportError:
from openshot_qt.classes import info
sys.path.append(info.PATH)
import openshot_qt
sys.path.append(openshot_qt.OPENSHOT_PATH)
from classes import info
print("Loaded modules from installed directory: %s" % info.PATH)

from classes.app import OpenShotApp
Expand Down

0 comments on commit 2a6ec68

Please sign in to comment.