Compare commits
6 Commits
lyrics-mod
...
master
Author | SHA1 | Date | |
---|---|---|---|
db02122cf4 | |||
254c03689d | |||
9de15f7a47 | |||
f85b2dc5ce | |||
0d2010d05f | |||
54e0af1915 |
48
setup.cfg
48
setup.cfg
@ -1,3 +1,51 @@
|
|||||||
|
[metadata]
|
||||||
|
name = ukatali
|
||||||
|
author = Raoul Snyman
|
||||||
|
author_email = raoul@snyman.info
|
||||||
|
description = A ChordPro GUI, written in Python and Qt5
|
||||||
|
long_description = file:README.rst
|
||||||
|
long_description_content_type = text/x-rst
|
||||||
|
url = https://git.snyman.info/raoul/ukatali
|
||||||
|
license = MIT
|
||||||
|
classifiers =
|
||||||
|
Development Status :: 3 - Alpha
|
||||||
|
Intended Audience :: End Users/Desktop
|
||||||
|
License :: OSI Approved :: MIT License
|
||||||
|
Operating System :: POSIX
|
||||||
|
Programming Language :: Python :: 3
|
||||||
|
Programming Language :: Python :: 3.7
|
||||||
|
Programming Language :: Python :: 3.8
|
||||||
|
Programming Language :: Python :: 3.9
|
||||||
|
Programming Language :: Python :: 3.10
|
||||||
|
Topic :: Utilities
|
||||||
|
keywords =
|
||||||
|
music
|
||||||
|
chords
|
||||||
|
guitar
|
||||||
|
|
||||||
|
[options]
|
||||||
|
package_dir =
|
||||||
|
= src
|
||||||
|
packages = find:
|
||||||
|
python_requires = >=3.7
|
||||||
|
setup_requires =
|
||||||
|
setuptools_scm
|
||||||
|
install_requires =
|
||||||
|
igitar
|
||||||
|
PyQt5
|
||||||
|
PyQtWebEngine
|
||||||
|
QScintilla
|
||||||
|
|
||||||
|
[options.packages.find]
|
||||||
|
where = src
|
||||||
|
|
||||||
|
[options.entry_points]
|
||||||
|
console_scripts =
|
||||||
|
ukatali = ukatali.app:run_ukutali
|
||||||
|
|
||||||
|
[bdist_wheel]
|
||||||
|
universal = 1
|
||||||
|
|
||||||
[pep8]
|
[pep8]
|
||||||
exclude=resources.py,vlc.py
|
exclude=resources.py,vlc.py
|
||||||
max-line-length = 120
|
max-line-length = 120
|
||||||
|
2
setup.py
Normal file
2
setup.py
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
from setuptools import setup
|
||||||
|
setup(use_scm_version=True, setup_requires=['setuptools_scm'])
|
@ -2,7 +2,7 @@
|
|||||||
from functools import partial
|
from functools import partial
|
||||||
|
|
||||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||||
from chordpro.renderers.html import get_options, get_option_groups
|
from igitar.renderers.html import get_options, get_option_groups
|
||||||
|
|
||||||
from ukatali.util import coerce_bool, convert_units
|
from ukatali.util import coerce_bool, convert_units
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
from PyQt5 import QtCore, QtGui, QtWidgets, Qsci
|
from PyQt5 import QtCore, QtGui, QtWidgets, Qsci
|
||||||
from chordpro.constants import KNOWN_DIRECTIVES, KNOWN_VERSE_TYPES
|
from igitar.constants import KNOWN_DIRECTIVES, KNOWN_VERSE_TYPES
|
||||||
|
|
||||||
PALETTE_ROLES = {
|
PALETTE_ROLES = {
|
||||||
'window': QtGui.QPalette.WindowText,
|
'window': QtGui.QPalette.WindowText,
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from PyQt5 import QtCore, QtGui, QtWidgets, QtWebEngineWidgets, Qsci, QtPrintSupport
|
from PyQt5 import QtCore, QtGui, QtWidgets, QtWebEngineWidgets, Qsci, QtPrintSupport
|
||||||
from chordpro import Song
|
from igitar import Song
|
||||||
from chordpro.renderers.html import render, get_options
|
from igitar.renderers.html import render, get_options
|
||||||
|
|
||||||
from ukatali.configuredialog import ConfigureDialog
|
from ukatali.configuredialog import ConfigureDialog
|
||||||
from ukatali.lexer import ChordProLexer
|
from ukatali.lexer import ChordProLexer
|
||||||
@ -345,14 +345,17 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
options = self._get_render_options(self.is_lyrics_mode)
|
options = self._get_render_options(self.is_lyrics_mode)
|
||||||
text = self.file_editor.text()
|
text = self.file_editor.text()
|
||||||
song = Song()
|
song = Song()
|
||||||
song.parse(text)
|
try:
|
||||||
return render(song, options, extra_styles)
|
song.parse(text)
|
||||||
|
return render(song, options, extra_styles)
|
||||||
|
except Exception:
|
||||||
|
return None
|
||||||
|
|
||||||
def on_text_changed(self):
|
def on_text_changed(self):
|
||||||
"""Update the preview when the text changes"""
|
"""Update the preview when the text changes"""
|
||||||
# self.setWindowModified(True)
|
|
||||||
html = self._render_song()
|
html = self._render_song()
|
||||||
self.preview_view.setHtml(html)
|
if html:
|
||||||
|
self.preview_view.setHtml(html)
|
||||||
|
|
||||||
def on_export_pdf_clicked(self):
|
def on_export_pdf_clicked(self):
|
||||||
"""Export the current song to PDF"""
|
"""Export the current song to PDF"""
|
||||||
@ -380,7 +383,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
margin_top = float(self.settings.value('margin_top', 20))
|
margin_top = float(self.settings.value('margin_top', 20))
|
||||||
margin_bottom = float(self.settings.value('margin_bottom', 20))
|
margin_bottom = float(self.settings.value('margin_bottom', 20))
|
||||||
self.settings.endGroup()
|
self.settings.endGroup()
|
||||||
margins = QtCore.QMarginsF(QtCore.QMargins(margin_left, margin_top, margin_right, margin_bottom))
|
margins = QtCore.QMarginsF(margin_left, margin_top, margin_right, margin_bottom)
|
||||||
page_layout = QtGui.QPageLayout(page_size, orientation, margins, unit)
|
page_layout = QtGui.QPageLayout(page_size, orientation, margins, unit)
|
||||||
# Export to PDF
|
# Export to PDF
|
||||||
self.preview_view.page().printToPdf(str(filename), page_layout)
|
self.preview_view.page().printToPdf(str(filename), page_layout)
|
||||||
@ -404,9 +407,14 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
# Export to HTML
|
# Export to HTML
|
||||||
try:
|
try:
|
||||||
with filename.open('w') as html_file:
|
with filename.open('w') as html_file:
|
||||||
html_file.write(self._render_song())
|
html = self._render_song()
|
||||||
QtWidgets.QMessageBox.information(self, 'Export to HTML Successful',
|
if html:
|
||||||
'Successfully exported to "{}"'.format(filename.name))
|
html_file.write(html)
|
||||||
|
QtWidgets.QMessageBox.information(self, 'Export to HTML Successful',
|
||||||
|
'Successfully exported to "{}"'.format(filename.name))
|
||||||
|
else:
|
||||||
|
QtWidgets.QMessageBox.critical(self, 'Error Exporting to HTML',
|
||||||
|
'There was an error while exporting to HTML')
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
QtWidgets.QMessageBox.critical(self, 'Error Exporting to HTML',
|
QtWidgets.QMessageBox.critical(self, 'Error Exporting to HTML',
|
||||||
'There was an error while exporting to HTML:\n{e}'.format(e=e))
|
'There was an error while exporting to HTML:\n{e}'.format(e=e))
|
||||||
|
Loading…
Reference in New Issue
Block a user