~ubuntu-branches/ubuntu/quantal/jokosher/quantal

« back to all changes in this revision

Viewing changes to Jokosher/JokDebug.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:
1
 
#
2
 
#       THIS FILE IS PART OF THE JOKOSHER PROJECT AND LICENSED UNDER THE GPL. SEE
3
 
#       THE 'COPYING' FILE FOR DETAILS
4
 
#
5
 
#       JokDebug.py
6
 
#
7
 
#       This class provides a bunch of debugging methods that are mainly intended
8
 
#       for cracking open pipelines and looking at the goo inside. This most likely
9
 
#       won't be shipped with the final release and is mainly useful for hackers
10
 
#       who are involved in the project.
11
 
#
12
 
#       To enable debugging mode, set an environmental variable:
13
 
#
14
 
#          foo@bar~$ export JOKOSHER_DEBUG=1
15
 
#
16
 
#-------------------------------------------------------------------------------
17
 
 
18
 
import Globals
19
 
class JokDebug:
20
 
        """
21
 
        This class provides debugging methods that are mainly intended
22
 
        for cracking open pipelines and looking at the goo inside. This most likely
23
 
        won't be shipped with the final release and is mainly useful for hackers
24
 
        who are involved in the project.
25
 
 
26
 
        To enable debugging mode, set an environmental variable:
27
 
        
28
 
                foo@bar~$ export JOKOSHER_DEBUG=1
29
 
        """
30
 
        def __init__(self):
31
 
                # remember the trailing space
32
 
                self.DEBUG_PREFIX = "[debug] "
33
 
 
34
 
        def ShowPipelineDetails(self, pipeline):
35
 
                """
36
 
                Display the pipeline details, including pads.
37
 
                
38
 
                Parameters:
39
 
                        pipeline -- pipeline object to inspect.
40
 
                """
41
 
 
42
 
                pipechildren = []
43
 
 
44
 
                pipe = pipeline.sorted()
45
 
 
46
 
                pipelinechildren = []
47
 
                finalpipe = ""
48
 
 
49
 
                for element in pipeline.sorted():
50
 
                        pipelinechildren[:0] = element
51
 
 
52
 
                for child in pipe:
53
 
                        Globals.debug(self.DEBUG_PREFIX + ">>> Element '" + str(child.get_name()) + "' (" + child.get_factory().get_name() + ")")
54
 
                        for pad in child.pads():
55
 
                                if pad.is_linked() == True:
56
 
                                        Globals.debug(self.DEBUG_PREFIX + "\tPAD LINK: pad: '" + str(pad.get_name()) + "' connects to " + str(pad.get_peer()))
57
 
                                else:
58
 
                                        Globals.debug(self.DEBUG_PREFIX + "\tNO LINK: " + str(pad.get_name()))
59
 
 
60
 
                        Globals.debug(self.DEBUG_PREFIX + "<<< END ELEMENT <<<")
61
 
 
62
 
        def ShowPipeline(self, pipeline):
63
 
                """
64
 
                Display the construction of the pipeline in a gst-launch type format.
65
 
                
66
 
                Parameters:
67
 
                        pipeline -- pipeline object to inspect.
68
 
                """
69
 
 
70
 
                pipelinechildren = []
71
 
                finalpipe = ""
72
 
 
73
 
                for element in pipeline.sorted():
74
 
                        pipelinechildren[:0] = [element.get_factory().get_name()]
75
 
 
76
 
                for elem in pipelinechildren:
77
 
                        finalpipe += elem  + " ! "
78
 
 
79
 
                Globals.debug(self.DEBUG_PREFIX + finalpipe)
80
 
 
81
 
        def ShowPipelineTree(self, pipeline, recurseDepth = 0, maxDepth = 3):
82
 
                """
83
 
                Display a tree of pipeline elements and their children.
84
 
                
85
 
                Parameters:
86
 
                        pipeline -- pipeline object to inspect.
87
 
                        recurseDepth -- recursion tree depth.
88
 
                        maxDepth -- maximum recursion depth.
89
 
                """
90
 
                if recurseDepth > maxDepth:
91
 
                        return
92
 
 
93
 
                if recurseDepth == 0:
94
 
                        Globals.debug(self.DEBUG_PREFIX + "PIPELINE END")
95
 
 
96
 
                for element in pipeline.sorted():
97
 
                        try:
98
 
                                indent = self.DEBUG_PREFIX
99
 
                                for i in range(recurseDepth):
100
 
                                        indent += "\t"
101
 
                                Globals.debug(indent + element.get_factory().get_name() + ": " + element.get_name())
102
 
 
103
 
                                self.ShowPipelineTree(element, recurseDepth+1, maxDepth)
104
 
                        except:
105
 
                                pass
106
 
 
107
 
                if recurseDepth == 0:
108
 
                        Globals.debug(self.DEBUG_PREFIX + "PIPELINE START")
109