~ubuntu-branches/ubuntu/trusty/pitivi/trusty

« back to all changes in this revision

Viewing changes to pitivi/settings.py

* New upstream pre-release:
  + debian/control:
    - Update dependencies.
* debian/control:
  + Update Standards-Version to 3.8.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
 
77
77
def get_dir(path, autocreate=True):
78
78
    if autocreate and not os.path.exists(path):
79
 
        os.mkdir(path)
 
79
        os.makedirs(path)
80
80
    return path
81
81
 
82
82
def get_dirs(glob):
138
138
    options = {}
139
139
    environment = set()
140
140
    defaults = {}
 
141
    __signals__ = {}
141
142
 
142
143
    def __init__(self, **kwargs):
 
144
        Signallable.__init__(self)
143
145
        self._config = SafeConfigParser()
144
146
        self._readSettingsFromGlobalConfiguration()
145
147
        self._readSettingsFromConfigurationFile()
405
407
                    self.output_stream = get_stream_for_caps(p.get_caps().copy())
406
408
                    self.output_stream.pad_name = p.name_template
407
409
 
408
 
    def __repr__(self):
 
410
    def __str__(self):
409
411
        return "<StreamEncodeSettings %s>" % self.encoder
410
412
 
411
413
class RenderSettings(object):
425
427
        self.muxer = muxer
426
428
        self.muxersettings = muxersettings
427
429
 
428
 
    def __repr__(self):
 
430
    def __str__(self):
429
431
        return "<RenderSettings %s [%d streams]>" % (self.muxer, len(self.settings))
430
432
 
431
433
class ExportSettings(Signallable, Loggable):
493
495
 
494
496
    def getVideoDescription(self):
495
497
        """ Returns a human-readable markup-ed string describing the video properties """
496
 
        res = "%d x %d <i>pixels</i> at %.2f <i>fps</i> <i>(%s)</i>"
497
 
        return res % (self.videowidth, self.videoheight,
498
 
                      float(self.videorate), self.vencoder)
 
498
        res = "%d x %d <i>pixels</i> at %.2f <i>fps</i>" % (self.videowidth,
 
499
                self.videoheight, float(self.videorate))
 
500
        if self.vencoder is not None:
 
501
            res += " <i>(%s)</i>" % self.vencoder
 
502
 
 
503
        return res
499
504
 
500
505
    def getAudioDescription(self):
501
506
        """ Returns a human-readable markup-ed string describing the audio properties """
502
 
        res = "%d channels at %d <i>Hz</i> (%d <i>bits</i>) <i>(%s)</i>"
503
 
        return res % (self.audiochannels, self.audiorate, self.audiodepth, self.aencoder)
 
507
        res = "%d channels at %d <i>Hz</i> (%d <i>bits</i>)" % \
 
508
                (self.audiochannels, self.audiorate, self.audiodepth)
 
509
        if self.aencoder is not None:
 
510
            res += " <i>(%s)</i>" % self.aencoder
 
511
 
 
512
        return res
504
513
 
505
514
    def getAudioCaps(self):
506
515
        """ Returns the GstCaps corresponding to the audio settings """