Commit 81b97361 authored by tallero's avatar tallero

Merge branch 'meson' into 'master'

Meson

Add meson build system support; 
flatpak converted to it, too.
Mantained pypi compatibility.

See merge request !2
parents 535bc859 a36300d2
Pipeline #183025 passed with stage
in 3 minutes and 3 seconds
.buildconfig
.flatpak-builder
.ipynb_checkpoints
_build
__pycache__
\#*
dist
......
......@@ -45,6 +45,13 @@ You can download the installer [here](https://gitlab.gnome.org/World/Daty/upload
#### Archlinux
The package `daty-git` has been published on [AUR](https://aur.archlinux.org/packages/daty-git/).
### PostmarketOS
```
sudo apk add gcc musl-dev python3-dev
pip install --user daty
```
#### Ubuntu Disco (19.04)
# apt install python3-gi gir1.2-gtk-3.0 python3-pip libhandy-0.0-0
......@@ -96,7 +103,13 @@ flatpak build-bundle repo ml.prevete.Daty.flatpak ml.prevete.Daty
flatpak install ml.prevete.Daty.flatpak
```
#### Option 3: with Pypi
#### Option 3: with Meson
```
meson _build --prefix=/usr
sudo ninja -C _build install
```
#### Option 4: with Pypi
Provided you have installed
```
......
../daty/resources/daty.gresource.xml
\ No newline at end of file
../daty/resources/gtk
\ No newline at end of file
icon_themes = ['hicolor']
foreach theme : icon_themes
install_subdir(theme, install_dir: 'share/icons/')
endforeach
gnome = import('gnome')
message('Compiling resources')
gnome.compile_resources(
meson.project_name(),
meson.project_name() + '.gresource.xml',
gresource_bundle: true,
source_dir: '.',
install_dir: DATA_DIR,
install: true,
# dependencies: configure_file(
# input: 'AboutDialog.ui.in',
# output: 'AboutDialog.ui',
# configuration: conf
# )
)
# Installing the schema file
# install_data(
# project_id + '.gschema.xml',
# install_dir: 'share/glib-2.0/schemas'
# )
# Merging the translations with the desktop file
i18n.merge_file(
output: project_id + '.desktop',
input: project_id + '.desktop.in',
po_dir: join_paths(meson.source_root(), 'daty/po'),
type: 'desktop',
install: true,
install_dir: join_paths(get_option('prefix'), get_option('datadir'), 'applications')
)
# Validating the desktop file
desktop_file_validate = find_program('desktop-file-validate', required:false)
if desktop_file_validate.found()
test (
'Validate desktop file',
desktop_file_validate,
args: join_paths(meson.current_build_dir (), project_id + '.desktop')
)
endif
# Merging the translations with the appdata file
# i18n.merge_file(
# output: project_id + '.appdata.xml',
# input: project_id + '.appdata.xml.in',
# po_dir: join_paths(meson.source_root(), 'subprojects/po'),
# install: true,
# install_dir: join_paths(get_option('prefix'), get_option('datadir'), 'metainfo')
# )
# Validating the appdata file
# appstreamcli = find_program('appstream-util', required: false)
# if appstreamcli.found()
# test (
# 'Validate appdata file',
# appstreamcli,
# args: ['validate', '--nonet', join_paths(meson.current_build_dir (), project_id + '.appdata.xml')]
# )
# endif
# Validating schemas
# compile_schemas = find_program('glib-compile-schemas', required: false)
# if compile_schemas.found()
# test('Validate schema file', compile_schemas,
# args: ['--strict', '--dry-run', meson.current_source_dir()]
# )
# endif
# message('Installing man-page')
# install_man('lollypop.1')
message('Making a list of icons')
subdir('icons')
......@@ -49,62 +49,62 @@ GenericName[sk]=Wikidata Editor
GenericName[sr]=Wikidata Editor
GenericName[te]=Wikidata Editor
GenericName[vi]=Wikidata Editor
Comment=Wikidata Editor
Comment[ar]=Wikidata Editor
Comment[bg]=Wikidata Editor
Comment[bn]=Wikidata Editor
Comment[ca]=Wikidata Editor
Comment[cs]=Wikidata Editor
Comment[da]=Wikidata Editor
Comment[de]=Wikidata Editor
Comment[el]=Wikidata Editor
Comment[en_GB]=Wikidata Editor
Comment[es]=Wikidata Editor
Comment[et]=Wikidata Editor
Comment[fi]=Wikidata Editor
Comment[fil]=Wikidata Editor
Comment[fr]=Wikidata Editor
Comment[gu]=Wikidata Editor
Comment[he]=Wikidata Editor
Comment[hi]=Wikidata Editor
Comment[hr]=Wikidata Editor
Comment[hu]=Wikidata Editor
Comment[id]=Wikidata Editor
Comment[it]=Wikidata Editor
Comment[ja]=Wikidata Editor
Comment[kn]=Wikidata Editor
Comment[ko]=Wikidata Editor
Comment[lt]=Wikidata Editor
Comment[lv]=Wikidata Editor
Comment[ml]=Wikidata Editor
Comment[mr]=Wikidata Editor
Comment[nb]=Wikidata Editor
Comment[nl]=Wikidata Editor
Comment[or]=Wikidata Editor
Comment[pl]=Wikidata Editor
Comment[pt]=Wikidata Editor
Comment[pt_BR]=Wikidata Editor
Comment[ro]=Wikidata Editor
Comment[ru]=Wikidata Editor
Comment[sk]=Wikidata Editor
Comment[sl]=Wikidata Editor
Comment[sr]=Wikidata Editor
Comment[sv]=Wikidata Editor
Comment[ta]=Wikidata Editor
Comment[te]=Wikidata Editor
Comment[th]=Wikidata Editor
Comment[tr]=Wikidata Editor
Comment[uk]=Wikidata Editor
Comment[vi]=Wikidata Editor
Comment[zh_CN]=Wikidata Editor
Comment[zh_HK]=Wikidata Editor
Comment[zh_TW]=Wikidata Editor
Comment=Free Wikidata Editor
Comment[ar]=Free Wikidata Editor
Comment[bg]=Free Wikidata Editor
Comment[bn]=Free Wikidata Editor
Comment[ca]=Free Wikidata Editor
Comment[cs]=Free Wikidata Editor
Comment[da]=Free Wikidata Editor
Comment[de]=Free Wikidata Editor
Comment[el]=Free Wikidata Editor
Comment[en_GB]=Free Wikidata Editor
Comment[es]=Free Wikidata Editor
Comment[et]=Free Wikidata Editor
Comment[fi]=Free Wikidata Editor
Comment[fil]=Free Wikidata Editor
Comment[fr]=Free Wikidata Editor
Comment[gu]=Free Wikidata Editor
Comment[he]=Free Wikidata Editor
Comment[hi]=Free Wikidata Editor
Comment[hr]=Free Wikidata Editor
Comment[hu]=Free Wikidata Editor
Comment[id]=Free Wikidata Editor
Comment[it]=Free Wikidata Editor
Comment[ja]=Free Wikidata Editor
Comment[kn]=Free Wikidata Editor
Comment[ko]=Free Wikidata Editor
Comment[lt]=Free Wikidata Editor
Comment[lv]=Free Wikidata Editor
Comment[ml]=Free Wikidata Editor
Comment[mr]=Free Wikidata Editor
Comment[nb]=Free Wikidata Editor
Comment[nl]=Free Wikidata Editor
Comment[or]=Free Wikidata Editor
Comment[pl]=Free Wikidata Editor
Comment[pt]=Free Wikidata Editor
Comment[pt_BR]=Free Wikidata Editor
Comment[ro]=Free Wikidata Editor
Comment[ru]=Free Wikidata Editor
Comment[sk]=Free Wikidata Editor
Comment[sl]=Free Wikidata Editor
Comment[sr]=Free Wikidata Editor
Comment[sv]=Free Wikidata Editor
Comment[ta]=Free Wikidata Editor
Comment[te]=Free Wikidata Editor
Comment[th]=Free Wikidata Editor
Comment[tr]=Free Wikidata Editor
Comment[uk]=Free Wikidata Editor
Comment[vi]=Free Wikidata Editor
Comment[zh_CN]=Free Wikidata Editor
Comment[zh_HK]=Free Wikidata Editor
Comment[zh_TW]=Free Wikidata Editor
Exec=daty
StartupNotify=true
Terminal=false
Icon=ml.prevete.Daty
Type=Application
Categories=GNOME;GTK;Network;Wikidata;
Categories=GNOME;GTK;Network;X-Wikidata;
MimeType=text/html;text/xml;application/xhtml_xml;image/webp;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;
Actions=open;
......
ml.prevete.Daty.desktop
\ No newline at end of file
#!/usr/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from daty import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())
......@@ -55,9 +55,10 @@ class Config:
'cache':user_cache_dir(appname, appauthor)}
mobile = False
verbose = True
debug = False
def __init__(self):
def __init__(self, debug=True):
self.debug = debug
self.set_dirs()
self.set_locales()
self.set_resources()
......@@ -96,6 +97,8 @@ class Config:
self.lang = translation(self.appname, self.exec_path,
languages=langs, fallback=True)
if self.debug: print("Config.set_locales: langs {}".format(langs))
def create_pywikibot_config(self, user, bot_user, bot_password):
"""Create pywikibot configuration files
......@@ -165,6 +168,9 @@ class Config:
path = join(self.exec_path, 'resources', 'daty.gresource')
resource = resource_load(path)
Resource._register(resource)
if not self.verbose:
print(resource.lookup_data("/ml/prevete/Daty/gtk/filterslist.ui",
ResourceLookupFlags(0)))
if not self.debug:
flag = ResourceLookupFlags(0)
resource_path = "/ml/prevete/Daty/gtk/filterslist.ui"
resource_cmd = resource.lookup_data(resource_path, flag)
print("Config.set_resources: {}".format(resource_debug))
......@@ -239,11 +239,8 @@ class Entity(Stack):
self.popover.set_visible(True)
self.emit("entity-editing", self.popover)
except AttributeError as e:
<<<<<<< HEAD
raise e
=======
print("Exception", e)
>>>>>>> 4033436b19a40fea5b7d881328f2b82a1837d434
print("no popover available for this type of value")
else:
self.entry.emit("search-changed")
......
......@@ -144,13 +144,10 @@ class Page(ScrolledWindow):
'value':{'entity-type':'item',
'numeric-id':1}},
'datatype':'wikibase-item'}}
<<<<<<< HEAD
value = Value(claim=claim, new=True)
values.insert(value,0)
=======
#value = Value(claim=claim, new=True)
#values.insert(value,0)
value = Value(claim={}, new=True)
values.add(value)
>>>>>>> 4033436b19a40fea5b7d881328f2b82a1837d434
values.show_all()
#event = EventButton()
#value.entity.value_eventbox.do_button_press_event(self, event)
......
# Set of available languages.
it_IT
......@@ -37,7 +37,7 @@
</gresource>
<gresource prefix="/ml/prevete/Daty/icons">
<file compressed="true" alias="ml.prevete.Daty.svg">icons/scalable/apps/ml.prevete.Daty.svg</file>
<file compressed="true" alias="ml.prevete.Daty-symbolic.svg">icons/scalable/apps/ml.prevete.Daty-symbolic.svg</file>
<file compressed="true" alias="ml.prevete.Daty.svg">icons/hicolor/scalable/apps/ml.prevete.Daty.svg</file>
<file compressed="true" alias="ml.prevete.Daty-symbolic.svg">icons/hicolor/scalable/apps/ml.prevete.Daty-symbolic.svg</file>
</gresource>
</gresources>
......@@ -331,7 +331,6 @@
<object class="GtkStack" id="entity_stack">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">center</property>
<property name="hexpand">True</property>
<child>
<object class="GtkScrolledWindow" id="entity_button">
......@@ -347,6 +346,7 @@
<child>
<object class="GtkGrid">
<property name="visible">True</property>
<property name="halign">center</property>
<property name="can_focus">False</property>
<child>
<object class="GtkLabel" id="entity">
......@@ -354,9 +354,12 @@
<property name="can_focus">False</property>
<property name="valign">end</property>
<property name="hexpand">True</property>
<property name="halign">center</property>
<property name="vexpand">True</property>
<property name="label" translatable="yes">entity</property>
<property name="justify">center</property>
<property name="wrap">True</property>
<property name="wrap_mode">word-char</property>
<property name="ellipsize">middle</property>
<attributes>
<attribute name="font-desc" value="Cantarell Bold 10"/>
......@@ -449,61 +452,85 @@
</packing>
</child>
<child>
<object class="GtkBox">
<object class="HdyLeaflet" id="entity_buttons_end_leaflet">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">horizontal</property>
<property name="visible_child">entity_buttons_end_box</property>
<property name="mode_transition_type">slide</property>
<property name="child_transition_type">slide</property>
<property name="interpolate_size">False</property>
<child>
<object class="GtkButton" id="entity_discussion_open_external">
<object class="GtkBox" id="entity_buttons_end_box">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">discussion-page-icon</property>
<property name="always_show_image">True</property>
<property name="tooltip_text" translatable="yes">Open talk page in the browser</property>
<signal name="clicked" handler="entity_discussion_open_external_clicked_cb" swapped="no"/>
<property name="can_focus">False</property>
<property name="orientation">horizontal</property>
<child>
<object class="HdyLeaflet" id="entity_buttons_end_group_leaflet">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="visible_child">entity_discussion_open_external</property>
<property name="mode_transition_type">slide</property>
<property name="child_transition_type">slide</property>
<property name="interpolate_size">False</property>
<style>
<class name="linked"/>
</style>
<child>
<object class="GtkButton" id="entity_history_open_external">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">history-page-icon</property>
<property name="always_show_image">True</property>
<property name="tooltip_text" translatable="yes">Open history in the browser</property>
</object>
<packing>
<property name="pack_type">start</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="entity_discussion_open_external">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">discussion-page-icon</property>
<property name="always_show_image">True</property>
<property name="tooltip_text" translatable="yes">Open talk page in the browser</property>
<signal name="clicked" handler="entity_discussion_open_external_clicked_cb" swapped="no"/>
</object>
<packing>
<property name="pack_type">start</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="pack_type">end</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="pack_type">start</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="entity_history_open_external">
<object class="GtkButton" id="entity_menu">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">history-page-icon</property>
<property name="always_show_image">True</property>
<property name="tooltip_text" translatable="yes">Open history in the browser</property>
<property name="image">entity-menu-icon</property>
<signal name="clicked" handler="entity_menu_clicked_cb" swapped="no"/>
</object>
<packing>
<property name="pack_type">start</property>
<property name="position">1</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
<style>
<class name="linked"/>
</style>
</object>
<packing>
<property name="pack_type">end</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="entity_menu">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">entity-menu-icon</property>
<signal name="clicked" handler="entity_menu_clicked_cb" swapped="no"/>
</object>
<packing>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="name">sub_header_bar</property>
......
......@@ -6,7 +6,6 @@
<template class="Entity" parent="GtkStack">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child>
<object class="GtkGrid" id="view">
......@@ -14,25 +13,6 @@
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child>
<object class="GtkLabel" id="unit">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="halign">start</property>
<property name="margin_left">4</property>
<property name="margin_start">4</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="label" translatable="yes">unit</property>
<style>
<class name="dim-label"/>
</style>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkEventBox" id="value_eventbox">
<property name="visible">True</property>
......@@ -46,7 +26,11 @@
<property name="vexpand">True</property>
<property name="label" translatable="yes">Label</property>
<property name="wrap">True</property>
<property name="wrap_mode">char</property>
<property name="xalign">0</property>
<attributes>
<attribute name="font-desc" value="Cantarell 9"/>
</attributes>
</object>
</child>
</object>
......@@ -55,6 +39,28 @@
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="unit">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="halign">start</property>
<property name="margin_left">4</property>
<property name="margin_start">4</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="label" translatable="yes">unit</property>
<attributes>
<attribute name="font-desc" value="Cantarell 8"/>
</attributes>
<style>
<class name="dim-label"/>
</style>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
</object>
<packing>
<property name="name">view</property>
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.0 -->
<!-- Generated with glade 3.22.1 -->
<interface>
<requires lib="gtk+" version="3.22"/>
<requires lib="libhandy" version="0.0"/>
......@@ -38,8 +38,6 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">start</property>
<property name="margin_start">12</property>
<property name="margin_end">12</property>
<property name="margin_top">18</property>
<property name="margin_bottom">18</property>
<property name="vexpand">False</property>
......@@ -81,7 +79,6 @@
<property name="vexpand">True</property>
<property name="orientation">vertical</property>
<property name="row_spacing">18</property>
<property name="column_homogeneous">True</property>
<child>
<placeholder/>
</child>
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.0 -->
<!-- Generated with glade 3.22.1 -->
<interface>
<requires lib="gtk+" version="3.22"/>
<!-- interface-css-provider-path property.css -->
......@@ -18,10 +18,11 @@
<property name="can_focus">False</property>
<property name="margin_start">3</property>
<property name="margin_end">3</property>
<property name="hexpand">False</property>
<property name="vexpand">True</property>
<property name="label" translatable="yes">Property</property>
<property name="justify">right</property>
<property name="wrap">True</property>
<property name="wrap_mode">word-char</property>
<property name="xalign">1</property>
<attributes>
<attribute name="font-desc" value="Cantarell Bold 10"/>
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.0 -->
<!-- Generated with glade 3.22.1 -->
<interface>
<requires lib="gtk+" version="3.22"/>
<template class="QualifierProperty" parent="GtkEventBox">
......@@ -16,6 +16,7 @@
<property name="label" translatable="yes">Label</property>
<property name="justify">right</property>
<property name="wrap">True</property>
<property name="wrap_mode">char</property>
<property name="xalign">1</property>
<attributes>
<attribute name="font-desc" value="Cantarell Bold 8"/>
......
......@@ -26,4 +26,5 @@
border-bottom-left-radius: 0px;
border-left-width:0px;
padding:0px;
font:
}
......@@ -2,11 +2,6 @@
<!-- Generated with glade 3.22.1 -->
<interface>
<requires lib="gtk+" version="3.22"/>
<object class="GtkImage" id="icon1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">pan-end-symbolic</property>
</object>
<template class="Value" parent="GtkGrid">
<property name="visible">True</property>
<property name="can_focus">False</property>
......@@ -18,7 +13,6 @@
<property name="hexpand">True</property>
<property name="row_spacing">3</property>
<property name="column_spacing">8</property>
<property name="column_homogeneous">True</property>