~ubuntu-branches/debian/sid/jokosher/sid

« back to all changes in this revision

Viewing changes to Jokosher/Extension.py

  • Committer: Bazaar Package Importer
  • Author(s): Luca Falavigna, Luca Falavigna, Piotr Ożarowski
  • Date: 2009-05-12 00:37:15 UTC
  • mfrom: (1.3.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090512003715-3hp2ycoqjlzwfnlv
Tags: 0.11.2-1
[ Luca Falavigna ]
* New upstream release (Closes: #517234).
  - Jokosher now appears under Sound & Video (Closes: #443788).
* New Maintainer (Closes: #523167).
* Add Python Applications Packaging Team to Uploaders.
* Add Vcs-* fields in source stanza.
* Adjust copyright informations:
  - Refresh upstream authors and copyright holders.
  - Link to /usr/share/common-licenses/GPL-2.
  - Adjust copyright holders for Debian packaging.
  - Replace (c) with ©.
* Apply changes from Ubuntu by Daniel Holbach (thanks!):
  - Drop scrollkeeper from Build-Depends.
  - Drop useless dependencies: python-alsaaudio, gstreamer0.10-gnomevfs,
    librsvg2-common, python-gnome2.
  - Bump gstreamer0.10-plugins-good requirement to >= 0.10.9.
  - Drop debian/jokosher.sh, useless.
  - Provide debian/watch file.
* Switch to debhelper 7.
* Install Jokosher module in private directory.
* Unpack egg files to let python-support handle them.
* Drop python-dev from Build-Depends, use python (>= 2.4) instead.
* Depend on python-gobject.
* Switch dependency from python-setuptools to python-pkg-resources
  because of package rename (Closes: #468728).
* debian/patches/10_update_mime_database.dpatch:
  - Refresh for new upstream release.
* debian/patches/20_LevelList_IOError.dpatch:
  - Fix IOError exception trying to add an audio file to a project.
* debian/patches/30_desktop_file.dpatch:
  - Adhere to Freedesktop.org standards by removing deprecated entries.
* debian/patches/50_CreateNewProject_return.dpatch:
  - Return class while creating a new project.
* Provide a simple man page for jokosher.
* Bump Standards-Version to 3.8.1:
  - Provide Homepage field in source stanza.
  - Provide debian/README.source to document dpatch usage.

[ Piotr Ożarowski ]
* Add 40_load_extensions_from_unpacked_eggs patch so that extensions in
  unzipped Eggs are recognized as well

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 
16
16
# Define some constants
17
17
""" Jokosher user extension directory """
18
 
EXTENSION_DIR_USER = os.path.expanduser('~/.jokosher/extensions/')
 
18
EXTENSION_DIR_USER = os.path.join(Globals.JOKOSHER_DATA_HOME, 'extensions/')
19
19
 
20
20
""" Append the default directory to the directory list """
21
21
PREFERRED_EXTENSION_DIR = Globals.EXTENSION_PATHS[0]
30
30
run directly, or whether it's being imported by a Jokosher session.
31
31
If this Extension is being run directly, which isn't right and probably means
32
32
that the user has just clicked on an extension in the file manager, offer the
33
 
user the possibility to install the extension in their .jokosher folder.
 
33
user the possibility to install the extension in their home folder.
34
34
"""
35
35
import inspect
36
36
extension_that_imported_me = inspect.currentframe().f_back
319
319
                for instr in Globals.getCachedInstruments():
320
320
                        if instr[1] == instr_type:
321
321
                                if instr_name:
322
 
                                        newInstr = self.mainapp.project.AddInstrument(instr_name, instr[1], instr[2])
 
322
                                        newInstr = self.mainapp.project.AddInstrument(instr_name, instr[1])
323
323
                                else:
324
 
                                        newInstr = self.mainapp.project.AddInstrument(instr[0], instr[1], instr[2])
 
324
                                        newInstr = self.mainapp.project.AddInstrument(instr[0], instr[1])
325
325
                                        #instr[0] is the default Instrument name
326
326
                                        #instr[1] is the Instrument type
327
327
                                        #instr[2] is the Instrument icon in the .instr file
328
 
                                self.mainapp.UpdateDisplay()
329
328
                                return newInstr.id
330
329
                return -1
331
330
        
354
353
                        instrumentID -- ID of the Instrument to be removed.
355
354
                """
356
355
                self.mainapp.project.DeleteInstrument(instrumentID)
357
 
                self.mainapp.UpdateDisplay()
358
356
                
359
357
                #time for a Newfie Joke: 
360
358
                #How many Newfies does it take to go ice fishing?
652
650
        @exported_function
653
651
        def create_new_instrument_type(self, defaultName, typeString, imagePath):
654
652
                """
655
 
                Creates a new Instrument type in the user's ~/.jokosher/instruments folder.
 
653
                Creates a new Instrument type in the user's JOKOSHER_DATA_HOME/instruments folder.
656
654
                It will then be automatically loaded on startup.
657
655
                
658
656
                Parameters:
664
662
                        0 = the new Instrument type was successfully created.
665
663
                        1 = file already exists or defaultName is already used by a loaded Instrument.
666
664
                        2 = cannot load image file.
667
 
                        3 = cannot write to ~/.jokosher/instruments or ~/.jokosher/instruments/images.
 
665
                        3 = cannot write to JOKOSHER_DATA_HOME/instruments or JOKOSHER_DATA_HOME/instruments/images.
668
666
                """
669
667
                typeList = [x[1] for x in Globals.getCachedInstruments()]
670
668
                if typeString in typeList:
722
720
        @exported_function
723
721
        def delete_instrument_type(self, typeString):
724
722
                """
725
 
                Deletes an instrument type from the user's ~/.jokosher/instruments 
 
723
                Deletes an instrument type from the user's JOKOSHER_DATA_HOME/instruments 
726
724
                directory (deleting default instruments isn't allowed)
727
725
                
728
726
                Parameters:
771
769
                Parameters:
772
770
                        description -- string for the drop down box. i.e: 'Ogg Vorbis (.ogg)'.
773
771
                        extension -- string of the file extension without a '.'. i.e: 'ogg'.
774
 
                        encodeBin -- string used by gst_parse_bin_from_description to create
 
772
                        encodeBin -- string used by gst.parse_bin_from_description to create
775
773
                                                a bin that can encode and mux the audio when added to a
776
774
                                                pipeline. i.e: 'vorbisenc ! oggmux'.
777
775
                        checkIfValid -- If True, Jokosher will check if the encodeBin string is valid before adding
788
786
                        
789
787
                if checkIfValid:
790
788
                        try:
791
 
                                bin = gst.gst_parse_bin_from_description("audioconvert ! %s" % encodeBin, True)
 
789
                                bin = gst.parse_bin_from_description("audioconvert ! %s" % encodeBin, True)
792
790
                                del bin
793
791
                        except gobject.GError:
794
792
                                return 3
811
809
                Parameters:
812
810
                        description -- string for the drop down box. i.e: 'Ogg Vorbis (.ogg)'.
813
811
                        extension -- string of the file extension without a '.'. i.e: 'ogg'.
814
 
                        encodeBin -- string used by gst_parse_bin_from_description to create
 
812
                        encodeBin -- string used by gst.parse_bin_from_description to create
815
813
                                                a bin that can encode and mux the audio when added to a
816
814
                                                pipeline. i.e: 'vorbisenc ! oggmux'.
817
815
                Returns:
916
914
                        bpm -- the beats per minute to set.
917
915
                """
918
916
                self.mainapp.project.SetBPM(float(bpm))
919
 
                self.mainapp.project.PrepareClick()
920
917
                
921
918
        #_____________________________________________________________________
922
919