-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Improved Python bindings #3829
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
68a00c4
WIP: update interface file
ahankinson 9d3c682
Fixed: Typo
ahankinson e821671
New: Enable "fastdeps" in SWIG
ahankinson 2d90bda
New: Type hints for Verovio
ahankinson 442ed3e
Fixed: Modify the SWIG bindings
ahankinson 3d69d1f
Correct type annotation
ahankinson d1fcace
Update setup.py for new swig options
ahankinson 4be3859
Remove obsolete c_wrapper
ahankinson 4068b7d
Add py.typed to setup.py
ahankinson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
# This file was generated by mypy stubgen and then hand-edited | ||
# to match the contents of verovio.py. It should be kept up-to-date | ||
# when methods are added to the toolkit. | ||
|
||
from typing import Any | ||
|
||
class _SwigNonDynamicMeta(type): | ||
def __setattr__(self, name: str, value: Any, /) -> None: ... | ||
|
||
class toolkit: | ||
thisown: toolkit | ||
def __init__(self, initFont: bool = True) -> None: ... | ||
__swig_destroy__: None | ||
def getID(self) -> str: ... | ||
def getResourcePath(self) -> str: ... | ||
def setResourcePath(self, path: str) -> None: ... | ||
def getLog(self) -> str: ... | ||
def getVersion(self) -> str: ... | ||
def resetXmlIdSeed(self, seed: int) -> None: ... | ||
def loadFile(self, filename: str) -> bool: ... | ||
def loadData(self, data: str) -> bool: ... | ||
def loadZipDataBase64(self, data: str) -> bool: ... | ||
def loadZipDataBuffer(self, data: bytes, length: int) -> bool: ... | ||
def validatePAEFile(self, filename: str) -> dict: ... | ||
def validatePAE(self, data: str | dict) -> dict: ... | ||
def getPageCount(self) -> int: ... | ||
def getOptions(self) -> dict: ... | ||
def getDefaultOptions(self) -> dict: ... | ||
def getAvailableOptions(self) -> dict: ... | ||
def setOptions(self, json_options: dict) -> bool: ... | ||
def resetOptions(self) -> None: ... | ||
def getOptionUsageString(self) -> str: ... | ||
def setScale(self, scale: int) -> bool: ... | ||
def getScale(self) -> int: ... | ||
def setOutputTo(self, outputTo: str) -> bool: ... | ||
def select(self, selection: dict) -> bool: ... | ||
def edit(self, editor_action: dict) -> bool: ... | ||
def editInfo(self) -> dict: ... | ||
def renderData(self, data: str, options: dict) -> str: ... | ||
def renderToSVG(self, pageNo: int = 1, xmlDeclaration: bool = False) -> str: ... | ||
def renderToSVGFile(self, filename, pageNo: int = 1) -> bool: ... | ||
def renderToMIDI(self) -> str: ... | ||
def renderToMIDIFile(self, filename: str) -> bool: ... | ||
def renderToPAE(self) -> str: ... | ||
def renderToPAEFile(self, filename: str) -> bool: ... | ||
def renderToTimemap(self, options: dict | None = None) -> list: ... | ||
def renderToExpansionMap(self) -> list: ... | ||
def renderToTimemapFile(self, filename: str, options: dict | None = None) -> bool: ... | ||
def renderToExpansionMapFile(self, filename: str) -> bool: ... | ||
def convertMEIToHumdrum(self, meiData: str) -> str: ... | ||
def convertHumdrumToHumdrum(self, humdrumData: str) -> str: ... | ||
def convertHumdrumToMIDI(self, humdrumData: str) -> str: ... | ||
def getHumdrumFile(self, filename: str) -> bool: ... | ||
def getMEI(self, options: dict | None = None) -> str: ... | ||
def saveFile(self, filename: str, options: dict | None = None) -> bool: ... | ||
def getDescriptiveFeatures(self, options: dict | None = None) -> dict: ... | ||
def getElementsAtTime(self, millisec: int) -> dict: ... | ||
def getPageWithElement(self, xmlId: str) -> int: ... | ||
def getElementAttr(self, xmlId: str) -> dict: ... | ||
def getNotatedIdForElement(self, xmlId: str) -> str: ... | ||
def getExpansionIdsForElement(self, xmlId: str) -> dict: ... | ||
def getTimeForElement(self, xmlId: str) -> int: ... | ||
def getMIDIValuesForElement(self, xmlId: str) -> dict: ... | ||
def getTimesForElement(self, xmlId: str) -> dict: ... | ||
def redoLayout(self, options: dict | None = None) -> None: ... | ||
def redoPagePitchPosLayout(self) -> None: ... | ||
def setHumdrumBuffer(self, contents: bytes) -> None: ... | ||
def getHumdrumBuffer(self) -> bytes: ... | ||
def clearHumdrumBuffer(self) -> None: ... | ||
def setInputFrom(self, format: str) -> bool: ... | ||
def getInputFrom(self) -> int: ... | ||
def getOutputTo(self) -> int: ... | ||
def setLocale(self) -> None: ... | ||
def resetLocale(self) -> None: ... | ||
def initClock(self) -> None: ... | ||
def resetClock(self) -> None: ... | ||
def getRuntimeInSeconds(self) -> float: ... | ||
def logRuntime(self) -> None: ... | ||
|
||
UNKNOWN: int | ||
AUTO: int | ||
MEI: int | ||
HUMDRUM: int | ||
HUMMEI: int | ||
HUMMIDI: int | ||
PAE: int | ||
ABC: int | ||
DARMS: int | ||
VOLPIANO: int | ||
MUSICXML: int | ||
MUSICXMLHUM: int | ||
MEIHUM: int | ||
MUSEDATAHUM: int | ||
ESAC: int | ||
MIDI: int | ||
TIMEMAP: int | ||
EXPANSIONMAP: int | ||
LOG_OFF: int | ||
LOG_ERROR: int | ||
LOG_WARNING: int | ||
LOG_INFO: int | ||
LOG_DEBUG: int | ||
|
||
def setDefaultResourcePath(path: str) -> None: ... | ||
def enableLog(level: int) -> None: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any particular logic to the order? Alphabetical sorting would make hand-editing much easier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's the order that's in toolkit.h, which is in semi-alphabetical order.
But the ones at the end are kinda questionable, since these are annotated with
@nodocs
and don't appear in the Verovio book, so they're not technically "public."