File: totem-bugreport.py

package info (click to toggle)
totem 2.30.2-6
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 19,672 kB
  • ctags: 6,155
  • sloc: ansic: 36,919; xml: 23,362; sh: 10,556; cpp: 6,230; python: 2,529; makefile: 1,832
file content (21 lines) | stat: -rw-r--r-- 717 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/python
import gtk
import os
from datetime import datetime

# Get the GStreamer version
if os.system ('gst-typefind-0.10 --version') == 0:
	# List the formats of the last files played
	last_visited = 0
	recent_manager = gtk.recent_manager_get_default ()
	for recent in recent_manager.get_items ():
		if recent.has_group ("Totem"):
			if recent.get_visited () > last_visited:
				last_visited = recent.get_visited ()
				last = recent.get_uri_display ()

	if last != None:
		file_handle = os.popen ('gst-typefind-0.10 "%s"' % (last))
		parts = file_handle.read ().split (' ')
		date = datetime.fromtimestamp (last_visited)
		print 'Listened to a "%s" file on %s' % (parts.pop ().strip (), date.isoformat ())