def __init__(self, edit_mode): """Initialize a :class:`View` instance.""" GObject.GObject.__init__(self) self._active_col_name = "" self._calc = aeidon.Calculator() self.columns = aeidon.Enumeration() self._selection_changed_handlers = {} self._init_signal_handlers() self._init_props(edit_mode)
def _reset_columns(self): """Recreate the columns enumeration and set all items to ``None``.""" self.columns = aeidon.Enumeration() self.columns.NUMBER = None self.columns.START = None self.columns.END = None self.columns.DURATION = None self.columns.MAIN_TEXT = None self.columns.TRAN_TEXT = None
# # 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/>. """Enumerations for orientation types.""" import aeidon from gi.repository import Gtk __all__ = ("orientation", ) class Horizontal(aeidon.EnumerationItem): value = Gtk.Orientation.HORIZONTAL class Vertical(aeidon.EnumerationItem): value = Gtk.Orientation.VERTICAL orientation = aeidon.Enumeration() orientation.HORIZONTAL = Horizontal() orientation.VERTICAL = Vertical()
value = Gtk.ToolbarStyle.BOTH class BothHoriz(aeidon.EnumerationItem): value = Gtk.ToolbarStyle.BOTH_HORIZ class Default(aeidon.EnumerationItem): value = None class Icons(aeidon.EnumerationItem): value = Gtk.ToolbarStyle.ICONS class Text(aeidon.EnumerationItem): value = Gtk.ToolbarStyle.TEXT toolbar_styles = aeidon.Enumeration() toolbar_styles.DEFAULT = Default() toolbar_styles.ICONS = Icons() toolbar_styles.TEXT = Text() toolbar_styles.BOTH = Both() toolbar_styles.BOTH_HORIZ = BothHoriz()
class FieldMainText(aeidon.EnumerationItem): is_position = False is_text = True label = _("Text") tooltip = _("Text") class FieldTranslationText(aeidon.EnumerationItem): is_position = False is_text = True label = _("Translation") tooltip = _("Translation") fields = aeidon.Enumeration() fields.NUMBER = FieldNumber() fields.START = FieldStart() fields.END = FieldEnd() fields.DURATION = FieldDuration() fields.MAIN_TEXT = FieldMainText() fields.TRAN_TEXT = FieldTranslationText() class LengthUnitChar(aeidon.EnumerationItem): label = _("characters") class LengthUnitEm(aeidon.EnumerationItem): label = _("ems")
# (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/>. """Enumerations for length unit types.""" import aeidon _ = aeidon.i18n._ __all__ = ("length_units", ) class Char(aeidon.EnumerationItem): label = _("characters") class Em(aeidon.EnumerationItem): label = _("ems") length_units = aeidon.Enumeration() length_units.CHAR = Char() length_units.EM = Em()
# (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/>. """Enumerations for document types.""" import aeidon __all__ = ("documents",) class Main(aeidon.EnumerationItem): pass class Translation(aeidon.EnumerationItem): pass documents = aeidon.Enumeration() documents.MAIN = Main() documents.TRAN = Translation()
# along with this program. If not, see <http://www.gnu.org/licenses/>. """Enumerations for action reversion register types.""" import aeidon __all__ = ("registers", ) class Do(aeidon.EnumerationItem): shift = 1 signal = "action-done" class Undo(aeidon.EnumerationItem): shift = -1 signal = "action-undone" class Redo(aeidon.EnumerationItem): shift = 1 signal = "action-redone" registers = aeidon.Enumeration() registers.DO = Do() registers.UNDO = Undo() registers.REDO = Redo()
# 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 VLC(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 = MPlayer() players.VLC = VLC()
is_text = False # Translators: 'Dur.' is short for duration. It is used in the header of a # tree view column that contains numbers five characters wide. label = _("Dur.") tooltip = _("Duration") class MainText(aeidon.EnumerationItem): is_position = False is_text = True label = _("Main Text") tooltip = _("Main text") class TranslationText(aeidon.EnumerationItem): is_position = False is_text = True label = _("Translation Text") tooltip = _("Translation text") fields = aeidon.Enumeration() fields.NUMBER = Number() fields.START = Start() fields.END = End() fields.DURATION = Duration() fields.MAIN_TEXT = MainText() fields.TRAN_TEXT = TranslationText()
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 = aeidon.modes.TIME class TMPlayer(aeidon.EnumerationItem): container = None extension = ".txt" has_header = False identifier = r"^-?\d?\d:\d\d:\d\d:" label = "TMPlayer" mime_type = "text/plain" mode = aeidon.modes.TIME formats = aeidon.Enumeration() formats.ASS = AdvSubStationAlpha() formats.MICRODVD = MicroDVD() formats.MPL2 = MPL2() formats.MPSUB = MPsub() formats.SUBRIP = SubRip() formats.SSA = SubStationAlpha() formats.SUBVIEWER2 = SubViewer2() formats.TMPLAYER = TMPlayer()
"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()
mpsub = "23.98" value = 24 / 1.001 class Framerate24000(aeidon.EnumerationItem): label = _("24.000 fps") mpsub = "24.00" value = 24.0 class Framerate25000(aeidon.EnumerationItem): label = _("25.000 fps") mpsub = "25.00" value = 25.0 class Framerate29970(aeidon.EnumerationItem): label = _("29.970 fps") mpsub = "29.97" 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()
# Foundation, either version 3 of the License, or (at your option) any later # version. # # Gaupol 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 # Gaupol. If not, see <http://www.gnu.org/licenses/>. """Enumerations for subtitle align methods.""" import aeidon _ = aeidon.i18n._ __all__ = ("align_methods", ) class Number(aeidon.EnumerationItem): label = _("Subtitle number") class Position(aeidon.EnumerationItem): label = _("Subtitle position") align_methods = aeidon.Enumeration() align_methods.NUMBER = Number() align_methods.POSITION = Position()
"""Enumerations for newline character types.""" import aeidon _ = aeidon.i18n._ __all__ = ("newlines", ) class Mac(aeidon.EnumerationItem): label = _("Mac (classic)") value = "\r" class Unix(aeidon.EnumerationItem): label = "Unix" value = "\n" class Windows(aeidon.EnumerationItem): label = "Windows" value = "\r\n" newlines = aeidon.Enumeration() newlines.MAC = Mac() newlines.UNIX = Unix() newlines.WINDOWS = Windows()
# # You should have received a copy of the GNU General Public License along with # Gaupol. If not, see <http://www.gnu.org/licenses/>. """Enumerations for action target types.""" import aeidon __all__ = ("targets",) class Selected(aeidon.EnumerationItem): pass class Current(aeidon.EnumerationItem): pass class All(aeidon.EnumerationItem): pass targets = aeidon.Enumeration() targets.SELECTED = Selected() targets.CURRENT = Current() targets.ALL = All()
# 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 # Gaupol. If not, see <http://www.gnu.org/licenses/>. """Enumerations for position unit types.""" import aeidon __all__ = ("modes", ) class Time(aeidon.EnumerationItem): pass class Frame(aeidon.EnumerationItem): pass class Seconds(aeidon.EnumerationItem): pass modes = aeidon.Enumeration() modes.TIME = Time() modes.FRAME = Frame() modes.SECONDS = Seconds()
def setup_method(self, method): self.fruits = aeidon.Enumeration() self.fruits.APPLE = aeidon.EnumerationItem() self.fruits.MANGO = aeidon.EnumerationItem() self.fruits.APPLE.size = 10 self.fruits.MANGO.size = 20