Skip to content

Commit

Permalink
Merge pull request #64 from jeanslack/fix_minor_bugs
Browse files Browse the repository at this point in the history
fix minor bugs
  • Loading branch information
jeanslack authored Feb 22, 2022
2 parents 674994a + 0b4b695 commit 9198828
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 76 deletions.
10 changes: 6 additions & 4 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ Change Log:
Feb 21, 2022 V.3.5.6

* Fixed downloader log names.
* Improved log management (the log folder is created at program startup
* Improved log management (the log folder is created at program startup
instead of ondemand).
* Fixed ffmpeg `invalid argument` when converting with double pass.
* Fixed the ffmpeg audio output mapping string error on
`AV-Conversion.on_audioOUTstream` method, which raises
* Fixed ffmpeg `invalid argument` when converting using double pass.
* Fixed the ffmpeg audio output mapping string error on
`AV-Conversion.on_audioOUTstream` method, which raises
`Invalid stream specifier: a1` type error.
* Fixed the 'xdg-open' command execution which blocks the Videomass GUI
on Linux.


+------------------------------------+
Expand Down
10 changes: 6 additions & 4 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
videomass (3.5.6-1) UNRELEASED; urgency=medium

* Fixed downloader log names.
* Improved log management (the log folder is created at program startup
* Improved log management (the log folder is created at program startup
instead of ondemand).
* Fixed ffmpeg `invalid argument` when converting with double pass.
* Fixed the ffmpeg audio output mapping string error on
`AV-Conversion.on_audioOUTstream` method, which raises
* Fixed ffmpeg `invalid argument` when converting using double pass.
* Fixed the ffmpeg audio output mapping string error on
`AV-Conversion.on_audioOUTstream` method, which raises
`Invalid stream specifier: a1` type error.
* Fixed the 'xdg-open' command execution which blocks the Videomass GUI
on Linux.

-- Gianluca Pernigotto <[email protected]> Mon, 21 Feb 2022 13:38:00 +0200

Expand Down
30 changes: 15 additions & 15 deletions videomass/vdms_dialogs/infoprg.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,32 +38,32 @@ def info(parent, videomass_icon):
"""
# ------------------
cr = current_release()
Name = cr[0]
name = cr[1]
Version = cr[2]
name_upper = cr[0]
name_lower = cr[1]
version = cr[2]
Release = cr[3]
Copyright = cr[4]
Website = cr[5]
Author = cr[6]
Mail = cr[7]
Comment = cr[8]
copyright = cr[4]
website = cr[5]
author = cr[6]
mail = cr[7]
comment = cr[8]
# -----------------
dr = descriptions_release()
Short_Dscrp = dr[0]
Long_Dscrp = dr[1]
Short_Lic = dr[2]
Long_Lic = dr[3]
long_lic = dr[3]
# ------------------
info = wx.adv.AboutDialogInfo()
info.SetIcon(wx.Icon(videomass_icon, type=wx.BITMAP_TYPE_PNG))
info.SetName("%s" % Name)
info.SetVersion("v%s" % Version)
info.SetName(f"{name_upper}")
info.SetVersion(f"v{version}")
info.SetDescription(_("Cross-platform graphical interface "
"for FFmpeg and youtube-dl.\n"))
info.SetCopyright("Copyright %s %s %s" % (Copyright, Author[0], Author[1]))
info.SetWebSite(Website)
info.SetLicence(Long_Lic)
info.AddDeveloper("%s <%s>" % (Author[0], Mail))
info.SetCopyright(f"Copyright {copyright} {author[0]} {author[1]}")
info.SetWebSite(website)
info.SetLicence(long_lic)
info.AddDeveloper(f"{author[0]} <{mail}>")
info.AddDocWriter("Gianluca Pernigotto <[email protected]>")
info.AddTranslator("Gianluca Pernigotto <[email protected]> (it_IT)")
info.AddTranslator("ChourS <[email protected]> (ru_RU)")
Expand Down
4 changes: 1 addition & 3 deletions videomass/vdms_main/main_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -844,9 +844,7 @@ def prst_downloader(self, event):
def reminder(self, event):
"""
Call `io_tools.openpath` to open a 'user_memos.txt' file
with default GUI text editor. If 'user_memos.txt' file does
not exist a new empty file with the same name will be created.
with default GUI text editor.
"""
fname = os.path.join(self.appdata['confdir'], 'user_memos.txt')

Expand Down
16 changes: 8 additions & 8 deletions videomass/vdms_threads/appimage_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@
class AppImageUpdate(Thread):
"""
This class is responsible for updating the Python packages
on Videomass.Appimage using the xterm terminal emulator for
displaying the output command in real time. Furthermore all
output will be saved to a log file.
on `Videomass*.Appimage` using the xterm terminal emulator
for displaying the output command in real time. Furthermore
all output will be saved to a log file.
"""
def __init__(self, appimage, script, logfile):
"""
Attributes defined here:
executable current python executable
self.status exit status value
self.cmd command for execution
self.cmd command to execute
matches of xterm options used here:
Expand All @@ -61,7 +61,7 @@ def __init__(self, appimage, script, logfile):
-geometry ...... window width and height respectively
-title ......... title on the window
-xrm 'xterm*iconHint: /path/to/icon.xpm' .... to embed icon
-e ............. start your command after e.g. 'ls -l'
-e ............. execute your command e.g. 'ls -l'
type `xterm -h` for major info
Expand All @@ -77,8 +77,8 @@ def __init__(self, appimage, script, logfile):
icon = os.path.join(os.path.dirname(spath), xpm)
# set command:
name = os.path.basename(appimage)
binpath = os.path.dirname(sys.executable)
exe = os.path.join(binpath, script)
pysys = os.path.dirname(sys.executable)
exe = os.path.join(pysys, script)
self.status = None
self.cmd = shlex.split(
f"xterm +hold -u8 -bg '{backgrd}' -fg '{foregrd}' -fa "
Expand Down
56 changes: 14 additions & 42 deletions videomass/vdms_threads/opendir.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
Porpose: open file browser on given pathname
Compatibility: Python3 (Unix, Windows)
Author: Gianluca Pernigotto <[email protected]>
Copyright: (c) 2018/2021 Gianluca Pernigotto <[email protected]>
Copyright: (c) 2018/2022 Gianluca Pernigotto <[email protected]>
license: GPL3
Rev: May.11.2021
Rev: Feb.22.2022
Code checker:
flake8: --ignore F821, W504
pylint: --ignore E0602, E1101
Expand All @@ -30,63 +30,35 @@
import os


def browse(opsyst, pathname):
def browse(ostype, pathname):
"""
open file browser in a specific location (OS independent)
open file in a specific location (OS independent)
"""
status = 'Unrecognized error'

if opsyst == 'Windows':
if ostype == 'Windows':
try:
os.startfile(os.path.realpath(pathname))

except FileNotFoundError as pathnotfound:
return '%s' % pathnotfound
return f'{pathnotfound}'

except Exception as anyerr:
return '%s' % anyerr
return f'{anyerr}'

return None

if opsyst == 'Darwin':
if ostype == 'Darwin':
cmd = ['open', pathname]

else: # xdg-open *should* be supported by recent Gnome, KDE, Xfce
cmd = ['xdg-open', pathname]

try:
with subprocess.Popen(cmd,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
universal_newlines=True, # mod text
) as proc:

out = proc.communicate()

if proc.returncode: # if returncode == 1
status = out[0]
else:
status = None

except (OSError, FileNotFoundError) as oserr: # exec. do not exist
status = '%s' % oserr

return status
proc = subprocess.run(cmd, check=True, shell=False)
except FileNotFoundError as err:
return err

"""
NOTE The following code work, but on MS-Windows it show a short of
Dos-window
-----------------
if proc.returncode:
return "EXIT: {proc.returncode}\nERROR: {proc.stderr}"

try:
p = subprocess.run(cmd)
if p.stderr:
return(p.stderr.decode())
'''
if not *capture_output=True* on subprocess instance
use .decode() here.
'''
except FileNotFoundError as err:
return('%s' % (err))
"""
return None

0 comments on commit 9198828

Please sign in to comment.