OpenShot Video Editor  2.0.0
project.py
Go to the documentation of this file.
1 ##
2 #
3 # @file
4 # @brief This file is for legacy support of OpenShot 1.x project files
5 # @author Jonathan Thomas <jonathan@openshot.org>
6 #
7 # @section LICENSE
8 #
9 # Copyright (c) 2008-2016 OpenShot Studios, LLC
10 # (http://www.openshotstudios.com). This file is part of
11 # OpenShot Video Editor (http://www.openshot.org), an open-source project
12 # dedicated to delivering high quality video editing and animation solutions
13 # to the world.
14 #
15 # OpenShot Video Editor is free software: you can redistribute it and/or modify
16 # it under the terms of the GNU General Public License as published by
17 # the Free Software Foundation, either version 3 of the License, or
18 # (at your option) any later version.
19 #
20 # OpenShot Video Editor is distributed in the hope that it will be useful,
21 # but WITHOUT ANY WARRANTY; without even the implied warranty of
22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 # GNU General Public License for more details.
24 #
25 # You should have received a copy of the GNU General Public License
26 # along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
27 #
28 
29 import os
30 from classes.legacy.openshot.classes import files
31 
32 
33 ##
34 # This is the main project class that contains all
35 # the details of a project, such as name, folder, timeline
36 # information, sequences, media files, etc...
37 class project():
38 
39  # ----------------------------------------------------------------------
40  ##
41  # Constructor
42  def __init__(self, init_threads=True):
43 
44  # debug message/function control
45  self.DEBUG = True
46 
47  # define common directories containing resources
48  # get the base directory of the openshot installation for all future relative references
49  # Note: don't rely on __file__ to be an absolute path. E.g., in the debugger (pdb) it will be
50  # a relative path, so use os.path.abspath()
51  self.BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
52  self.UI_DIR = os.path.join(self.BASE_DIR, "openshot", "windows", "ui")
53  self.IMAGE_DIR = os.path.join(self.BASE_DIR, "openshot", "images")
54  self.LOCALE_DIR = os.path.join(self.BASE_DIR, "openshot", "locale")
55  self.PROFILES_DIR = os.path.join(self.BASE_DIR, "openshot", "profiles")
56  self.TRANSITIONS_DIR = os.path.join(self.BASE_DIR, "openshot", "transitions")
57  self.BLENDER_DIR = os.path.join(self.BASE_DIR, "openshot", "blender")
58  self.EXPORT_PRESETS_DIR = os.path.join(self.BASE_DIR, "openshot", "export_presets")
59  self.EFFECTS_DIR = os.path.join(self.BASE_DIR, "openshot", "effects")
60  # location for per-session, per-user, files to be written/read to
61  self.DESKTOP = os.path.join(os.path.expanduser("~"), "Desktop")
62  self.USER_DIR = os.path.join(os.path.expanduser("~"), ".openshot")
63  self.THEMES_DIR = os.path.join(self.BASE_DIR, "openshot", "themes")
64  self.USER_PROFILES_DIR = os.path.join(self.USER_DIR, "user_profiles")
65  self.USER_TRANSITIONS_DIR = os.path.join(self.USER_DIR, "user_transitions")
66 
67  # init the variables for the project
68  self.name = "Default Project"
69  self.folder = self.USER_DIR
70  self.project_type = None
71  self.canvas = None
72  self.is_modified = False
73  self.refresh_xml = True
74  self.mlt_profile = None
75 
76  # reference to the main GTK form
77  self.form = None
78 
79  # init the file / folder list (used to populate the tree)
81 
82  # ini the sequences collection
83  self.sequences = []
84 
85  # init the tab collection
86  self.tabs = []
The generic folder object for OpenShot.
Definition: files.py:67
This is the main project class that contains all the details of a project, such as name...
Definition: project.py:37
def __init__(self, init_threads=True)
Constructor.
Definition: project.py:42