From 0f5252e7a7c2cbc76971b2516c0179ffd160218f Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Mon, 26 Jan 2009 15:21:43 +0530 Subject: [PATCH] return nothing if file does not exist --- oxgst/info.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/oxgst/info.py b/oxgst/info.py index 7b6dcb8..8ed105a 100644 --- a/oxgst/info.py +++ b/oxgst/info.py @@ -34,7 +34,10 @@ class Info: self.input.props.location = videofile self.dbin = self.pipeline.get_by_name('dbin') - self.metadata['size'] = os.stat(videofile).st_size + if os.path.exists(videofile): + self.metadata['size'] = os.stat(videofile).st_size + else: + self.metadata['size'] = 0: if self.metadata['size'] != 0: self.bus = self.pipeline.get_bus() self.dbin.connect('new-decoded-pad', self.demux_pad_added)