pitivi r1166 - in branches/SOC_2008_BLEWIS: . pitivi



Author: blewis
Date: Fri Jul 11 14:05:16 2008
New Revision: 1166
URL: http://svn.gnome.org/viewvc/pitivi?rev=1166&view=rev

Log:
* pitivi/settings.py:
File support now enabled by default, environment variable not necessary
* pitivi/pitivi.py:
rudimentary command line argument support
you can now pass in a path to a project file as the first argument and it
will be loaded automatically


Modified:
   branches/SOC_2008_BLEWIS/ChangeLog
   branches/SOC_2008_BLEWIS/pitivi/pitivi.py
   branches/SOC_2008_BLEWIS/pitivi/settings.py

Modified: branches/SOC_2008_BLEWIS/pitivi/pitivi.py
==============================================================================
--- branches/SOC_2008_BLEWIS/pitivi/pitivi.py	(original)
+++ branches/SOC_2008_BLEWIS/pitivi/pitivi.py	Fri Jul 11 14:05:16 2008
@@ -22,6 +22,7 @@
 """
 Main application
 """
+import os
 import gobject
 import gtk
 import gst
@@ -89,7 +90,7 @@
                        ( ))
         }
 
-    def __init__(self, use_ui=True, *args, **kwargs):
+    def __init__(self, args, use_ui=True):
         """
         initialize pitivi with the command line arguments
         """
@@ -108,7 +109,11 @@
                 % APPNAME)
         instance.PiTiVi = self
 
-        # TODO parse cmd line arguments
+        # FIXME: use gnu getopt or somethign of the sort
+        project_file = None
+        if len(args) > 1:
+            if os.path.exists(args[1]):
+                project_file = args[1]
 
         # get settings
         self.settings = GlobalSettings()
@@ -126,6 +131,8 @@
             # we're starting a GUI for the time being
             self.gui = mainwindow.PitiviMainWindow()
             self.gui.show()
+            if project_file:
+                self.loadProject(filepath=project_file)
 
     def do_closing_project(self, project):
         return True

Modified: branches/SOC_2008_BLEWIS/pitivi/settings.py
==============================================================================
--- branches/SOC_2008_BLEWIS/pitivi/settings.py	(original)
+++ branches/SOC_2008_BLEWIS/pitivi/settings.py	Fri Jul 11 14:05:16 2008
@@ -81,7 +81,8 @@
         # reads some settings from environment variable
         #self.advancedModeEnabled =
         #get_bool_env("PITIVI_ADVANCED_MODE")
-        self.fileSupportEnabled = get_bool_env("PITIVI_FILE_SUPPORT")
+        #self.fileSupportEnabled = get_bool_env("PITIVI_FILE_SUPPORT")
+        self.fileSupportEnabled = True
         pass
 
     def get_local_plugin_path(self, autocreate=True):



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]