/usr/lib/python3/dist-packages/aeidon/enums.py is in python3-aeidon 1.3.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 | # -*- coding: utf-8 -*-
# Copyright (C) 2016 Osmo Salomaa
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""Miscellanous enumerations."""
import aeidon
import os
import sys
from aeidon.i18n import _
__all__ = [
"align_methods",
"documents",
"formats",
"framerates",
"modes",
"newlines",
"players",
"registers",
]
class AlignMethodNumber(aeidon.EnumerationItem):
label = _("Subtitle number")
class AlignMethodPosition(aeidon.EnumerationItem):
label = _("Subtitle position")
align_methods = aeidon.Enumeration()
align_methods.NUMBER = AlignMethodNumber()
align_methods.POSITION = AlignMethodPosition()
class DocumentMain(aeidon.EnumerationItem): pass
class DocumentTranslation(aeidon.EnumerationItem): pass
documents = aeidon.Enumeration()
documents.MAIN = DocumentMain()
documents.TRAN = DocumentTranslation()
class Framerate23976(aeidon.EnumerationItem):
label = _("23.976 fps")
value = 24 / 1.001
class Framerate24000(aeidon.EnumerationItem):
label = _("24.000 fps")
value = 24.0
class Framerate25000(aeidon.EnumerationItem):
label = _("25.000 fps")
value = 25.0
class Framerate29970(aeidon.EnumerationItem):
label = _("29.970 fps")
value = 30 / 1.001
framerates = aeidon.Enumeration()
framerates.FPS_23_976 = Framerate23976()
framerates.FPS_24_000 = Framerate24000()
framerates.FPS_25_000 = Framerate25000()
framerates.FPS_29_970 = Framerate29970()
class ModeTime(aeidon.EnumerationItem): pass
class ModeFrame(aeidon.EnumerationItem): pass
class ModeSeconds(aeidon.EnumerationItem): pass
modes = aeidon.Enumeration()
modes.TIME = ModeTime()
modes.FRAME = ModeFrame()
modes.SECONDS = ModeSeconds()
class NewlinesMac(aeidon.EnumerationItem):
label = _("Mac (classic)")
value = "\r"
class NewlinesUnix(aeidon.EnumerationItem):
label = "Unix"
value = "\n"
class NewlinesWindows(aeidon.EnumerationItem):
label = "Windows"
value = "\r\n"
newlines = aeidon.Enumeration()
newlines.MAC = NewlinesMac()
newlines.UNIX = NewlinesUnix()
newlines.WINDOWS = NewlinesWindows()
def _get_mplayer_executable():
if sys.platform == "win32":
directory = os.environ.get("PROGRAMFILES", "C:\\Program Files")
path = os.path.join(directory, "MPlayer", "mplayer.exe")
return aeidon.util.shell_quote(path)
return "mplayer"
def _get_mpv_executable():
if sys.platform == "win32":
directory = os.environ.get("PROGRAMFILES", "C:\\Program Files")
path = os.path.join(directory, "MPV", "mpv.exe")
return aeidon.util.shell_quote(path)
return "mpv"
def _get_vlc_executable():
if sys.platform == "win32":
directory = os.environ.get("PROGRAMFILES", "C:\\Program Files")
path = os.path.join(directory, "VideoLAN", "VLC", "vlc.exe")
return aeidon.util.shell_quote(path)
return "vlc"
class PlayerMPlayer(aeidon.EnumerationItem):
command = " ".join((_get_mplayer_executable(),
"-quiet",
"-identify",
"-osdlevel 2",
"-ss $SECONDS",
"-slang",
"-noautosub",
"-sub $SUBFILE",
"$VIDEOFILE",))
if sys.platform != "win32":
# Required for mplayer to work if gaupol was started
# as a background process (&) from a terminal window.
# http://www.mplayerhq.hu/DOCS/HTML/en/faq.html#idp11051520
command = "{} < /dev/null".format(command)
command_utf_8 = " ".join((_get_mplayer_executable(),
"-quiet",
"-osdlevel 2",
"-ss $SECONDS",
"-slang",
"-noautosub",
"-sub $SUBFILE",
"-utf8",
"$VIDEOFILE",))
if sys.platform != "win32":
# Required for mplayer to work if gaupol was started
# as a background process (&) from a terminal window.
# http://www.mplayerhq.hu/DOCS/HTML/en/faq.html#idp11051520
command_utf_8 = "{} < /dev/null".format(command_utf_8)
label = "MPlayer"
class PlayerMPV(aeidon.EnumerationItem):
command = " ".join((_get_mpv_executable(),
"--quiet",
"--osd-level=2",
"--hr-seek=yes",
"--start=$SECONDS",
"--sub-file=$SUBFILE",
"$VIDEOFILE",))
command_utf_8 = " ".join((_get_mpv_executable(),
"--quiet",
"--osd-level=2",
"--hr-seek=yes",
"--start=$SECONDS",
"--sub-file=$SUBFILE",
"--sub-codepage=utf-8",
"$VIDEOFILE",))
label = "mpv"
class PlayerVLC(aeidon.EnumerationItem):
command = " ".join((_get_vlc_executable(),
"$VIDEOFILE",
":start-time=$SECONDS",
":sub-file=$SUBFILE",))
command_utf_8 = " ".join((_get_vlc_executable(),
"$VIDEOFILE",
":start-time=$SECONDS",
":sub-file=$SUBFILE",
":subsdec-encoding=UTF-8",))
label = "VLC"
players = aeidon.Enumeration()
players.MPLAYER = PlayerMPlayer()
players.MPV = PlayerMPV()
players.VLC = PlayerVLC()
class RegisterDo(aeidon.EnumerationItem):
shift = 1
signal = "action-done"
class RegisterUndo(aeidon.EnumerationItem):
shift = -1
signal = "action-undone"
class RegisterRedo(aeidon.EnumerationItem):
shift = 1
signal = "action-redone"
registers = aeidon.Enumeration()
registers.DO = RegisterDo()
registers.UNDO = RegisterUndo()
registers.REDO = RegisterRedo()
class FormatAdvSubStationAlpha(aeidon.EnumerationItem):
container = "ssa"
extension = ".ass"
has_header = True
identifier = r"^ScriptType:\s*[vV]4.00\+\s*$"
label = "Advanced Sub Station Alpha"
mime_type = "text/x-ssa"
mode = modes.TIME
class FormatLRC(aeidon.EnumerationItem):
container = None
extension = ".lrc"
has_header = True
identifier = r"^\[-?\d\d:\d\d\.\d\d\]"
label = "LRC"
mime_type = "text/plain"
mode = modes.TIME
class FormatMicroDVD(aeidon.EnumerationItem):
container = None
extension = ".sub"
has_header = True
identifier = r"^\{-?\d+\}\{-?\d+\}"
label = "MicroDVD"
mime_type = "text/x-microdvd"
mode = modes.FRAME
class FormatMPL2(aeidon.EnumerationItem):
container = None
extension = ".txt"
has_header = False
identifier = r"^\[-?\d+\]\[-?\d+\]"
label = "MPL2"
mime_type = "text/plain"
mode = modes.TIME
class FormatSubRip(aeidon.EnumerationItem):
container = "subrip"
extension = ".srt"
has_header = False
identifier = (r"^-?\d\d:\d\d:\d\d,\d\d\d -->"
r" -?\d\d:\d\d:\d\d,\d\d\d"
r"( X1:\d+ X2:\d+ Y1:\d+ Y2:\d+)?\s*$")
label = "SubRip"
mime_type = "application/x-subrip"
mode = modes.TIME
class FormatSubStationAlpha(aeidon.EnumerationItem):
container = "ssa"
extension = ".ssa"
has_header = True
identifier = r"^ScriptType:\s*[vV]4.00\s*$"
label = "Sub Station Alpha"
mime_type = "text/x-ssa"
mode = modes.TIME
class FormatSubViewer2(aeidon.EnumerationItem):
container = None
extension = ".sub"
has_header = True
identifier = (r"^-?\d\d:\d\d:\d\d\.\d\d"
r",-?\d\d:\d\d:\d\d\.\d\d\s*$")
label = "SubViewer 2.0"
mime_type = "text/x-subviewer"
mode = modes.TIME
class FormatTMPlayer(aeidon.EnumerationItem):
container = None
extension = ".txt"
has_header = False
identifier = r"^-?\d?\d:\d\d:\d\d:"
label = "TMPlayer"
mime_type = "text/plain"
mode = modes.TIME
class FormatWebVTT(aeidon.EnumerationItem):
container = "webvtt"
extension = ".vtt"
has_header = True
identifier = r"^\s*[wW][eE][bB][vV][tT][tT]\b"
label = "WebVTT"
mime_type = "text/vtt"
mode = modes.TIME
formats = aeidon.Enumeration()
formats.ASS = FormatAdvSubStationAlpha()
formats.LRC = FormatLRC()
formats.MICRODVD = FormatMicroDVD()
formats.MPL2 = FormatMPL2()
formats.SUBRIP = FormatSubRip()
formats.SSA = FormatSubStationAlpha()
formats.SUBVIEWER2 = FormatSubViewer2()
formats.TMPLAYER = FormatTMPlayer()
formats.WEBVTT = FormatWebVTT()
|