• Stars
    star
    119
  • Rank 297,930 (Top 6 %)
  • Language
    Python
  • License
    Other
  • Created over 11 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-music

Music is the GNOME music playing application.

Where can I find more?

Music has a wiki page at https://wiki.gnome.org/Apps/Music.

You can join the developers on IRC: #gnome-music on Libera Chat.

Join the development

Follow the GNOME Newcomers guide and choose Music as your project. There are bugs labeled for newcomers, which should provide an easy entry point. Of course, feel free to pick something more challenging. Pick bugs if you can, not feature requests. The goal is to make the current Music experience sound & stable and only then extend it's functionality.

Build Music

Music uses the meson build system. Use the following commands to build Music from the source directory:

$ meson _build
$ cd _build
$ ninja

Then you can either run in the build dir by running:

$ ./local-music

You can also install Music system-wide by running:

$ ninja install

Debugging

GNOME Music uses GLib logging facilities to print debug messages. It can be activated by setting the G_MESSAGES_DEBUG environment variable:

G_MESSAGES_DEBUG=org.gnome.Music gnome-music

Coding style

GNOME Music is written in Python and adheres to the coding style described in the python style guide PEP-8.

Docstrings adhere to PEP-257. The content of docstrings uses the Sphinx markup style. Docstrings should be added to all (new) public functions.

Take note of the following rules as a basic style guide, but when in doubt consult PEP-8.

Line length

Limit all lines to a maximum of 79 characters.

For flowing long blocks of text with fewer structural restrictions (docstrings or comments), the line length should be limited to 72 characters.

Indentation

Music uses hanging indents when the lines get too long.

When using a hanging indent the following should be considered; there should be no arguments on the first line and further indentation should be used to clearly distinguish itself as a continuation line.

# More indentation included to distinguish this from the rest.
def long_function_name(
        var_one, var_two, var_three,
        var_four):
    print(var_one)

# Hanging indents should add a level.
foo = long_function_name(
    var_one, var_two,
    var_three, var_four)

Line break before a binary operator

# Yes: easy to match operators with operands
income = (gross_wages
          + taxable_interest
          + (dividends - qualified_dividends)
          - ira_deduction
          - student_loan_interest)

# Add some extra indentation on the conditional continuation line.
if (this_is_one_thing
        and that_is_another_thing):
    do_something()

Class internals

All non-public classwide variables or methods should be prepended with an underscore.

_single_leading_underscore: weak "internal use" indicator. E.g. from M import * does not import objects whose name starts with an underscore.

Type checking

Post 3.38 Music is starting to use type checking for all new code. This means that all arguments, returns values and variables have defined types and these types are checked for errors during the CI phase. Music uses mypy for the type checking pass.

The specific syntax is best learned from the code already adapted (coresong.py, grltrackerwrapper.py) or online sources, note that Music uses the annotation style. A simple example follows.

Old
x = []

x.append(1)
New
from typing import List

x: List[int] = []

x.append(1)

Properties

Mypy does not currently support PyGObject properties. This means property setters need to be forceibly ignored.

@GObject.Property(type=bool, default=False)
def selected(self) -> bool:
    return self._selected

@selected.setter  # type: ignore
def selected(self, value: bool) -> None:
    self._selected = value

PyGObject specifics

Properties

Most objects in Music are derived from GObject and have properties. Use PyGObject properties through decorator usage if you add properties to your code.

Short form for simple properties:

selected = GObject.Property(type=bool, default=False)

With method definition if more control is needed:

@GObject.Property(type=bool, default=False)
def selection_mode(self):
    return self._selection_mode

@selection_mode.setter
def selection_mode(self, value):
    self._selection_mode = value

Manipulate and refer to GObject properties with the props attribute to set them apart from regular python attributes:

is_selected = object.props.selected

object.props.selection_mode = True
Multi-word properties

Note that GObject multi-word properties are separated by - as in 'selection-mode', however Python does not allow - in variable or method names. So these are translated to _ instead. You might find both 'selection-mode' and selection_mode in the code (depending on how they are used), but they refer to the same property.

Templates

Music uses ui templates extensively for building the user interface. The basic usage in Python is as follows, with the widget.ui file being a regular GTK template:

@Gtk.Template(resource_path="/org/gnome/Music/widget.ui")
class Widget(Gtk.Widget):

    __gtype_name__ = "Widget"

    _button = Gtk.Template.Child()

    @Gtk.Template.Callback()
    def _on_button_clicked(self, klass):
        pass

Commit messages

Music is fairly strict on the format and contents of commit messages. New contributors often struggle with this.

The GNOME wiki has a good intro on what a proper commit message is and this is a must read for first-time contributors.

It is always recommended to look at other Music commit messages as well to get an idea of what a good commit message is specific to Music.

It should look somewhat like:

tag: Short explanation

Problem in some detail. Implemented fix.

Closes: #issuenr

Merge requests

When opening a Merge Request, please enable the 'Allow commits from members who can merge to the target branch' checkbox. This allows the Music maintainers to help out on the Merge Request as needed.

More Repositories

1

gimp

Read-only mirror of https://gitlab.gnome.org/GNOME/gimp
C
4,562
star
2

glib

Read-only mirror of https://gitlab.gnome.org/GNOME/glib
C
1,375
star
3

gtk

Read-only mirror of https://gitlab.gnome.org/GNOME/gtk
C
1,275
star
4

meld

Read-only mirror of https://gitlab.gnome.org/GNOME/meld
Python
949
star
5

vala

Read-only mirror of https://gitlab.gnome.org/GNOME/vala
Vala
786
star
6

gnome-shell

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-shell
C
715
star
7

libxml2

Read-only mirror of https://gitlab.gnome.org/GNOME/libxml2
C
479
star
8

gedit

Read-only mirror of https://gitlab.gnome.org/GNOME/gedit
C
399
star
9

geary

Read-only mirror of https://gitlab.gnome.org/GNOME/geary
Vala
353
star
10

dia

Read-only mirror of https://gitlab.gnome.org/GNOME/dia
C
324
star
11

librsvg

Read-only mirror of https://gitlab.gnome.org/GNOME/librsvg
Rust
313
star
12

nautilus

Read-only mirror of https://gitlab.gnome.org/GNOME/nautilus
C
307
star
13

evince

Read-only mirror of https://gitlab.gnome.org/GNOME/evince
C
301
star
14

gnome-terminal

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-terminal
C++
266
star
15

epiphany

Read-only mirror of https://gitlab.gnome.org/GNOME/epiphany
C
264
star
16

gparted

Read-only mirror of https://gitlab.gnome.org/GNOME/gparted
C++
254
star
17

gnome-builder

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-builder
C
232
star
18

glade

Read-only mirror of https://gitlab.gnome.org/GNOME/glade
C
206
star
19

rhythmbox

Read-only mirror of https://gitlab.gnome.org/GNOME/rhythmbox
C
192
star
20

mutter

Read-only mirror of https://gitlab.gnome.org/GNOME/mutter
C
170
star
21

gitg

Read-only mirror of https://gitlab.gnome.org/GNOME/gitg
Vala
167
star
22

vte

Read-only mirror of https://gitlab.gnome.org/GNOME/vte
C++
161
star
23

gjs

Read-only mirror of https://gitlab.gnome.org/GNOME/gjs
C++
155
star
24

zenity

Read-only mirror of https://gitlab.gnome.org/GNOME/zenity
C
150
star
25

gtkmm

Read-only mirror of https://gitlab.gnome.org/GNOME/gtkmm
Scheme
147
star
26

shotwell

Read-only mirror of https://gitlab.gnome.org/GNOME/shotwell
Vala
145
star
27

pygobject

Read-only mirror of https://gitlab.gnome.org/GNOME/pygobject
Python
144
star
28

gthumb

Read-only mirror of https://gitlab.gnome.org/GNOME/gthumb
C
140
star
29

evolution

Read-only mirror of https://gitlab.gnome.org/GNOME/evolution
C
139
star
30

pango

Read-only mirror of https://gitlab.gnome.org/GNOME/pango
C
132
star
31

sushi

Read-only mirror of https://gitlab.gnome.org/GNOME/sushi
C
123
star
32

pitivi

Read-only mirror of https://gitlab.gnome.org/GNOME/pitivi
Python
120
star
33

adwaita-icon-theme

Read-only mirror of https://gitlab.gnome.org/GNOME/adwaita-icon-theme
Python
113
star
34

gnome-boxes

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-boxes
Vala
112
star
35

baobab

Read-only mirror of https://gitlab.gnome.org/GNOME/baobab
Vala
104
star
36

orca

Read-only mirror of https://gitlab.gnome.org/GNOME/orca
Python
96
star
37

gnome-calendar

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-calendar
C
92
star
38

gdm

Read-only mirror of https://gitlab.gnome.org/GNOME/gdm
C
87
star
39

gnome-desktop

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-desktop
C
86
star
40

ocrfeeder

Read-only mirror of https://gitlab.gnome.org/GNOME/ocrfeeder
Python
84
star
41

gnome-control-center

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-control-center
C
80
star
42

gnome-screenshot

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-screenshot
C
78
star
43

gnumeric

Read-only mirror of https://gitlab.gnome.org/GNOME/gnumeric
C
77
star
44

gvfs

Read-only mirror of https://gitlab.gnome.org/GNOME/gvfs
C
76
star
45

gnome-system-monitor

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-system-monitor
C++
74
star
46

gegl

Read-only mirror of https://gitlab.gnome.org/GNOME/gegl
C
73
star
47

gnome-software

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-software
C
72
star
48

gnome-tweaks

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-tweaks
Python
71
star
49

d-feet

Read-only mirror of https://gitlab.gnome.org/GNOME/d-feet
Python
71
star
50

easytag

Read-only mirror of https://gitlab.gnome.org/GNOME/easytag
C
69
star
51

gnome-multi-writer

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-multi-writer
C
69
star
52

ghex

Read-only mirror of https://gitlab.gnome.org/GNOME/ghex
C
66
star
53

glibmm

Read-only mirror of https://gitlab.gnome.org/GNOME/glibmm
Scheme
62
star
54

gobject-introspection

Read-only mirror of https://gitlab.gnome.org/GNOME/gobject-introspection
C
61
star
55

gstreamermm

Read-only mirror of https://gitlab.gnome.org/GNOME/gstreamermm
Scheme
61
star
56

libadwaita

Read-only mirror of https://gitlab.gnome.org/GNOME/libadwaita
C
61
star
57

gnome-calculator

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-calculator
Vala
61
star
58

gnome-maps

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-maps
JavaScript
60
star
59

tracker

Read-only mirror of https://gitlab.gnome.org/GNOME/tracker
C
59
star
60

polari

Read-only mirror of https://gitlab.gnome.org/GNOME/polari
JavaScript
58
star
61

cheese

Read-only mirror of https://gitlab.gnome.org/GNOME/cheese
C
58
star
62

rygel

Read-only mirror of https://gitlab.gnome.org/GNOME/rygel
Vala
58
star
63

libsoup

Read-only mirror of https://gitlab.gnome.org/GNOME/libsoup
C
57
star
64

gnome-backgrounds

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-backgrounds
Meson
56
star
65

evolution-ews

Read-only mirror of https://gitlab.gnome.org/GNOME/evolution-ews
C
56
star
66

brasero

Read-only mirror of https://gitlab.gnome.org/GNOME/brasero
C
55
star
67

gnome-disk-utility

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-disk-utility
C
54
star
68

gtksourceview

Read-only mirror of https://gitlab.gnome.org/GNOME/gtksourceview
C
54
star
69

dasher

Read-only mirror of https://gitlab.gnome.org/GNOME/dasher
C
54
star
70

gnote

Read-only mirror of https://gitlab.gnome.org/GNOME/gnote
C++
53
star
71

libxslt

Read-only mirror of https://gitlab.gnome.org/GNOME/libxslt
HTML
53
star
72

totem

Read-only mirror of https://gitlab.gnome.org/GNOME/totem
C
52
star
73

libnotify

Read-only mirror of https://gitlab.gnome.org/GNOME/libnotify
C
51
star
74

gnome-shell-extensions

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-shell-extensions
JavaScript
50
star
75

simple-scan

Read-only mirror of https://gitlab.gnome.org/GNOME/simple-scan
Vala
48
star
76

file-roller

Read-only mirror of https://gitlab.gnome.org/GNOME/file-roller
C
48
star
77

libsecret

Read-only mirror of https://gitlab.gnome.org/GNOME/libsecret
C
46
star
78

cantarell-fonts

Read-only mirror of https://gitlab.gnome.org/GNOME/cantarell-fonts
Python
45
star
79

jhbuild

Read-only mirror of https://gitlab.gnome.org/GNOME/jhbuild
Python
44
star
80

gnome-settings-daemon

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-settings-daemon
C
44
star
81

recipes

Read-only mirror of https://gitlab.gnome.org/GNOME/recipes
C
43
star
82

eog

Read-only mirror of https://gitlab.gnome.org/GNOME/eog
C
41
star
83

seahorse

Read-only mirror of https://gitlab.gnome.org/GNOME/seahorse
C
39
star
84

fractal

Read-only mirror of https://gitlab.gnome.org/GNOME/fractal
Rust
38
star
85

evolution-activesync

Read-only mirror of https://gitlab.gnome.org/GNOME/evolution-activesync
C
38
star
86

gnome-chess

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-chess
Vala
37
star
87

gnome-commander

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-commander
C++
36
star
88

libgda

Read-only mirror of https://gitlab.gnome.org/GNOME/libgda
C
35
star
89

alacarte

Read-only mirror of https://gitlab.gnome.org/GNOME/alacarte
Python
34
star
90

nautilus-python

Read-only mirror of https://gitlab.gnome.org/GNOME/nautilus-python
C
33
star
91

msitools

Read-only mirror of https://gitlab.gnome.org/GNOME/msitools
C
33
star
92

gtkmm-documentation

Read-only mirror of https://gitlab.gnome.org/GNOME/gtkmm-documentation
Python
32
star
93

dconf-editor

Read-only mirror of https://gitlab.gnome.org/GNOME/dconf-editor
Vala
31
star
94

libgsf

Read-only mirror of https://gitlab.gnome.org/GNOME/libgsf
C
31
star
95

devhelp

Read-only mirror of https://gitlab.gnome.org/GNOME/devhelp
C
30
star
96

gedit-plugins

Read-only mirror of https://gitlab.gnome.org/GNOME/gedit-plugins
Python
27
star
97

metacity

Read-only mirror of https://gitlab.gnome.org/GNOME/metacity
C
27
star
98

sysprof

Read-only mirror of https://gitlab.gnome.org/GNOME/sysprof
C
26
star
99

gdk-pixbuf

Read-only mirror of https://gitlab.gnome.org/GNOME/gdk-pixbuf
C
25
star
100

gnome-online-accounts

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-online-accounts
C
25
star