Skip to content

Commit

Permalink
Running on Nemo 4 (Python3)
Browse files Browse the repository at this point in the history
  • Loading branch information
linux-man committed Dec 4, 2018
1 parent 00c2f55 commit 2b22c78
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
nemo-mediainfo-tab (0.4) bionic; urgency=medium

* Running on Nemo 4 (Python3)

-- Caldas Lopes <joao.caldas.lopes@gmail.com> Tue, 04 Dec 2018 23:36:14 +0100

nemo-mediainfo-tab (0.3) xenial; urgency=medium

* Translations from MediaInfo
Expand Down
3 changes: 2 additions & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ Depends: ${python:Depends},
${misc:Depends},
nemo,
python-nemo | nemo-python,
python-mediainfodll
nemo (<< 4) | python3-mediainfodll,
nemo (>= 4) | python-mediainfodll
Description: View media information from the properties tab
2 changes: 1 addition & 1 deletion debian/rules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/make -f

%:
dh $@ --with python2
dh $@ --with python3
20 changes: 16 additions & 4 deletions nemo-extension/nemo-mediainfo-tab.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
#!/usr/bin/python
#coding: utf-8

import urllib
import locale, gettext, os

try:
from urllib import unquote
except ImportError:
from urllib.parse import unquote

from gi.repository import GObject, Gtk, Nemo

from MediaInfoDLL import *
try:
from MediaInfoDLL import *
except ImportError:
from MediaInfoDLL3 import *

lang = locale.getdefaultlocale()[0]
locale_path = os.path.join(os.path.dirname(__file__), "nemo-mediainfo-tab/locale")
Expand Down Expand Up @@ -54,10 +61,15 @@ def get_property_pages(self, files):
if file.is_directory():
return

filename = urllib.unquote(file.get_uri()[7:])
filename = unquote(file.get_uri()[7:])

try:
filename = filename.decode("utf-8")
except:
pass

MI = MediaInfo()
MI.Open(filename.decode("utf-8"))
MI.Open(filename)
MI.Option_Static("Complete")
MI.Option_Static("Language", "file://{}".format(locale_file))
info = MI.Inform().splitlines()
Expand Down

0 comments on commit 2b22c78

Please sign in to comment.