Exemple #1
0
def get_sentry():
    """Returns a cached Sentry instance

    Returns:
        Sentry
    """

    # reverse, so it isn't so easy to search for at least
    SENTRY_DSN = (
        "514241/oi.yrtnes@0818e5ab0218038bcbb41f049ec5de21:"
        "0d15f73b978d143b5e84030a1ddf9a73//:sptth")[::-1]

    sentry = Sentry(SENTRY_DSN)
    sentry.add_tag("release", quodlibet.get_build_description())
    sentry.add_tag("build_type", BUILD_TYPE)
    sentry.add_tag("build_info", BUILD_INFO)
    sentry.add_tag("mutagen_version", fver(mutagen.version))
    sentry.add_tag("python_version", platform.python_version())
    sentry.add_tag("gtk_version", fver(gtk_version))
    sentry.add_tag("gtk_backend", get_backend_name())
    sentry.add_tag("pygobject_version", fver(pygobject_version))
    sentry.add_tag("pycairo_version", fver(cairo.version_info))
    sentry.add_tag("platform", platform.platform())

    return sentry
Exemple #2
0
    def __init__(self, parent, player, name, icon):
        super(AboutDialog, self).__init__()
        self.set_transient_for(parent)
        self.set_program_name(name)
        self.set_version(const.VERSION)
        self.set_authors(const.AUTHORS)
        self.set_artists(const.ARTISTS)
        self.set_logo_icon_name(icon)

        def chunks(l, n):
            return [l[i:i + n] for i in range(0, len(l), n)]

        fmts = ",\n".join(", ".join(c) for c in chunks(formats.names, 4))
        text = []
        text.append(_("Supported formats: %s") % fmts)
        text.append("")
        if player:
            text.append(_("Audio device: %s") % player.name)
        text.append("Python: %s" % platform.python_version())
        text.append("Mutagen: %s" % fver(mutagen.version))
        text.append("GTK+: %s (%s)" % (fver(gtk_version), get_backend_name()))
        text.append("PyGObject: %s" % fver(pygobject_version))
        if player:
            text.append(player.version_info)
        self.set_comments("\n".join(text))
        self.set_license_type(Gtk.License.GPL_2_0)
        self.set_translator_credits("\n".join(const.TRANSLATORS))
        self.set_website(const.WEBSITE)
        self.set_copyright(const.COPYRIGHT + "\n" +
                           "<%s>" % const.SUPPORT_EMAIL)
Exemple #3
0
    def __init__(self, parent, app):
        super(AboutDialog, self).__init__()
        self.set_transient_for(parent)
        self.set_program_name(app.name)
        self.set_version(quodlibet.get_build_description())
        self.set_authors(const.AUTHORS)
        self.set_artists(const.ARTISTS)
        self.set_logo_icon_name(app.icon_name)

        def chunks(l, n):
            return [l[i : i + n] for i in range(0, len(l), n)]

        is_real_player = app.player.name != "Null"

        format_names = sorted([t.format for t in formats.types])
        fmts = ",\n".join(", ".join(c) for c in chunks(format_names, 4))
        text = []
        text.append(_("Supported formats: %s") % fmts)
        text.append("")
        if is_real_player:
            text.append(_("Audio device: %s") % app.player.name)
        text.append("Python: %s" % platform.python_version())
        text.append("Mutagen: %s" % fver(mutagen.version))
        text.append("GTK+: %s (%s)" % (fver(gtk_version), get_backend_name()))
        text.append("PyGObject: %s" % fver(pygobject_version))
        if is_real_player:
            text.append(app.player.version_info)
        self.set_comments("\n".join(text))
        self.set_license_type(Gtk.License.GPL_2_0)
        self.set_translator_credits("\n".join(const.TRANSLATORS))
        self.set_website(const.WEBSITE)
        self.set_copyright(const.COPYRIGHT + "\n" + "<%s>" % const.SUPPORT_EMAIL)
Exemple #4
0
    def PluginPreferences(self, *args):
        vb = Gtk.VBox()

        row = 0
        grid = Gtk.Grid(column_spacing=12, row_spacing=6)

        def label_title(text):
            l = Gtk.Label(label=text, xalign=1, yalign=0, wrap=True,
                          justify=Gtk.Justification.RIGHT, selectable=True)
            l.get_style_context().add_class(Gtk.STYLE_CLASS_DIM_LABEL)
            return l

        def label_value(text):
            return Gtk.Label(label=text, wrap=True, xalign=0, yalign=0,
                             width_chars=25, selectable=True)

        def label_path(path):
            l = Gtk.Label(label="<a href='%s'>%s</a>" % (
                            fsn2uri(path), escape(fsn2text(unexpand(path)))),
                          use_markup=True,
                          ellipsize=Pango.EllipsizeMode.MIDDLE,
                          xalign=0,
                          selectable=True)

            l.connect("activate-link", show_uri)
            return l

        grid.insert_row(row)
        l = label_title(_("Supported Formats"))
        format_names = sorted([t.format for t in formats.types])
        v = label_value(", ".join(format_names))
        grid.attach(l, 0, row, 1, 1)
        grid.attach(v, 1, row, 1, 1)
        row += 1

        grid.insert_row(row)
        l = label_title(_("Configuration Directory"))
        v = label_path(get_user_dir())
        grid.attach(l, 0, row, 1, 1)
        grid.attach(v, 1, row, 1, 1)
        row += 1

        grid.insert_row(row)
        l = label_title(_("Cache Directory"))
        v = label_path(get_cache_dir())
        grid.attach(l, 0, row, 1, 1)
        grid.attach(v, 1, row, 1, 1)
        row += 1

        grid.insert_row(row)
        l = label_title(_("Audio Backend"))
        v = label_value("%s\n%s" % (app.player.name, app.player.version_info))
        grid.attach(l, 0, row, 1, 1)
        grid.attach(v, 1, row, 1, 1)
        row += 1

        grid.insert_row(row)
        l = label_title("Python")
        v = label_value(platform.python_version())
        grid.attach(l, 0, row, 1, 1)
        grid.attach(v, 1, row, 1, 1)
        row += 1

        grid.insert_row(row)
        l = label_title("Mutagen")
        v = label_value(fver(mutagen.version))
        grid.attach(l, 0, row, 1, 1)
        grid.attach(v, 1, row, 1, 1)
        row += 1

        grid.insert_row(row)
        l = label_title("Gtk+")
        v = label_value("%s (%s, %s)" % (
            fver(gtk_version), get_backend_name(), get_font_backend_name()))
        grid.attach(l, 0, row, 1, 1)
        grid.attach(v, 1, row, 1, 1)
        row += 1

        grid.insert_row(row)
        l = label_title("PyGObject")
        v = label_value(fver(pygobject_version))
        grid.attach(l, 0, row, 1, 1)
        grid.attach(v, 1, row, 1, 1)
        row += 1

        vb.pack_start(grid, True, True, 0)
        vb.show_all()

        return vb
Exemple #5
0
    def PluginPreferences(self, *args):
        vb = Gtk.VBox()

        row = 0
        grid = Gtk.Grid(column_spacing=12, row_spacing=6)

        def label_title(text):
            l = Gtk.Label(label=text, xalign=1, yalign=0, wrap=True,
                          justify=Gtk.Justification.RIGHT, selectable=True)
            l.get_style_context().add_class(Gtk.STYLE_CLASS_DIM_LABEL)
            return l

        def label_value(text):
            return Gtk.Label(label=text, wrap=True, xalign=0, yalign=0,
                             width_chars=25, selectable=True)

        def label_path(path):
            l = Gtk.Label(label="<a href='%s'>%s</a>" % (
                            fsn2uri(path), escape(fsn2text(unexpand(path)))),
                          use_markup=True,
                          ellipsize=Pango.EllipsizeMode.MIDDLE,
                          xalign=0,
                          selectable=True)

            l.connect("activate-link", show_uri)
            return l

        grid.insert_row(row)
        l = label_title(_("Supported Formats"))
        format_names = sorted([t.format for t in formats.types])
        v = label_value(", ".join(format_names))
        grid.attach(l, 0, row, 1, 1)
        grid.attach(v, 1, row, 1, 1)
        row += 1

        grid.insert_row(row)
        l = label_title(_("Configuration Directory"))
        v = label_path(get_user_dir())
        grid.attach(l, 0, row, 1, 1)
        grid.attach(v, 1, row, 1, 1)
        row += 1

        grid.insert_row(row)
        l = label_title(_("Cache Directory"))
        v = label_path(get_cache_dir())
        grid.attach(l, 0, row, 1, 1)
        grid.attach(v, 1, row, 1, 1)
        row += 1

        grid.insert_row(row)
        l = label_title(_("Audio Backend"))
        v = label_value("%s\n%s" % (app.player.name, app.player.version_info))
        grid.attach(l, 0, row, 1, 1)
        grid.attach(v, 1, row, 1, 1)
        row += 1

        grid.insert_row(row)
        l = label_title("Python")
        v = label_value(platform.python_version())
        grid.attach(l, 0, row, 1, 1)
        grid.attach(v, 1, row, 1, 1)
        row += 1

        grid.insert_row(row)
        l = label_title("Mutagen")
        v = label_value(fver(mutagen.version))
        grid.attach(l, 0, row, 1, 1)
        grid.attach(v, 1, row, 1, 1)
        row += 1

        grid.insert_row(row)
        l = label_title("Gtk+")
        v = label_value("%s (%s)" % (fver(gtk_version), get_backend_name()))
        grid.attach(l, 0, row, 1, 1)
        grid.attach(v, 1, row, 1, 1)
        row += 1

        grid.insert_row(row)
        l = label_title("PyGObject")
        v = label_value(fver(pygobject_version))
        grid.attach(l, 0, row, 1, 1)
        grid.attach(v, 1, row, 1, 1)
        row += 1

        vb.pack_start(grid, True, True, 0)
        vb.show_all()

        return vb