diff --git a/testbed/RDFLib__rdflib/.coveragerc b/testbed/RDFLib__rdflib/.coveragerc new file mode 100644 index 0000000000000000000000000000000000000000..c68b13265dece848b5ba0faa8770d95811c7aede --- /dev/null +++ b/testbed/RDFLib__rdflib/.coveragerc @@ -0,0 +1,36 @@ +# .coveragerc to control coverage.py +[run] +branch = True +#source = rdflib,build/src/rdflib # specified in .travis.yml for different envs +omit = */site-packages/* + +[report] +# Regexes for lines to exclude from consideration +exclude_lines = + # Have to re-enable the standard pragma + pragma: no cover + + # Don't complain about missing debug-only code: + #def __repr__ + #if self\.debug + + # Don't complain if tests don't hit defensive assertion code: + #raise AssertionError + #raise NotImplementedError + + # Don't complain if non-runnable code isn't run: + if 0: + if __name__ == .__main__.: + if __name__==.__main__.: + +# path mappings for the py3 environments (doesn't seem to work on coveralls yet) +[paths] +source = + rdflib/ + build/src/rdflib/ +tests = + test/ + build/src/test/ +examples = + examples/ + build/src/examples/ diff --git a/testbed/RDFLib__rdflib/.gitignore b/testbed/RDFLib__rdflib/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..17184737e7708c9c79d07324fa3722c48b09c98e --- /dev/null +++ b/testbed/RDFLib__rdflib/.gitignore @@ -0,0 +1,19 @@ +RDFLib.sublime-project +/docs/_build/ +nosetests.xml +RDFLib.sublime-workspace +*.egg-info/ +coverage/ +dist/ +__pycache__/ +*.pyc +/.hgtags +/.hgignore +build/ +/.coverage +/.tox/ +/docs/draft/ +*~ +test_reports/*latest.ttl +# PyCharm +.idea/ \ No newline at end of file diff --git a/testbed/RDFLib__rdflib/.pep8 b/testbed/RDFLib__rdflib/.pep8 new file mode 100644 index 0000000000000000000000000000000000000000..acc7b2d3445619ed21c00f62d9f869d29657b9ff --- /dev/null +++ b/testbed/RDFLib__rdflib/.pep8 @@ -0,0 +1,4 @@ +[pep8] +ignore = W806 +max-line-length = 85 +exclude = host,extras,transform,rdfs diff --git a/testbed/RDFLib__rdflib/.travis.fuseki_install_optional.sh b/testbed/RDFLib__rdflib/.travis.fuseki_install_optional.sh new file mode 100644 index 0000000000000000000000000000000000000000..49e91f2c10663944f4286e1914d5cf55896c8a49 --- /dev/null +++ b/testbed/RDFLib__rdflib/.travis.fuseki_install_optional.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +set -v + +uri="http://archive.apache.org/dist/jena/binaries/apache-jena-fuseki-2.4.0.tar.gz" + +if wget "$uri" && + tar -zxf *jena*fuseki*.tar.gz && + mv *jena*fuseki*/ fuseki && + cd fuseki ; then + # normal SPARQLStore & Dataset tests: + bash fuseki-server --port 3030 --debug --update --mem /db &>fuseki.log & + # SPARQLUpdateStore tests & ConjunctiveGraph endpoint behavior: + bash fuseki-server --port 3031 --debug --update --memTDB --set tdb:unionDefaultGraph=true /db &>fuseki.log & + sleep 2 + cd .. +else + echo "fuseki install failed, skipping... please check URI" >&2 +fi diff --git a/testbed/RDFLib__rdflib/.travis.yml b/testbed/RDFLib__rdflib/.travis.yml new file mode 100644 index 0000000000000000000000000000000000000000..f37f0750d5c5ec2ce18835ba4155bb179e18ad28 --- /dev/null +++ b/testbed/RDFLib__rdflib/.travis.yml @@ -0,0 +1,44 @@ +# http://travis-ci.org/#!/RDFLib/rdflib +sudo: false +language: python +branches: + only: + # only build master and release branches (merge request are built anyhow) + - master + - /^\d+\.\d+\.\d+(-.*)?$/ +git: + depth: 3 + +python: + - 2.7 + - 3.4 + - 3.5 + - 3.6 + +matrix: + include: + - python: 3.7 + dist: xenial + sudo: true + +before_install: + - pip install -U setuptools pip # seems travis comes with a too old setuptools for html5lib + - bash .travis.fuseki_install_optional.sh + +install: + - pip install --default-timeout 60 -r requirements.txt + - pip install --default-timeout 60 coverage coveralls nose-timer && export HAS_COVERALLS=1 + - python setup.py install + +before_script: + - flake8 --exclude=pyRdfa,extras,host,transform,rdfs,sparql,results,pyMicrodata --exit-zero rdflib + +script: + - PYTHONWARNINGS=default nosetests --with-timer --timer-top-n 42 --with-coverage --cover-tests --cover-package=rdflib + +after_success: + - if [[ $HAS_COVERALLS ]] ; then coveralls ; fi + +notifications: + irc: + channels: "chat.freenode.net#rdflib" diff --git a/testbed/RDFLib__rdflib/CHANGELOG.md b/testbed/RDFLib__rdflib/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..06cdada724b83dc2221dfcc6a39931e1f70602dc --- /dev/null +++ b/testbed/RDFLib__rdflib/CHANGELOG.md @@ -0,0 +1,1724 @@ +2017/01/29 RELEASE 4.2.2 +======================== + +This is a bug-fix release, and the last release in the 4.X.X series. + +Bug fixes: +---------- +* SPARQL bugs fixed: + * Fix for filters in sub-queries + [#693](https://github.com/RDFLib/rdflib/pull/693) + * Fixed bind, initBindings and filter problems + [#294](https://github.com/RDFLib/rdflib/issues/294) + [#555](https://github.com/RDFLib/rdflib/pull/555) + [#580](https://github.com/RDFLib/rdflib/issues/580) + [#586](https://github.com/RDFLib/rdflib/issues/586) + [#601](https://github.com/RDFLib/rdflib/pull/601) + [#615](https://github.com/RDFLib/rdflib/issues/615) + [#617](https://github.com/RDFLib/rdflib/issues/617) + [#619](https://github.com/RDFLib/rdflib/issues/619) + [#630](https://github.com/RDFLib/rdflib/issues/630) + [#653](https://github.com/RDFLib/rdflib/issues/653) + [#686](https://github.com/RDFLib/rdflib/issues/686) + [#688](https://github.com/RDFLib/rdflib/pull/688) + [#692](https://github.com/RDFLib/rdflib/pull/692) + * Fixed unexpected None value in SPARQL-update + [#633](https://github.com/RDFLib/rdflib/issues/633) + [#634](https://github.com/RDFLib/rdflib/pull/634) + * Fix sparql, group by and count of null values with `optional` + [#631](https://github.com/RDFLib/rdflib/issues/631) + * Fixed sparql sub-query and aggregation bugs + [#607](https://github.com/RDFLib/rdflib/issues/607) + [#610](https://github.com/RDFLib/rdflib/pull/610) + [#628](https://github.com/RDFLib/rdflib/issues/628) + [#694](https://github.com/RDFLib/rdflib/pull/694) + * Fixed parsing Complex BGPs as triples + [#622](https://github.com/RDFLib/rdflib/pull/622) + [#623](https://github.com/RDFLib/rdflib/issues/623) + * Fixed DISTINCT being ignored inside aggregate functions + [#404](https://github.com/RDFLib/rdflib/issues/404) + [#611](https://github.com/RDFLib/rdflib/pull/611) + [#678](https://github.com/RDFLib/rdflib/pull/678) + * Fix unicode encoding errors in sparql processor + [#446](https://github.com/RDFLib/rdflib/issues/446) + [#599](https://github.com/RDFLib/rdflib/pull/599) + * Fixed SPARQL select nothing no longer returning a `None` row + [#554](https://github.com/RDFLib/rdflib/issues/554) + [#592](https://github.com/RDFLib/rdflib/pull/592) + * Fixed aggregate operators COUNT and SAMPLE to ignore unbound / NULL values + [#564](https://github.com/RDFLib/rdflib/pull/564) + [#563](https://github.com/RDFLib/rdflib/issues/563) + [#567](https://github.com/RDFLib/rdflib/pull/567) + [#568](https://github.com/RDFLib/rdflib/pull/568) + * Fix sparql relative uris + [#523](https://github.com/RDFLib/rdflib/issues/523) + [#524](https://github.com/RDFLib/rdflib/pull/524) + * SPARQL can now compare xsd:date type as well, fixes #532 + [#532](https://github.com/RDFLib/rdflib/issues/532) + [#533](https://github.com/RDFLib/rdflib/pull/533) + * fix sparql path order on python3: "TypeError: unorderable types: SequencePath() < SequencePath()"" + [#492](https://github.com/RDFLib/rdflib/issues/492) + [#525](https://github.com/RDFLib/rdflib/pull/525) + * SPARQL parser now robust to spurious semicolon + [#381](https://github.com/RDFLib/rdflib/issues/381) + [#528](https://github.com/RDFLib/rdflib/pull/528) + * Let paths be comparable against all nodes even in py3 (preparedQuery error) + [#545](https://github.com/RDFLib/rdflib/issues/545) + [#552](https://github.com/RDFLib/rdflib/pull/552) + * Made behavior of `initN` in `update` and `query` more consistent + [#579](https://github.com/RDFLib/rdflib/issues/579) + [#600](https://github.com/RDFLib/rdflib/pull/600) +* SparqlStore: + * SparqlStore now closes underlying urllib response body + [#638](https://github.com/RDFLib/rdflib/pull/638) + [#683](https://github.com/RDFLib/rdflib/pull/683) + * SparqlStore injectPrefixes only modifies query if prefixes present and if adds a newline in between + [#521](https://github.com/RDFLib/rdflib/issues/521) + [#522](https://github.com/RDFLib/rdflib/pull/522) +* Fixes and tests for AuditableStore + [#537](https://github.com/RDFLib/rdflib/pull/537) + [#557](https://github.com/RDFLib/rdflib/pull/557) +* Trig bugs fixed: + * trig export of multiple graphs assigns wrong prefixes to prefixedNames + [#679](https://github.com/RDFLib/rdflib/issues/679) + * Trig serialiser writing empty named graph name for default graph + [#433](https://github.com/RDFLib/rdflib/issues/433) + * Trig parser can creating multiple contexts for the default graph + [#432](https://github.com/RDFLib/rdflib/issues/432) + * Trig serialisation handling prefixes incorrectly + [#428](https://github.com/RDFLib/rdflib/issues/428) + [#699](https://github.com/RDFLib/rdflib/pull/699) +* Fixed Nquads parser handling of triples in default graph + [#535](https://github.com/RDFLib/rdflib/issues/535) + [#536](https://github.com/RDFLib/rdflib/pull/536) +* Fixed TypeError in Turtle serializer (unorderable types: DocumentFragment() > DocumentFragment()) + [#613](https://github.com/RDFLib/rdflib/issues/613) + [#648](https://github.com/RDFLib/rdflib/issues/648) + [#666](https://github.com/RDFLib/rdflib/pull/666) + [#676](https://github.com/RDFLib/rdflib/issues/676) +* Fixed serialization and parsing of inf/nan + [#655](https://github.com/RDFLib/rdflib/pull/655) + [#658](https://github.com/RDFLib/rdflib/pull/658) +* Fixed RDFa parser from failing on time elements with child nodes + [#576](https://github.com/RDFLib/rdflib/issues/576) + [#577](https://github.com/RDFLib/rdflib/pull/577) +* Fix double reduction of \\ escapes in from_n3 + [#546](https://github.com/RDFLib/rdflib/issues/546) + [#548](https://github.com/RDFLib/rdflib/pull/548) +* Fixed handling of xsd:base64Binary + [#646](https://github.com/RDFLib/rdflib/issues/646) + [#674](https://github.com/RDFLib/rdflib/pull/674) +* Fixed Collection.__setitem__ broken + [#604](https://github.com/RDFLib/rdflib/issues/604) + [#605](https://github.com/RDFLib/rdflib/pull/605) +* Fix ImportError when __main__ already loaded + [#616](https://github.com/RDFLib/rdflib/pull/616) +* Fixed broken top_level.txt file in distribution + [#571](https://github.com/RDFLib/rdflib/issues/571) + [#572](https://github.com/RDFLib/rdflib/pull/572) + [#573](https://github.com/RDFLib/rdflib/pull/573) + + +Enhancements: +------------- +* Added support for Python 3.5+ + [#526](https://github.com/RDFLib/rdflib/pull/526) +* More aliases for common formats (nt, turtle) + [#701](https://github.com/RDFLib/rdflib/pull/701) +* Improved RDF1.1 ntriples support + [#695](https://github.com/RDFLib/rdflib/issues/695) + [#700](https://github.com/RDFLib/rdflib/pull/700) +* Dependencies updated and improved compatibility with pyparsing, html5lib, SPARQLWrapper and elementtree + [#550](https://github.com/RDFLib/rdflib/pull/550) + [#589](https://github.com/RDFLib/rdflib/issues/589) + [#606](https://github.com/RDFLib/rdflib/issues/606) + [#641](https://github.com/RDFLib/rdflib/pull/641) + [#642](https://github.com/RDFLib/rdflib/issues/642) + [#650](https://github.com/RDFLib/rdflib/pull/650) + [#671](https://github.com/RDFLib/rdflib/issues/671) + [#675](https://github.com/RDFLib/rdflib/pull/675) + [#684](https://github.com/RDFLib/rdflib/pull/684) + [#696](https://github.com/RDFLib/rdflib/pull/696) +* Improved prefix for SPARQL namespace in XML serialization + [#493](https://github.com/RDFLib/rdflib/issues/493) + [#588](https://github.com/RDFLib/rdflib/pull/588) +* Performance improvements: + * SPARQL Aggregation functions don't build up memory for each row + [#678](https://github.com/RDFLib/rdflib/pull/678) + * Collections now support += (__iadd__), fixes slow creation of large lists + [#609](https://github.com/RDFLib/rdflib/issues/609) + [#612](https://github.com/RDFLib/rdflib/pull/612) + [#691](https://github.com/RDFLib/rdflib/pull/691) + * SPARQL Optimisation to expand BGPs in a smarter way + [#547](https://github.com/RDFLib/rdflib/pull/547) +* SPARQLStore improvements + * improved SPARQLStore BNode customizability + [#511](https://github.com/RDFLib/rdflib/issues/511) + [#512](https://github.com/RDFLib/rdflib/pull/512) + [#513](https://github.com/RDFLib/rdflib/pull/513) + [#603](https://github.com/RDFLib/rdflib/pull/603) + * Adding the option of using POST for long queries in SPARQLStore + [#672](https://github.com/RDFLib/rdflib/issues/672) + [#673](https://github.com/RDFLib/rdflib/pull/673) + * Exposed the timeout of SPARQLWrapper + [#531](https://github.com/RDFLib/rdflib/pull/531) +* SPARQL prepared query now carries the original (unparsed) parameters + [#565](https://github.com/RDFLib/rdflib/pull/565) +* added .n3 methods for path objects + [#553](https://github.com/RDFLib/rdflib/pull/553) +* Added support for xsd:gYear and xsd:gYearMonth + [#635](https://github.com/RDFLib/rdflib/issues/635) + [#636](https://github.com/RDFLib/rdflib/pull/636) +* Allow duplicates in rdf:List + [#223](https://github.com/RDFLib/rdflib/issues/223) + [#690](https://github.com/RDFLib/rdflib/pull/690) +* Improved slicing of Resource objects + [#529](https://github.com/RDFLib/rdflib/pull/529) + + +Cleanups: +--------- +* cleanup: SPARQL Prologue and Query new style classes + [#566](https://github.com/RDFLib/rdflib/pull/566) +* Reduce amount of warnings, especially closing opened file pointers + [#518](https://github.com/RDFLib/rdflib/pull/518) + [#651](https://github.com/RDFLib/rdflib/issues/651) +* Improved ntriples parsing exceptions to actually tell you what's wrong + [#640](https://github.com/RDFLib/rdflib/pull/640) + [#643](https://github.com/RDFLib/rdflib/pull/643) +* remove ancient and broken 2.3 support code. + [#680](https://github.com/RDFLib/rdflib/issues/680) + [#681](https://github.com/RDFLib/rdflib/pull/681) +* Logger output improved + [#662](https://github.com/RDFLib/rdflib/pull/662) +* properly cite RGDA1 + [#624](https://github.com/RDFLib/rdflib/pull/624) +* Avoid class reference to imported function + [#574](https://github.com/RDFLib/rdflib/issues/574) + [#578](https://github.com/RDFLib/rdflib/pull/578) +* Use find_packages for package discovery. + [#590](https://github.com/RDFLib/rdflib/pull/590) +* Prepared ClosedNamespace (and _RDFNamespace) to inherit from Namespace (5.0.0) + [#551](https://github.com/RDFLib/rdflib/pull/551) + [#595](https://github.com/RDFLib/rdflib/pull/595) +* Avoid verbose build logging + [#534](https://github.com/RDFLib/rdflib/pull/534) +* (ultra petty) Remove an unused import + [#593](https://github.com/RDFLib/rdflib/pull/593) + + +Testing improvements: +--------------------- +* updating deprecated testing syntax + [#697](https://github.com/RDFLib/rdflib/pull/697) +* make test 375 more portable (use sys.executable rather than python) + [#664](https://github.com/RDFLib/rdflib/issues/664) + [#668](https://github.com/RDFLib/rdflib/pull/668) +* Removed outdated, skipped test for #130 that depended on content from the internet + [#256](https://github.com/RDFLib/rdflib/issues/256) +* enable all warnings during travis nosetests + [#517](https://github.com/RDFLib/rdflib/pull/517) +* travis updates + [#659](https://github.com/RDFLib/rdflib/issues/659) +* travis also builds release branches + [#598](https://github.com/RDFLib/rdflib/pull/598) + + +Doc improvements: +----------------- +* Update list of builtin serialisers in docstring + [#621](https://github.com/RDFLib/rdflib/pull/621) +* Update reference to "Emulating container types" + [#575](https://github.com/RDFLib/rdflib/issues/575) + [#581](https://github.com/RDFLib/rdflib/pull/581) + [#583](https://github.com/RDFLib/rdflib/pull/583) + [#584](https://github.com/RDFLib/rdflib/pull/584) +* docs: clarify the use of an identifier when persisting a triplestore + [#654](https://github.com/RDFLib/rdflib/pull/654) +* DOC: unamed -> unnamed, typos + [#562](https://github.com/RDFLib/rdflib/pull/562) + + + +2015/08/12 RELEASE 4.2.1 +======================== + +This is a bug-fix release. + +Minor enhancements: +------------------- +* Added a Networkx connector + [#471](https://github.com/RDFLib/rdflib/pull/471), + [#507](https://github.com/RDFLib/rdflib/pull/507) +* Added a graph_tool connector + [#473](https://github.com/RDFLib/rdflib/pull/473) +* Added a `graphs` method to the Dataset object + [#504](https://github.com/RDFLib/rdflib/pull/504), + [#495](https://github.com/RDFLib/rdflib/issues/495) +* Batch commits for `SPARQLUpdateStore` + [#486](https://github.com/RDFLib/rdflib/pull/486) + +Bug fixes: +---------- +* Fixed bnode collision bug + [#506](https://github.com/RDFLib/rdflib/pull/506), + [#496](https://github.com/RDFLib/rdflib/pull/496), + [#494](https://github.com/RDFLib/rdflib/issues/494) +* fix `util.from_n3()` parsing Literals with datatypes and Namespace support + [#503](https://github.com/RDFLib/rdflib/pull/503), + [#502](https://github.com/RDFLib/rdflib/issues/502) +* make `Identifier.__hash__` stable wrt. multi processes + [#501](https://github.com/RDFLib/rdflib/pull/501), + [#500](https://github.com/RDFLib/rdflib/issues/500) +* fix handling `URLInputSource` without content-type + [#499](https://github.com/RDFLib/rdflib/pull/499), + [#498](https://github.com/RDFLib/rdflib/pull/498) +* no relative import in `algebra` when run as a script + [#497](https://github.com/RDFLib/rdflib/pull/497) +* Duplicate option in armstrong `theme.conf` removed + [#491](https://github.com/RDFLib/rdflib/issues/491) +* `Variable.__repr__` returns a python representation string, not n3 + [#488](https://github.com/RDFLib/rdflib/pull/488) +* fixed broken example + [#482](https://github.com/RDFLib/rdflib/pull/482) +* trig output fixes + [#480](https://github.com/RDFLib/rdflib/pull/480) +* set PYTHONPATH to make rdfpipe tests use the right rdflib version + [#477](https://github.com/RDFLib/rdflib/pull/477) +* fix RDF/XML problem with unqualified use of `rdf:about` + [#470](https://github.com/RDFLib/rdflib/pull/470), + [#468](https://github.com/RDFLib/rdflib/issues/468) +* `AuditableStore` improvements + [#469](https://github.com/RDFLib/rdflib/pull/469), + [#463](https://github.com/RDFLib/rdflib/pull/463) +* added asserts for `graph.set([s,p,o])` so `s` and `p` aren't `None` + [#467](https://github.com/RDFLib/rdflib/pull/467) +* `threading.RLock` instances are context managers + [#465](https://github.com/RDFLib/rdflib/pull/465) +* SPARQLStore does not transform Literal('') into Literal('None') anymore + [#459](https://github.com/RDFLib/rdflib/pull/459), + [#457](https://github.com/RDFLib/rdflib/issues/457) +* slight performance increase for graph.all_nodes() + [#458](https://github.com/RDFLib/rdflib/pull/458) + +Testing improvements: +--------------------- +* travis: migrate to docker container infrastructure + [#508](https://github.com/RDFLib/rdflib/pull/508) +* test for narrow python builds (chars > 0xFFFF) (related to + [#453](https://github.com/RDFLib/rdflib/pull/453), + [#454](https://github.com/RDFLib/rdflib/pull/454) + ) + [#456](https://github.com/RDFLib/rdflib/issues/456), + [#509](https://github.com/RDFLib/rdflib/pull/509) +* dropped testing py3.2 + [#448](https://github.com/RDFLib/rdflib/issues/448) +* Running a local fuseki server on travis and making it failsafe + [#476](https://github.com/RDFLib/rdflib/pull/476), + [#475](https://github.com/RDFLib/rdflib/issues/475), + [#474](https://github.com/RDFLib/rdflib/pull/474), + [#466](https://github.com/RDFLib/rdflib/pull/466), + [#460](https://github.com/RDFLib/rdflib/issues/460) +* exclude `def main():` functions from test coverage analysis + [#472](https://github.com/RDFLib/rdflib/pull/472) + + +2015/02/19 RELEASE 4.2.0 +======================== + +This is a new minor version of RDFLib including a handful of new features: + +* Supporting N-Triples 1.1 syntax using UTF-8 encoding + [#447](https://github.com/RDFLib/rdflib/pull/447), + [#449](https://github.com/RDFLib/rdflib/pull/449), + [#400](https://github.com/RDFLib/rdflib/issues/400) +* Graph comparison now really works using RGDA1 (RDF Graph Digest Algorithm 1) + [#441](https://github.com/RDFLib/rdflib/pull/441) + [#385](https://github.com/RDFLib/rdflib/issues/385) +* More graceful degradation than simple crashing for unicode chars > 0xFFFF on + narrow python builds. Parsing such characters will now work, but issue a + UnicodeWarning. If you run `python -W all` you will already see a warning on + `import rdflib` will show a warning (ImportWarning). + [#453](https://github.com/RDFLib/rdflib/pull/453), + [#454](https://github.com/RDFLib/rdflib/pull/454) +* URLInputSource now supports json-ld + [#425](https://github.com/RDFLib/rdflib/pull/425) +* SPARQLStore is now graph aware + [#401](https://github.com/RDFLib/rdflib/pull/401), + [#402](https://github.com/RDFLib/rdflib/pull/402) +* SPARQLStore now uses SPARQLWrapper for updates + [#397](https://github.com/RDFLib/rdflib/pull/397) +* Certain logging output is immediately shown in interactive mode + [#414](https://github.com/RDFLib/rdflib/pull/414) +* Python 3.4 fully supported + [#418](https://github.com/RDFLib/rdflib/pull/418) + +Minor enhancements & bugs fixed: +-------------------------------- + +* Fixed double invocation of 2to3 + [#437](https://github.com/RDFLib/rdflib/pull/437) +* PyRDFa parser missing brackets + [#434](https://github.com/RDFLib/rdflib/pull/434) +* Correctly handle \uXXXX and \UXXXXXXXX escapes in n3 files + [#426](https://github.com/RDFLib/rdflib/pull/426) +* Logging cleanups and keeping it on stderr + [#420](https://github.com/RDFLib/rdflib/pull/420) + [#414](https://github.com/RDFLib/rdflib/pull/414) + [#413](https://github.com/RDFLib/rdflib/issues/413) +* n3: allow @base URI to have a trailing '#' + [#407](https://github.com/RDFLib/rdflib/pull/407) + [#379](https://github.com/RDFLib/rdflib/issues/379) +* microdata: add file:// to base if it's a filename so rdflib can parse its own + output + [#406](https://github.com/RDFLib/rdflib/pull/406) + [#403](https://github.com/RDFLib/rdflib/issues/403) +* TSV Results parse skips empty bindings in result + [#390](https://github.com/RDFLib/rdflib/pull/390) +* fixed accidental test run due to name + [#389](https://github.com/RDFLib/rdflib/pull/389) +* Bad boolean list serialization to Turtle & fixed ambiguity between + Literal(False) and None + [#387](https://github.com/RDFLib/rdflib/pull/387) + [#382](https://github.com/RDFLib/rdflib/pull/382) +* Current version number & PyPI link in README.md + [#383](https://github.com/RDFLib/rdflib/pull/383) + + +2014/04/15 RELEASE 4.1.2 +======================== + +This is a bug-fix release. + +* Fixed unicode/str bug in py3 for rdfpipe + [#375](https://github.com/RDFLib/rdflib/issues/375) + +2014/03/03 RELEASE 4.1.1 +======================== + +This is a bug-fix release. + +This will be the last RDFLib release to support python 2.5. + +* The RDF/XML Parser was made stricter, now raises exceptions for + illegal repeated node-elements. + [#363](https://github.com/RDFLib/rdflib/issues/363) + +* The SPARQLUpdateStore now supports non-ascii unicode in update + statements + [#356](https://github.com/RDFLib/rdflib/issues/356) + +* Fixed a bug in the NTriple/NQuad parser wrt. to unicode escape sequences + [#352](https://github.com/RDFLib/rdflib/issues/352) + +* HTML5Lib is no longer pinned to 0.95 + [#355](https://github.com/RDFLib/rdflib/issues/360) + +* RDF/XML Serializer now uses parseType=Literal for well-formed XML literals + +* A bug in the manchester OWL syntax was fixed + [#355](https://github.com/RDFLib/rdflib/issues/355) + +2013/12/31 RELEASE 4.1 +====================== + +This is a new minor version RDFLib, which includes a handful of new features: + +* A TriG parser was added (we already had a serializer) - it is + up-to-date wrt. to the newest spec from: http://www.w3.org/TR/trig/ + +* The Turtle parser was made up to date wrt. to the latest Turtle spec. + +* Many more tests have been added - RDFLib now has over 2000 + (passing!) tests. This is mainly thanks to the NT, Turtle, TriG, + NQuads and SPARQL test-suites from W3C. This also included many + fixes to the nt and nquad parsers. + +* ```ConjunctiveGraph``` and ```Dataset``` now support directly adding/removing + quads with ```add/addN/remove``` methods. + +* ```rdfpipe``` command now supports datasets, and reading/writing context + sensitive formats. + +* Optional graph-tracking was added to the Store interface, allowing + empty graphs to be tracked for Datasets. The DataSet class also saw + a general clean-up, see: [#309](https://github.com/RDFLib/rdflib/pull/309) + +* After long deprecation, ```BackwardCompatibleGraph``` was removed. + +Minor enhancements/bugs fixed: +------------------------------ + +* Many code samples in the documentation were fixed thanks to @PuckCh + +* The new ```IOMemory``` store was optimised a bit + +* ```SPARQL(Update)Store``` has been made more generic. + +* MD5 sums were never reinitialized in ```rdflib.compare``` + +* Correct default value for empty prefix in N3 + [#312](https://github.com/RDFLib/rdflib/issues/312) + +* Fixed tests when running in a non UTF-8 locale + [#344](https://github.com/RDFLib/rdflib/issues/344) + +* Prefix in the original turtle have an impact on SPARQL query + resolution + [#313](https://github.com/RDFLib/rdflib/issues/313) + +* Duplicate BNode IDs from N3 Parser + [#305](https://github.com/RDFLib/rdflib/issues/305) + +* Use QNames for TriG graph names + [#330](https://github.com/RDFLib/rdflib/issues/330) + +* \uXXXX escapes in Turtle/N3 were fixed + [#335](https://github.com/RDFLib/rdflib/issues/335) + +* A way to limit the number of triples retrieved from the + ```SPARQLStore``` was added + [#346](https://github.com/RDFLib/rdflib/pull/346) + +* Dots in localnames in Turtle + [#345](https://github.com/RDFLib/rdflib/issues/345) + [#336](https://github.com/RDFLib/rdflib/issues/336) + +* ```BNode``` as Graph's public ID + [#300](https://github.com/RDFLib/rdflib/issues/300) + +* Introduced ordering of ```QuotedGraphs``` + [#291](https://github.com/RDFLib/rdflib/issues/291) + +2013/05/22 RELEASE 4.0.1 +======================== + +Following RDFLib tradition, some bugs snuck into the 4.0 release. +This is a bug-fixing release: + +* the new URI validation caused lots of problems, but is + nescessary to avoid ''RDF injection'' vulnerabilities. In the + spirit of ''be liberal in what you accept, but conservative in + what you produce", we moved validation to serialisation time. + +* the ```rdflib.tools``` package was missing from the + ```setup.py``` script, and was therefore not included in the + PYPI tarballs. + +* RDF parser choked on empty namespace URI + [#288](https://github.com/RDFLib/rdflib/issues/288) + +* Parsing from ```sys.stdin``` was broken + [#285](https://github.com/RDFLib/rdflib/issues/285) + +* The new IO store had problems with concurrent modifications if + several graphs used the same store + [#286](https://github.com/RDFLib/rdflib/issues/286) + +* Moved HTML5Lib dependency to the recently released 1.0b1 which + support python3 + +2013/05/16 RELEASE 4.0 +====================== + +This release includes several major changes: + +* The new SPARQL 1.1 engine (rdflib-sparql) has been included in + the core distribution. SPARQL 1.1 queries and updates should + work out of the box. + + * SPARQL paths are exposed as operators on ```URIRefs```, these can + then be be used with graph.triples and friends: + + ```py + # List names of friends of Bob: + g.triples(( bob, FOAF.knows/FOAF.name , None )) + + # All super-classes: + g.triples(( cls, RDFS.subClassOf * '+', None )) + ``` + + * a new ```graph.update``` method will apply SPARQL update statements + +* Several RDF 1.1 features are available: + * A new ```DataSet``` class + * ```XMLLiteral``` and ```HTMLLiterals``` + * ```BNode``` (de)skolemization is supported through ```BNode.skolemize```, + ```URIRef.de_skolemize```, ```Graph.skolemize``` and ```Graph.de_skolemize``` + +* Handled of Literal equality was split into lexical comparison + (for normal ```==``` operator) and value space (using new ```Node.eq``` + methods). This introduces some slight backwards incomaptible + changes, but was necessary, as the old version had + inconsisten hash and equality methods that could lead the + literals not working correctly in dicts/sets. + The new way is more in line with how SPARQL 1.1 works. + For the full details, see: + + https://github.com/RDFLib/rdflib/wiki/Literal-reworking + +* Iterating over ```QueryResults``` will generate ```ResultRow``` objects, + these allow access to variable bindings as attributes or as a + dict. I.e. + + ```py + for row in graph.query('select ... ') : + print row.age, row["name"] + ``` + +* "Slicing" of Graphs and Resources as syntactic sugar: + ([#271](https://github.com/RDFLib/rdflib/issues/271)) + + ```py + graph[bob : FOAF.knows/FOAF.name] + -> generator over the names of Bobs friends + ``` + +* The ```SPARQLStore``` and ```SPARQLUpdateStore``` are now included + in the RDFLib core + +* The documentation has been given a major overhaul, and examples + for most features have been added. + + +Minor Changes: +-------------- + +* String operations on URIRefs return new URIRefs: ([#258](https://github.com/RDFLib/rdflib/issues/258)) + ```py + >>> URIRef('http://example.org/')+'test + rdflib.term.URIRef('http://example.org/test') + ``` + +* Parser/Serializer plugins are also found by mime-type, not just + by plugin name: ([#277](https://github.com/RDFLib/rdflib/issues/277)) +* ```Namespace``` is no longer a subclass of ```URIRef``` +* URIRefs and Literal language tags are validated on construction, + avoiding some "RDF-injection" issues ([#266](https://github.com/RDFLib/rdflib/issues/266)) +* A new memory store needs much less memory when loading large + graphs ([#268](https://github.com/RDFLib/rdflib/issues/268)) +* Turtle/N3 serializer now supports the base keyword correctly ([#248](https://github.com/RDFLib/rdflib/issues/248)) +* py2exe support was fixed ([#257](https://github.com/RDFLib/rdflib/issues/257)) +* Several bugs in the TriG serializer were fixed +* Several bugs in the NQuads parser were fixed + +2013/03/01 RELEASE 3.4 +====================== + +This release introduced new parsers for structured data in HTML. +In particular formats: hturtle, rdfa, mdata and an auto-detecting +html format were added. Thanks to Ivan Herman for this! + +This release includes a lot of admin maintentance - correct +dependencies for different python versions, etc. Several py3 bugs +were also fixed. + +This release drops python 2.4 compatability - it was just getting +too expensive for us to maintain. It should however be compatible +with any cpython from 2.5 through 3.3. + +* ```node.md5_term``` is now deprecated, if you use it let us know. + +* Literal.datatype/language are now read-only properties ([#226](https://github.com/RDFLib/rdflib/issues/226)) +* Serializing to file fails in py3 ([#249](https://github.com/RDFLib/rdflib/issues/249)) +* TriX serializer places two xmlns attributes on same element ([#250](https://github.com/RDFLib/rdflib/issues/250)) +* RDF/XML parser fails on when XML namespace is not explicitly declared ([#247](https://github.com/RDFLib/rdflib/issues/247)) +* Resource class should "unbox" Resource instances on add ([#215](https://github.com/RDFLib/rdflib/issues/215)) +* Turtle/N3 does not encode final quote of a string ([#239](https://github.com/RDFLib/rdflib/issues/239)) +* float Literal precision lost when serializing graph to turtle or n3 ([#237](https://github.com/RDFLib/rdflib/issues/237)) +* plain-literal representation of xsd:decimals fixed +* allow read-only sleepycat stores +* language tag parsing in N3/Turtle fixes to allow several subtags. + +2012/10/10 RELEASE 3.2.3 +======================== + +Almost identical to 3.2.2 +A stupid bug snuck into 3.2.2, and querying graphs were broken. + +* Fixes broken querying ([#234](https://github.com/RDFLib/rdflib/issues/234)) +* graph.transitiveClosure now works with loops ([#206](https://github.com/RDFLib/rdflib/issues/206)) + +2012/09/25 RELEASE 3.2.2 +======================== + +This is mainly a maintenance release. + +This release should be compatible with python 2.4 through to 3. + +Changes: + +* Improved serialization/parsing roundtrip tests led to some fixes + of obscure parser/serializer bugs. In particular complex string + Literals in ntriples improved a lot. +* The terms of a triple are now asserted to be RDFLib Node's in graph.add + This should avoid getting strings and other things in the store. ([#200](https://github.com/RDFLib/rdflib/issues/200)) +* Added a specific TurtleParser that does not require the store to be + non-formula aware. ([#214](https://github.com/RDFLib/rdflib/issues/214)) +* A trig-serializer was added, see: + http://www4.wiwiss.fu-berlin.de/bizer/trig/ +* BNode generation was made thread-safe ([#209](https://github.com/RDFLib/rdflib/issues/209)) + (also fixed better by dzinxed) +* Illegal BNode IDs removed from NT output: ([#212](https://github.com/RDFLib/rdflib/issues/212)) +* and more minor bug fixes that had no issues + +2012/04/24 RELEASE 3.2.1 +======================== + +This is mainly a maintenance release. + +Changes: + +* New setuptools entry points for query processors and results + +* Literals constructed from other literals copy datatype/lang ([#188](https://github.com/RDFLib/rdflib/issues/188)) +* Relative URIs are resolved incorrectly after redirects ([#130](https://github.com/RDFLib/rdflib/issues/130)) +* Illegal prefixes in turtle output ([#161](https://github.com/RDFLib/rdflib/issues/161)) +* Sleepcat store unstable prefixes ([#201](https://github.com/RDFLib/rdflib/issues/201)) +* Consistent toPyton() for all node objects ([#174](https://github.com/RDFLib/rdflib/issues/174)) +* Better random BNode ID in multi-thread environments ([#185](https://github.com/RDFLib/rdflib/issues/185)) + +2012/01/19 RELEASE 3.2.0 +======================== + +Major changes: +* Thanks to Thomas Kluyver, rdflib now works under python3, + the setup.py script automatically runs 2to3. + +* Unit tests were updated and cleaned up. Now all tests should pass. +* Documentation was updated and cleaned up. + +* A new resource oriented API was added: + http://code.google.com/p/rdflib/issues/detail?id=166 + + Fixed many minor issues: + * http://code.google.com/p/rdflib/issues/detail?id=177 + http://code.google.com/p/rdflib/issues/detail?id=129 + Restored compatability with Python 2.4 + * http://code.google.com/p/rdflib/issues/detail?id=158 + Reworking of Query result handling + * http://code.google.com/p/rdflib/issues/detail?id=193 + generating xml:base attribute in RDF/XML output +* http://code.google.com/p/rdflib/issues/detail?id=180 + serialize(format="pretty-xml") fails on cyclic links + + +2011/03/17 RELEASE 3.1.0 +======================== + +Fixed a range of minor issues: + +* http://code.google.com/p/rdflib/issues/detail?id=128 + + Literal.__str__ does not behave like unicode + +* http://code.google.com/p/rdflib/issues/detail?id=141 + + (RDFa Parser) Does not handle application/xhtml+xml + +* http://code.google.com/p/rdflib/issues/detail?id=142 + + RDFa TC #117: Fragment identifiers stripped from BASE + +* http://code.google.com/p/rdflib/issues/detail?id=146 + + Malformed literals produced when rdfa contains newlines + +* http://code.google.com/p/rdflib/issues/detail?id=152 + + Namespaces beginning with _ are invalid + +* http://code.google.com/p/rdflib/issues/detail?id=156 + + Turtle Files with a UTF-8 BOM fail to parse + +* http://code.google.com/p/rdflib/issues/detail?id=154 + + ClosedNamespace.__str__ returns URIRef not str + +* http://code.google.com/p/rdflib/issues/detail?id=150 + + IOMemory does not override open + +* http://code.google.com/p/rdflib/issues/detail?id=153 + + Timestamps with microseconds *and* "Z" timezone are not parsed + +* http://code.google.com/p/rdflib/issues/detail?id=118 + + DateTime literals with offsets fail to convert to Python + +* http://code.google.com/p/rdflib/issues/detail?id=157 + + Timestamps with timezone information are not parsed + +* http://code.google.com/p/rdflib/issues/detail?id=151 + + problem with unicode literals in rdflib.compare.graph_diff + +* http://code.google.com/p/rdflib/issues/detail?id=149 + + Sleepycat Store broken with create=False + +* http://code.google.com/p/rdflib/issues/detail?id=134 + + Would be useful if Graph.query could propagate kwargs to a + + plugin processor + +* http://code.google.com/p/rdflib/issues/detail?id=133 + + Graph.connected exception when passed empty graph + +* http://code.google.com/p/rdflib/issues/detail?id=129 + + Not compatible with Python 2.4 + +* http://code.google.com/p/rdflib/issues/detail?id=119 + + Support Python's set operations on Graph + +* http://code.google.com/p/rdflib/issues/detail?id=130 + + NT output encoding to utf-8 broken as it goes through + + _xmlcharrefreplace + +* http://code.google.com/p/rdflib/issues/detail?id=121#c1 + + Store SPARQL Support + + +2010/05/13 RELEASE 3.0.0 +======================== + +Working test suite with all tests passing. + +Removed dependency on setuptools. + +(Issue #43) Updated Package and Module Names to follow +conventions outlined in +http://www.python.org/dev/peps/pep-0008/ + +Removed SPARQL bits and non core plugins. They are mostly +moving to http://code.google.com/p/rdfextras/ at least until +they are stable. + +Fixed datatype for Literal(True). + +Fixed Literal to enforce contraint of having either a language +or datatype but not both. + +Fixed Literal's repr. + +Fixed to Graph Add/Sub/Mul opterators. + +Upgraded RDFa parser to pyRdfa. + +Upgraded N3 parser to the one from CWM. + +Fixed unicode encoding issue involving N3Parser. + +N3 serializer improvments. + +Fixed HTTP content-negotiation + +Fixed Store.namespaces method (which caused a few issues +depending on Store implementation being used.) + +Fixed interoperability issue with plugin module. + +Fixed use of Deprecated functionality. + +2009/03/30 RELEASE 2.4.1 +======================== + +Fixed Literal comparison case involving Literal's with +datatypes of XSD.base64Binary. + +Fixed case where XSD.date was matching before XSD.dateTime for +datetime instances. + +Fixed jython interoperability issue (issue #53). + +Fixed Literal repr to handle apostrophes correctly (issue #28). + +Fixed Literal's repr to be consistent with its ```__init__``` (issue #33). + + +2007/04/04 RELEASE 2.4.0 +======================== + +Improved Literal comparison / equality + +Sparql cleanup. + +getLiteralValue now returns the Literal object instead of the +result of toPython(). Now that Literals override a good +coverage of comparison operators, they should be passed around +as first class objects in the SPARQL evaluation engine. + +Added support for session bnodes re: sparql + +Fixed prolog reduce/reduce conflict. Added Py_None IncRefs +where they were being passed into Python method invokations +(per drewp's patch) + +Fixed sparql queries involving empty namespace prefix. + +Fixed the selected variables sparql issue + +Fixed support in SPARQL queries. + +Fixed involving multiple unions and queries are nested more +than one level (bug in _getAllVariables causing failure when +parent.top is None) + +Fixed test_sparql_equals.py. + +Fixed sparql json result comma errors issue. + +Fixed test_sparql_json_results.py (SELECT * variables out of +order) + +Added a 4Suite-based SPARQL XML Writer implementation. If +4Suite is not installed, the fallback python saxutils is used +instead + +applied patch from +http://rdflib.net/issues/2007/02/23/bugs_in_rdflib.sparql.queryresult/issue + +The restriction on GRAPH patterns with variables has been +relieved a bit to allow such usage when the variable is +provided as an initial binding + +Fix for OPTIONAL patterns. P1 OPT P2, where P1 and P2 shared +variables which were bound to BNodes were not unifying on +these BNode variable efficiently / correctly. The fix was to +add bindings for 'stored' BNodes so they aren't confused for +wildcards + + + + +Added support to n3 parser for retaining namespace bindings. + +Fixed several RDFaParser bugs. + +Added serializer specific argument support. + +Fixed a few PrettyXMLSerializer issues and added a max_depth +option. + +Fixed some TurtleSerializer issues. + +Fixed some N3Serializer issues. + + + +Added support easy_install + +added link to long_descriptin for easy_install -U rdflib==dev +to work; added download_url back + +added continuous-releases-using-subversion bit + + + +Added rdflib_tools package + Added rdfpipe + Added initial EARLPluging + + + +Improved test running... using nose... added tests + +Exposed generated test cases for nose to find. +added bit to configure 'setup.py nosetests' to run doc tests + +added nose test bits + + + +Added md5_term_hash method to terms. + +Added commit_pending_transaction argument to Graph's close +method. + +Added DeprecationWarning to rdflib.constants + +Added a NamespaceDict class for those who want to avoid the +Namespace as subclass of URIRef issues + +Added bind function + +Fixed type of Namespace re: URIRef vs. unicode + +Improved ValueError message + +Changed value method's any argument to default to True + +Changed ```__repr__``` to always reflect that it's an rdf.Literal -- +as this is the case even though we now have it acting like the +corresponding type in some casses + +A DISTINCT was added to the SELECT clause to ensure duplicate +triples are not returned (an RDF graph is a set of triples) - +which can happen for certain join expressions. + +Support for ConditionalAndExpressionList and +RelationalExpressionList (|| and && operators in FILTER) + +Fixed context column comparison. The hash integer was being +compared with 'F' causing a warning:Warning: Truncated +incorrect DOUBLE value: 'F' + +applied patch in +http://rdflib.net/issues/2006/12/13/typos_in_abstractsqlstore.py/issue + +fix for +http://rdflib.net/issues/2006/12/07/problems_with_graph.seq()_when_sequences_contain_more_than_9_items./issue + + + + + +General code cleanup (removing redundant imports, changing +relative imports to absolute imports etc) + +Removed usage of deprecated bits. + +Added a number of test cases. + +Added DeprecationWarning for save method + +refactoring of GraphPattern + +ReadOnlyGraphAggregate uses Graph constructor properly to +setup (optionally) a common store + + +Fixed bug with . (fullstop) in localname parts. + +Changed Graph's value method to return None instead of raising +an AssertionError. + +Fixed conversion of (exiplicit) MySQL ports to integers. + +Fixed MySQL store so it properly calculates ```__len__``` of +individual Graphs + +Aligned with how Sleepycat is generating events (remove events +are expressed in terms of interned strings) + +Added code to catch unpickling related exceptions + +Added BerkeleyDB store implementation. + +Merged TextIndex from michel-events branch. + + +2006/10/15 RELEASE 2.3.3 +======================== + +Added TriXParser, N3Serializer and TurtleSerializer. + +Added events to store interface: StoreCreated, TripleAdded and +TripleRemoved. + +Added Journal Reader and Writer. + +Removed Sleepycat level journaling. + +Added support for triple quoted Literal's. + +Fixed some corner cases with Literal comparison. + +Fixed PatternResolution for patterns that return contexts only. + +Fixed NodePickler not to choke on unhashable objects. + +Fixed Namespace's ```__getattr__``` hack to ignore names starting +with __ + +Added SPARQL != operator. + +Fixed query result ```__len__``` (more efficient). + +Fixed and improved RDFa parser. + +redland patches from +http://rdflib.net/pipermail/dev/2006-September/000069.html + +various patches for the testsuite - +http://rdflib.net/pipermail/dev/2006-September/000069.html + + +2006/08/01 RELEASE 2.3.2 +======================== + +Added SPARQL query support. + +Added XSD to/from Python datatype support to Literals. + +Fixed ConjunctiveGraph so that it is a proper subclass of Graph. + +Added Deprecation Warning when BackwardCompatGraph gets used. + +Added RDFa parser. + +Added Collection Class for working with RDF Collections. + +Added method to Graph for testing connectedness + +Fixed bug in N3 parser where identical BNodes were not being combined. + +Fixed literal quoting in N3 serializer. + +Fixed RDF/XML serializer to skip over N3 bits. + +Changed Literal and URIRef instanciation to catch +UnicodeDecodeErrors - which were being thrown when the default +decoding method (ascii) was hitting certain characters. + +Changed Graph's bind method to also override the binding in +the case of an existing generated bindings. + +Added FOPLRelationalModel - a set of utility classes that +implement a minimal Relational Model of FOPL implemented as a +SQL database (uses identifier/value interning and integer +half-md5-hashes for space and index efficiency). + +Changed MySQL store to use FOPLRelationalModel plus fixes and +improvements. + +Added more test cases. + +Cleaned up source code to follow pep8 / pep257. + + +2006/02/27 RELEASE 2.3.1 +======================== + +Added save method to BackwardCompatibleGraph so that +example.py etc work again. + +Applied patch from Drew Perttula to add local_time_zone +argument to util's date_time method. + +Fixed a relativize bug in the rdf/xml serializer. + +Fixed NameError: global name 'URIRef' is not defined error in +Sleepycat.py by adding missing import. + +Applied patch for Seq to sort list by integer, added by Drew +Hess. + +Added a preserve_bnode_ids option to rdf/xml parser. + +Applied assorted patches for tests (see +http://tracker.asemantics.com/rdflib/ticket/8 ) + +Applied redland.diff (see +http://tracker.asemantics.com/rdflib/ticket/9 ) + +Applied changes specified +http://tracker.asemantics.com/rdflib/ticket/7 + +Added a set method to Graph. + +Fixed RDF/XML serializer so that it does not choke on n3 bits +(rather it'll just ignore them) + + +2005/12/23 RELEASE 2.3.0 +======================== + +See http://rdflib.net/2.3.0/ for most up-to-date release notes + +Added N3 support to Graph and Store. + +Added Sean's n3p parser, and ntriples parser. + +Sleepycat implementation has been revamped in the process of +expanding it to support the new requirements n3 +requirements. It also now persists a journal -- more to come. + +detabified source files. + +Literal and parsers now distinguish between datatype of None and datatype of "". + +Store-agnostic 'fallback' implementation of REGEX matching +(inefficient but provides the capability to stores that don't +support it natively). Implemented as a 'wrapper' around any +Store which replaces REGEX terms with None (before dispatching +to the store) and whittles out results that don't match the +given REGEX term expression(s). + +Store-agnostic 'fallback' implementation of transactional +rollbacks (also inefficient but provides the capablity to +stores that don't support it natively). Implemented as a +wrapper that tracks a 'thread-safe' list of reversal +operations (for every add, track the remove call that reverts +the store, and vice versa). Upon store.rollback(), execute the +reverse operations. However, this doesn't guarantee +durability, since if the system fails before the rollbacks are +all executed, the store will remain in an invalid state, but +it provides Atomicity in the best case scenario. + + +2005/10/10 RELEASE 2.2.3 +======================== + +Fixed Sleepycat backend to commit after an add and +remove. This should help just a bit with those unclean +shutdowns ;) + +Fixed use of logging so that it does not mess with the root +logger. Thank you, Arve, for pointing this one out. + +Fixed Graph's value method to have default for subject in +addition to predicate and object. + +Fixed Fourthought backend to be consistent with interface. It +now supports an empty constructor and an open method that +takes a configuration string. + + +2005/09/10 RELEASE 2.2.2 +======================== + +Applied patch from inkel to add encoding argument to all +serialization related methods. + +Fixed XMLSerializer bug regarding default namespace bindings. + +Fixed namespace binding bug involving binding a second default +namespace. + +Applied patch from Gunnar AAstrand Grimnes to add context +support to ```__iadd__``` on Graph. (Am considering the lack of +context support a bug. Any users currently using ```__iadd__```, let +me know if this breaks any of your code.) + +Added Fourthought backend contributed by Chimezie Ogbuji. + +Fixed a RDF/XML parser bug relating to XMLLiteral and +escaping. + +Fixed setup.py so that install does not try to uninstall +(rename_old) before installing; there's now an uninstall +command if one needs to uninstall. + + +2005/08/25 RELEASE 2.2.1 +======================== + +Fixed issue regarding Python2.3 compatibility. + +Fixed minor issue with URIRef's absolute method. + + +2005/08/12 RELEASE 2.1.4 +======================== + +Added optional base argument to URIRef. + +Fixed bug where load and parse had inconsistent behavior. + +Added a FileInputSource. + +Added skeleton sparql parser and test framework. + +Included pyparsing (pyparsing.sourceforge.net) for sparql parsing. + +Added attribute support to namespaces. + + +2005/06/28 RELEASE 2.1.3 +======================== + +Added Ivan's sparql-p implementation. + +Literal is now picklable. + +Added optional base argument to serialize methods about which to relativize. + +Applied patch to remove some dependencies on Python 2.4 +features. + +Fixed BNode's n3 serialization bug (recently introduced). + +Fixed a collections related bug. + + +2005/05/13 RELEASE 2.1.2 +======================== + +Added patch from Sidnei da Silva that adds a sqlobject based backend. + +Fixed bug in PrettyXMLSerializer (rdf prefix decl was missing sometimes) + +Fixed bug in RDF/XML parser where empty collections where +causing exceptions. + + +2005/05/01 RELEASE 2.1.1 +======================== + +Fixed a number of bugs relating to 2.0 backward compatibility. + +Fixed split_uri to handle URIs with _ in them properly. + +Fixed bug in RDF/XML handler's absolutize that would cause some URIRefs to end in ## + +Added check_context to Graph. + +Added patch the improves IOMemory implementation. + + +2005/04/12 RELEASE 2.1.0 +======================== + +Merged TripleStore and InformationStore into Graph. + +Added plugin support (or at least cleaned up, made consistent the +plugin support that existed). + +Added value and seq methods to Graph. + +Renamed prefix_mapping to bind. + +Added namespaces method that is a generator over all prefix, +namespace bindings. + +Added notion of NamespaceManager. + +Added couple new backends, IOMemory and ZODB. + + +2005/03/19 RELEASE 2.0.6 +======================== + +Added pretty-xml serializer (inlines BNodes where possible, +typed nodes, Collections). + +Fixed bug in NTParser and n3 methods where not all characters +where being escaped. + +Changed label and comment methods to return default passed in +when there is no label or comment. Moved methods to Store +Class. Store no longer inherits from Schema. + +Fixed bug involving a case with rdf:about='#' + +Changed InMemoryBackend to update third index in the same style it +does the first two. + + +2005/01/08 RELEASE 2.0.5 +======================== + +Added publicID argument to Store's load method. + +Added RDF and RDFS to top level rdflib package. + + +2004/10/14 RELEASE 2.0.4 +======================== + +Removed unfinished functionality. + +Fixed bug where another prefix other than rdf was getting +defined for the rdf namespace (causing an assertion to fail). + +Fixed bug in serializer where nodeIDs were not valid NCNames. + + +2004/04/21 RELEASE 2.0.3 +======================== + +Added missing "from __future__ import generators" statement to +InformationStore. + +Simplified RDF/XML serializer fixing a few bugs involving +BNodes. + +Added a reset method to RDF/XML parser. + +Changed 'if foo' to "if foo is not None" in a few places in +the RDF/XML parser. + +Fully qualified imports in rdflib.syntax {parser, serializer}. + +Context now goes through InformationStore (was bypassing it +going directly to backend). + + +2004/03/22 RELEASE 2.0.2 +======================== + +Improved performance of Identifier equality tests. + +Added missing "from __future__ import generators" statements +needed to run on Python2.2. + +Added alternative to shlib.move() if it isn't present. + +Fixed bug that occured when specifying a backend to +InformationStore's constructor. + +Fixed bug recently introduced into InformationStore's remove +method. + + +2004/03/15 RELEASE 2.0.1 +======================== + +Fixed a bug in the SleepyCatBackend multi threaded concurrency +support. (Tested fairly extensively under the following +conditions: multi threaded, multi process, and both). + +> NOTE: fix involved change to database format -- so 2.0.1 will not be +> able to open databases created with 2.0.0 + +Removed the use of the Concurrent wrapper around +InMemoryBackend and modified InMemoryBackend to handle +concurrent requests. (Motivated by Concurrent's poor +performance on bigger TripleStores.) + +Improved the speed of len(store) by making backends +responsible for implementing ```__len__```. + +Context objects now have a identifier property. + + +2004/03/10 RELEASE 2.0.0 +======================== + +Fixed a few bugs in the SleepyCatBackend multi process +concurrency support. + +Removed rdflib.Resource + +Changed remove to now take a triple pattern and removed +remove_triples method. + +Added ```__iadd__``` method to Store in support of store += +another_store. + + +2004/01/04 RELEASE 1.3.2 +======================== + +Added a serialization dispatcher. + +Added format arg to save method. + +Store now remembers prefix/namespace bindings. + +Backends are now more pluggable + +... + +2003/10/14 RELEASE 1.3.1 +======================== + +Fixed bug in serializer where triples where only getting +serialized the first time. + +Added type checking for contexts. + +Fixed bug that caused comparisons with a Literal to fail when +the right hand side was not a string. + +Added DB_INIT_CDB flag to SCBacked for supporting multiple +reader/single writer access + +Changed rdf:RDF to be optional to conform with latest spec. + +Fixed handling of XMLLiterals + + +2003/04/40 RELEASE 1.3.0 +======================== + +Removed bag_id support and added it to OLD_TERMS. + +Added a double hash for keys in SCBacked. + +Fixed _HTTPClient so that it no longer removes metadata about +a context right after it adds it. + +Added a KDTreeStore and RedlandStore backends. + +Added a StoreTester. + + +2003/02/28 RELEASE 1.2.4 +======================== + +Fixed bug in SCBackend where language and datatype information +where being ignored. + +Fixed bug in transitive_subjects. + +Updated some of the test cases that where not up to date. + +async_load now adds more http header and error information to +the InformationStore. + + +2003/02/11 RELEASE 1.2.3 +======================== + +Fixed bug in load methods where relative URLs where not being +absolutized correctly on Windows. + +Fixed serializer so that it throws an exception when trying to +serialize a graph with a predicate that can not be split. + + +2003/02/07 RELEASE 1.2.2 +======================== + +Added an exists method to the BackwardCompatibility mixin. + +Added versions of remove, remove_triples and triples methods +to the BackwardCompatility mixin for TripleStores that take an +s, p, o as opposed to an (s, p, o). + + +2003/02/03 RELEASE 1.2.1 +======================== + +Added support for parsing XMLLiterals. + +Added support for proper charmod checking (only works in +Python2.3). + +Fixed remaining rdfcore test cases that where not passing. + +Fixed windows bug in AbstractInformationStore's run method. + + +2003/01/02 RELEASE 1.2.0 +======================== + +Added systemID, line #, and column # to error messages. + +BNode prefix is now composed of ascii_letters instead of letters. + +Added a bsddb backed InformationStore. + +Added an asyncronous load method, methods for scheduling context +updates, and a run method. + + +2002/12/16 RELEASE 1.1.5 +======================== + +Introduction of InformationStore, a TripleStore with the +addition of context support. + +Resource ```__getitem__``` now returns object (no longer returns a +Resource for the object). + +Fixed bug in parser that was introduced in last release +regaurding unqualified names. + + +2002/12/10 RELEASE 1.1.4 +======================== + +Interface realigned with last stable release. + +Serializer now uses more of the abbreviated forms where +possible. + +Parser optimized and cleaned up. + +Added third index to InMemoryStore. + +The load and parse methods now take a single argument. + +Added a StringInputSource for to support parsing from strings. + +Renamed rdflib.BTreeTripleStore.TripleStore to +rdflib.BTreeTripleStore.BTreeTripleStore. + +Minor reorganization of mix-in classes. + + +2002/12/03 RELEASE 1.1.3 +======================== + +BNodes now created with a more unique identifier so BNodes +from different sessions do not collide. + +Added initial support for XML Literals (for now they are +parsed into Literals). + +Resource is no longer a special kind of URIRef. + +Resource no longer looks at range to determine default return +type for ```__getitem__```. Instead there is now a get(predicate, default) +method. + + +2002/11/21 RELEASE 1.1.2 +======================== + +Fixed Literal's ```__eq__``` method so that Literal('foo')=='foo' etc. + +Fixed Resource's ```__setitem__``` method so that it does not raise +a dictionary changed size while iterating exception. + + +2002/11/09 RELEASE 1.1.1 +======================== + +Resource is now a special kind of URIRef + +Resource's ```__getitem__``` now looks at rdfs:range to determine +return type in default case. + + + +2002/11/05 RELEASE 1.1.0 +======================== + +# A new development branch + +Cleaned up interface and promoted it to SIR: Simple Interface +for RDF. + +Updated parser to use SAX2 interfaces instead of using expat directly. + +Added BTreeTripleStore, a ZODB BTree TripleStore backend. And +a default pre-mixed TripleStore that uses it. + +Synced with latest (Editor's draft) RDF/XML spec. + +Added datatype support. + +Cleaned up interfaces for load/parse: removed generate_path +from loadsave andrenamed parse_URI to parse. + + +2002/10/08 RELEASE 0.9.6 +======================== + + +# The end of a development branch + +BNode can now be created with specified value. + +Literal now has a language attribute. + +Parser now creates Literals with language attribute set +appropriately as determined by xml:lang attributes. + + +TODO: Serializer-Literals-language attribute + +TODO: Change ```__eq__``` so that Literal("foo")=="foo" etc + +TripleStores now support "in" operator. +For example: if (s, p, o) in store: print "Found ", s, p, o + +Added APIs/object for working at level of a Resource. NOTE: +This functionality is still experimental + +Consecutive Collections now parse correctly. + +2002/08/06 RELEASE 0.9.5 +======================== + + +Added support for rdf:parseType="Collection" + +Added items generator for getting items in a Collection + +Renamed rdflib.triple_store to rdflib.TripleStore to better follow +python style conventions. + +Added an Identifier Class + +Moved each node into its own Python module. + +Added rdflib.util with a first and uniq function. + +Added a little more to example.py + +Removed generate_uri since we have BNodes now. + + +2002/07/29 RELEASE 0.9.4 +======================== + + +Added support for proposed rdf:nodeID to both the parser and +serializer. + +Reimplemented serializer which now nests things where +possible. + +Added partial support for XML Literal parseTypes. + + +2002/07/16 RELEASE 0.9.3 +======================== + + +Fixed bug where bNodes where being created for nested property +elements when they where not supposed to be. + +Added lax mode that will convert rdf/xml files that contain bare +IDs etc. Also, lax mode will only report parse errors instead of +raising exceptions. + +Added missing check for valid attribute names in the case of +production 5.18 of latest WD spec. + + +2002/07/05 RELEASE 0.9.2 +======================== + + +Added missing constants for SUBPROPERTYOF, ISDEFINEDBY. + +Added test case for running all of the rdf/xml test cases. + +Reimplemented rdf/xml parser to conform to latest WD. + + +2002/06/10 RELEASE 0.9.1 +======================== + + +There is now a remove and a remove_triples (no more overloaded +remove). + +Layer 2 has been merged with layer 1 since there is no longer a +need for them to be separate layers. + +The generate_uri method has moved to LoadSave since triple stores +do not have a notion of a uri. [Also, with proper bNode support on +its way the need for a generate_uri might not be as high.] + +Fixed bug in node's n3 function: URI -> URIRef. + +Replaced string based exceptions with class based exceptions. + +Added PyUnit TestCase for parser.py + +Added N-Triples parser. + +Added ```__len__``` and ```__eq__``` methods to store interface. + + +2002/06/04 RELEASE 0.9.0 +======================== + +Initial release after being split from redfootlib. diff --git a/testbed/RDFLib__rdflib/CONTRIBUTORS b/testbed/RDFLib__rdflib/CONTRIBUTORS new file mode 100644 index 0000000000000000000000000000000000000000..51987b61e6bd4e9037ba8e916ef79217d436c2c8 --- /dev/null +++ b/testbed/RDFLib__rdflib/CONTRIBUTORS @@ -0,0 +1,30 @@ +Aaron Swartz +Andrew Eland +Andrew Kuchling +Arve Knudsen +Chimezie Ogbuji +Daniel Krech +David H Jones +Drew Perttula +Elias Torres +Gerhard Weis +Graham Higgins +Graham Klyne +Gunnar AAstrand Grimnes +Ivan Herman +Jeroen van der Ham +Joern Hees +Kendall Clark +Leandro López +Lucio Torre +Michel Pelletier +Nacho Barrientos Arias +Niklas Lindström +Phil Dawes +Phillip Pearson +Ron Alford +Sidnei da Silva +Simon McVittie +Stefan Niederhauser +Thomas Kluyver +William Waites diff --git a/testbed/RDFLib__rdflib/LICENSE b/testbed/RDFLib__rdflib/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..38c0f03a0721e65bae1a7995514511ba5e4e72bf --- /dev/null +++ b/testbed/RDFLib__rdflib/LICENSE @@ -0,0 +1,33 @@ +LICENSE AGREEMENT FOR RDFLIB +------------------------------------------------ +Copyright (c) 2002-2017, RDFLib Team +See CONTRIBUTORS and http://github.com/RDFLib/rdflib +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following +disclaimer in the documentation and/or other materials provided +with the distribution. + + * Neither the name of Daniel Krech nor the names of its +contributors may be used to endorse or promote products derived +from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/testbed/RDFLib__rdflib/MANIFEST.in b/testbed/RDFLib__rdflib/MANIFEST.in new file mode 100644 index 0000000000000000000000000000000000000000..d48534bd1f3d9341e5d58a8d1e459d85a9929ec0 --- /dev/null +++ b/testbed/RDFLib__rdflib/MANIFEST.in @@ -0,0 +1,13 @@ +include CHANGELOG.md +include LICENSE +include README.md +include CONTRIBUTORS +include ez_setup.py +include skiptests.list +recursive-include rdflib *.py +recursive-include examples *.py +include run_tests.py +graft test +graft docs +prune docs/_build +global-exclude *.pyc *$py.class diff --git a/testbed/RDFLib__rdflib/README.md b/testbed/RDFLib__rdflib/README.md new file mode 100644 index 0000000000000000000000000000000000000000..eb33567995bfa8e100edf01fd5612f6278e26c40 --- /dev/null +++ b/testbed/RDFLib__rdflib/README.md @@ -0,0 +1,103 @@ +RDFLib +====== +[![Build Status](https://travis-ci.org/RDFLib/rdflib.png?branch=master)](https://travis-ci.org/RDFLib/rdflib) +[![Coveralls branch](https://img.shields.io/coveralls/RDFLib/rdflib/master.svg)](https://coveralls.io/r/RDFLib/rdflib?branch=master) +[![GitHub stars](https://img.shields.io/github/stars/RDFLib/rdflib.svg)](https://github.com/RDFLib/rdflib/stargazers) +[![PyPI](https://img.shields.io/pypi/v/rdflib.svg)](https://pypi.python.org/pypi/rdflib) +[![PyPI](https://img.shields.io/pypi/pyversions/rdflib.svg)](https://pypi.python.org/pypi/rdflib) + + +RDFLib is a Python library for working with RDF, a simple yet +powerful language for representing information as graphs. + +RDFLib may be installed with pip (use sudo as required): + + $ pip install rdflib + +Alternatively manually download the package from the Python Package +Index (PyPI) at https://pypi.python.org/pypi/rdflib + +The current version of RDFLib is 4.2.2, see the ``CHANGELOG.md`` +file for what's new. + + +Getting Started +--------------- + +RDFLib aims to be a pythonic RDF API, a Graph is a python collection +of RDF Subject,Predicate,Object Triples: + +```python +import rdflib +g=rdflib.Graph() +g.load('http://dbpedia.org/resource/Semantic_Web') + +for s,p,o in g: + print(s, p, o) +``` + +The components of the triples are URIs (resources) or Literals +(values), URIs are grouped together by *namespace*, common namespaces are +included in RDFLib: + +```python + +semweb=rdflib.URIRef('http://dbpedia.org/resource/Semantic_Web') +type=g.value(semweb, rdflib.RDFS.label) +``` + +Where `rdflib.RDFS` is the RDFS Namespace, `graph.value` returns an +object of the triple-pattern given (or an arbitrary one if more +exist). New Namespaces can also be defined: + +```python + +dbpedia=rdflib.Namespace('http://dbpedia.org/ontology/') + +abstracts=list(x for x in g.objects(semweb, dbpedia['abstract']) if x.language=='en') +``` + +See also [./examples](./examples) + + +Features +-------- + +The library contains parsers and serializers for RDF/XML, N3, +NTriples, N-Quads, Turtle, TriX, RDFa and Microdata. + +The library presents a Graph interface which can be backed by +any one of a number of Store implementations. + +This core RDFLib package includes store implementations for +in memory storage and persistent storage on top of the Berkeley DB. + +A SPARQL 1.1 implementation is included - supporting SPARQL 1.1 Queries and Update statements. + +RDFLib is open source and is maintained on [GitHub](https://github.com/RDFLib/rdflib/). RDFLib releases, current and previous +are listed on [PyPI](https://pypi.python.org/pypi/rdflib/) + +RDFLib has a plugin-architecture for store-implementation, as well as parsers/serializers, several other projects exist which extend RDFLib features: + + * [rdflib-jsonld](https://github.com/RDFLib/rdflib-jsonld) - Serializer and parser for [json-ld](http://json-ld.org) + +Support +------- + +More information is available on the project webpage: + +https://github.com/RDFLib/rdflib/ + +The documentation can be built by doing:: + + $ python setup.py build_sphinx + +And is also available from ReadTheDocs: + +https://rdflib.readthedocs.io + +Support is available through the rdflib-dev group: + +https://groups.google.com/group/rdflib-dev + +and on the IRC channel #rdflib on the freenode.net server diff --git a/testbed/RDFLib__rdflib/requirements.txt b/testbed/RDFLib__rdflib/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..215e257a8e5dc238283a23a3bd3fb3df7f4d47bf --- /dev/null +++ b/testbed/RDFLib__rdflib/requirements.txt @@ -0,0 +1,7 @@ +flake8 +html5lib +isodate +pyparsing +requests +six +doctest-ignore-unicode diff --git a/testbed/RDFLib__rdflib/run_tests.py b/testbed/RDFLib__rdflib/run_tests.py new file mode 100644 index 0000000000000000000000000000000000000000..77bc9fec26cacf3c754859ddb1cbe0d985150ee7 --- /dev/null +++ b/testbed/RDFLib__rdflib/run_tests.py @@ -0,0 +1,99 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +Testing with Nose +================= + +This test runner uses Nose for test discovery and running. It uses the argument +spec of Nose, but with some options pre-set. To begin with, make sure you have +Nose installed, e.g.: + + $ pip nose doctest-ignore-unicode + +For daily test runs, use: + + $ ./run_tests.py + +If you supply attributes, the default ones defined in ``DEFAULT_ATTRS`` will be +ignored. So to run e.g. all tests marked ``slowtest`` or ``non_standard_dep``, +do: + + $ ./run_tests.py -a slowtest,non_standard_dep + +See for furher details. An excellent +article is also available at . + +Note that this is just a convenience script. You can use ``nosetests`` directly +if it's on $PATH, with the difference that you have to supply the options +pre-set here manually. + +Coverage +======== + +If ``coverage.py`` is placed in $PYTHONPATH, it can be used to create coverage +information (using the built-in coverage plugin of Nose) if the default +option "--with-coverage" is supplied (which also enables some additional +coverage options). + +See for details. + +""" +from __future__ import print_function + + +NOSE_ARGS = [ + '--with-doctest', + '--doctest-extension=.doctest', + '--doctest-tests', + # '--with-EARL', +] + +COVERAGE_EXTRA_ARGS = [ + '--cover-package=rdflib', + '--cover-inclusive', +] + +DEFAULT_LOCATION = '--where=./' + +DEFAULT_ATTRS = [] # ['!known_issue', '!sparql'] + +DEFAULT_DIRS = ['test', 'rdflib'] + + +if __name__ == '__main__': + + from sys import argv, exit, stderr + try: + import nose + except ImportError: + print("""\ + Requires Nose. Try: + + $ sudo easy_install nose + + Exiting. """, file=stderr) + exit(1) + + + if '--with-coverage' in argv: + try: + import coverage + except ImportError: + print("No coverage module found, skipping code coverage.", file=stderr) + argv.remove('--with-coverage') + else: + NOSE_ARGS += COVERAGE_EXTRA_ARGS + + + if True not in [a.startswith('-a') or a.startswith('--attr=') for a in argv]: + argv.append('--attr=' + ','.join(DEFAULT_ATTRS)) + + if not [a for a in argv[1:] if not a.startswith('-')]: + argv += DEFAULT_DIRS # since nose doesn't look here by default.. + + if not [a for a in argv if a.startswith('--where=')]: + argv += [DEFAULT_LOCATION] + + finalArgs = argv + NOSE_ARGS + print("Running nose with:", " ".join(finalArgs[1:])) + nose.run_exit(argv=finalArgs) diff --git a/testbed/RDFLib__rdflib/setup.cfg b/testbed/RDFLib__rdflib/setup.cfg new file mode 100644 index 0000000000000000000000000000000000000000..535ee3107393afe54acc523d0bfa872deb3d62d3 --- /dev/null +++ b/testbed/RDFLib__rdflib/setup.cfg @@ -0,0 +1,8 @@ +[nosetests] + +attr=!known_issue,!non_core,!performancetest +verbosity=1 +with-doctest=1 +with-doctest-ignore-unicode=1 +doctest-options=+IGNORE_UNICODE +exclude=rdflib.plugins.sparql.paths|rdflib.extras.external_graph_libs diff --git a/testbed/RDFLib__rdflib/setup.py b/testbed/RDFLib__rdflib/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..9859360e00ed74bdb314ba3708d5c1965f05de58 --- /dev/null +++ b/testbed/RDFLib__rdflib/setup.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python + +import os +import re +from setuptools import setup, find_packages + +kwargs = {} +kwargs['install_requires'] = [ 'six', 'isodate', 'pyparsing'] +kwargs['tests_require'] = ['html5lib', 'networkx'] +kwargs['test_suite'] = "nose.collector" +kwargs['extras_require'] = {'html': ['html5lib']} + +def find_version(filename): + _version_re = re.compile(r'__version__ = "(.*)"') + for line in open(filename): + version_match = _version_re.match(line) + if version_match: + return version_match.group(1) + +version = find_version('rdflib/__init__.py') + +packages = find_packages(exclude=('examples*', 'test*')) + +if os.environ.get('READTHEDOCS', None): + # if building docs for RTD + # install examples, to get docstrings + packages.append("examples") + +setup( + name='rdflib', + version=version, + description="RDFLib is a Python library for working with RDF, a " + "simple yet powerful language for representing information.", + author="Daniel 'eikeon' Krech", + author_email="eikeon@eikeon.com", + maintainer="RDFLib Team", + maintainer_email="rdflib-dev@google.com", + url="https://github.com/RDFLib/rdflib", + license="BSD-3-Clause", + platforms=["any"], + classifiers=[ + "Programming Language :: Python", + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "License :: OSI Approved :: BSD License", + "Topic :: Software Development :: Libraries :: Python Modules", + "Operating System :: OS Independent", + "Natural Language :: English", + ], + long_description="""\ +RDFLib is a Python library for working with +RDF, a simple yet powerful language for representing information. + +The library contains parsers and serializers for RDF/XML, N3, +NTriples, Turtle, TriX, RDFa and Microdata . The library presents +a Graph interface which can be backed by any one of a number of +Store implementations. The core rdflib includes store +implementations for in memory storage, persistent storage on top +of the Berkeley DB, and a wrapper for remote SPARQL endpoints. + +A SPARQL 1.1 engine is also included. + +If you have recently reported a bug marked as fixed, or have a craving for +the very latest, you may want the development version instead: + + pip install git+https://github.com/rdflib/rdflib + + +Read the docs at: + + http://rdflib.readthedocs.io + + """, + packages = packages, + entry_points = { + 'console_scripts': [ + 'rdfpipe = rdflib.tools.rdfpipe:main', + 'csv2rdf = rdflib.tools.csv2rdf:main', + 'rdf2dot = rdflib.tools.rdf2dot:main', + 'rdfs2dot = rdflib.tools.rdfs2dot:main', + 'rdfgraphisomorphism = rdflib.tools.graphisomorphism:main', + ], + }, + + **kwargs + ) diff --git a/testbed/RDFLib__rdflib/skiptests.list b/testbed/RDFLib__rdflib/skiptests.list new file mode 100644 index 0000000000000000000000000000000000000000..7103aff23046a39100dc036a67ea7d76ce54b0ab --- /dev/null +++ b/testbed/RDFLib__rdflib/skiptests.list @@ -0,0 +1,59 @@ +http://www.w3.org/2001/sw/DataAccess/tests/data-r2/open-world/manifest#date-2 xsd:date not supported +http://www.w3.org/2001/sw/DataAccess/tests/data-r2/open-world/manifest#date-3 xsd:date not supported +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/delete/manifest#dawg-delete-using-02a known issue with update and datasets +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/delete/manifest#dawg-delete-using-06a known issue with update and datasets +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/service/manifest#service1 service not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/service/manifest#service2 service not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/service/manifest#service3 service not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/service/manifest#service4a service not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/service/manifest#service5 service not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/service/manifest#service6 service not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/service/manifest#service7 service not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#rdf01 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#rdf02 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#rdfs01 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#rdfs02 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#rdfs03 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#rdfs04 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#rdfs05 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#rdfs06 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#rdfs07 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#rdfs08 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#rdfs09 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#rdfs10 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#rdfs11 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#rdfs12 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#paper-sparqldl-Q1 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#paper-sparqldl-Q1-rdfs entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#paper-sparqldl-Q2 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#paper-sparqldl-Q3 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#sparqldl-02 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#sparqldl-03 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#sparqldl-06 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#sparqldl-07 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#sparqldl-08 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#sparqldl-10 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#sparqldl-12 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#sparqldl-13 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#parent3 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#parent4 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#parent5 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#parent6 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#parent7 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#parent9 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#parent10 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#simple1 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#simple2 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#simple3 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#simple4 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#simple5 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#simple6 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#simple7 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#simple8 entailment not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/service/manifest#service1 service not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/service/manifest#service2 service not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/service/manifest#service3 service not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/service/manifest#service4a service not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/service/manifest#service5 service not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/service/manifest#service6 service not implemented +http://www.w3.org/2009/sparql/docs/tests/data-sparql11/service/manifest#service7 service not implemented diff --git a/testbed/RDFLib__rdflib/test/test_parser.py b/testbed/RDFLib__rdflib/test/test_parser.py new file mode 100644 index 0000000000000000000000000000000000000000..d311a89b0dd9c9c02017e6c899e1a92d84be63bc --- /dev/null +++ b/testbed/RDFLib__rdflib/test/test_parser.py @@ -0,0 +1,44 @@ +import unittest + +from rdflib.namespace import RDF, RDFS +from rdflib.term import URIRef +from rdflib.term import Literal +from rdflib.graph import Graph + + +class ParserTestCase(unittest.TestCase): + backend = 'default' + path = 'store' + + def setUp(self): + self.graph = Graph(store=self.backend) + self.graph.open(self.path) + + def tearDown(self): + self.graph.close() + + def testNoPathWithHash(self): + g = self.graph + g.parse(data="""\ + + + + + testing + + + +""", publicID="http://example.org") + + subject = URIRef("http://example.org#") + label = g.value(subject, RDFS.label) + self.assertEqual(label, Literal("testing")) + type = g.value(subject, RDF.type) + self.assertEqual(type, RDFS.Class) + + +if __name__ == "__main__": + unittest.main() diff --git a/testbed/RDFLib__rdflib/test/test_parser_structure.py b/testbed/RDFLib__rdflib/test/test_parser_structure.py new file mode 100644 index 0000000000000000000000000000000000000000..d759061fd358c0475668c79040fb59e966d1de55 --- /dev/null +++ b/testbed/RDFLib__rdflib/test/test_parser_structure.py @@ -0,0 +1,13 @@ +import rdflib.plugins.sparql.parser +import pprint + + +def t(q): + print(q) + pprint.pprint(rdflib.plugins.sparql.parser.parseQuery(q)) + + +t("SELECT * WHERE { ?s ?p ?o, ?o2 ; ?p2 ?o3 . ?s2 ?p ?o .} ") + + +t("SELECT * WHERE { ?s ?p ?o, ?o2 ; ?p2 ?o3 ; ?p3 [ ?p ?o ] . ?s2 ?p ?o .} ") diff --git a/testbed/RDFLib__rdflib/test/test_prefixTypes.py b/testbed/RDFLib__rdflib/test/test_prefixTypes.py new file mode 100644 index 0000000000000000000000000000000000000000..415f04590d569c9c1fca712031d2fb3abe5f2c2c --- /dev/null +++ b/testbed/RDFLib__rdflib/test/test_prefixTypes.py @@ -0,0 +1,34 @@ +import unittest + + +from rdflib import Graph +from six import b + +graph = Graph().parse(format='n3', data=""" +@prefix dct: . +@prefix foaf: . +@prefix xsd: . + + a foaf:Document; + dct:created "2011-03-20"^^xsd:date . +""") + + +class PrefixTypesTest(unittest.TestCase): + + """N3/Turtle serializers should use prefixes, + also for types and datatypes + + This is issue 161 + http://code.google.com/p/rdflib/issues/detail?id=161 + """ + + def test(self): + s = graph.serialize(format='n3') + print(s) + self.assertTrue(b("foaf:Document") in s) + self.assertTrue(b("xsd:date") in s) + + +if __name__ == '__main__': + unittest.main() diff --git a/testbed/RDFLib__rdflib/test/test_prettyxml.py b/testbed/RDFLib__rdflib/test/test_prettyxml.py new file mode 100644 index 0000000000000000000000000000000000000000..996e6e54e1f8dc0545aa71e6f24a2244fdb9c985 --- /dev/null +++ b/testbed/RDFLib__rdflib/test/test_prettyxml.py @@ -0,0 +1,172 @@ +# -*- coding: UTF-8 -*- +from rdflib.term import URIRef, BNode, Literal +from rdflib.namespace import RDF, RDFS +from six import b, BytesIO + +from rdflib.plugins.serializers.rdfxml import PrettyXMLSerializer + +from rdflib.graph import ConjunctiveGraph + + +class SerializerTestBase(object): + + repeats = 8 + + def setup(self): + graph = ConjunctiveGraph() + graph.parse(data=self.testContent, format=self.testContentFormat) + self.sourceGraph = graph + + def test_serialize_and_reparse(self): + reparsedGraph = serialize_and_load(self.sourceGraph, self.serializer) + _assert_equal_graphs(self.sourceGraph, reparsedGraph) + + def test_multiple(self): + """Repeats ``test_serialize`` ``self.repeats`` times, to reduce sucess based on in-memory ordering.""" + for i in range(self.repeats): + self.test_serialize_and_reparse() + + # test_multiple.slowtest=True # not really slow? + + +def _assert_equal_graphs(g1, g2): + assert len(g1) == len(g2), "Serialized graph not same size as source graph." + g1copy = _mangled_copy(g1) + g2copy = _mangled_copy(g2) + g1copy -= _mangled_copy(g2) + g2copy -= _mangled_copy(g1) + assert len(g1copy) == 0, "Source graph larger than serialized graph." + assert len(g2copy) == 0, "Serialized graph larger than source graph." + + +_blank = BNode() + + +def _mangled_copy(g): + "Makes a copy of the graph, replacing all bnodes with the bnode ``_blank``." + gcopy = ConjunctiveGraph() + + def isbnode(v): return isinstance(v, BNode) + for s, p, o in g: + if isbnode(s): + s = _blank + if isbnode(p): + p = _blank + if isbnode(o): + o = _blank + gcopy.add((s, p, o)) + return gcopy + + +def serialize(sourceGraph, makeSerializer, getValue=True, extra_args={}): + serializer = makeSerializer(sourceGraph) + stream = BytesIO() + serializer.serialize(stream, **extra_args) + return getValue and stream.getvalue() or stream + + +def serialize_and_load(sourceGraph, makeSerializer): + stream = serialize(sourceGraph, makeSerializer, False) + stream.seek(0) + reparsedGraph = ConjunctiveGraph() + reparsedGraph.load(stream) + return reparsedGraph + + +class TestPrettyXmlSerializer(SerializerTestBase): + + serializer = PrettyXMLSerializer + + testContent = """ + @prefix rdfs: . + @prefix owl: . + @prefix : . + + :value rdfs:domain :Test . + + :Test rdfs:subClassOf + [ a owl:Restriction; + owl:onProperty :value ], + [ a owl:Restriction; + owl:onProperty :name ] . + + a :Test; + rdfs:seeAlso ; + :value "A" . + + + :name "Bee"@en, "Be"@sv; + :value "B" . + + a rdfs:Resource; + rdfs:seeAlso ; + :value 3 . + + a rdfs:Resource; + rdfs:seeAlso ; + rdfs:seeAlso ; + rdfs:seeAlso . + + _:bnode1 a :BNode; + rdfs:seeAlso _:bnode2 . + + _:bnode2 a :BNode ; + rdfs:seeAlso _:bnode3 . + + _:bnode3 a :BNode ; + rdfs:seeAlso _:bnode2 . + + """ + testContentFormat = 'n3' + + def test_result_fragments(self): + rdfXml = serialize(self.sourceGraph, self.serializer) + assert b('') in rdfXml + assert b('') in rdfXml + assert b('Bee') in rdfXml + assert b('3') in rdfXml + assert b('' in rdfXml, onlyBNodesMsg + #assert not '') in rdfXml + assert b('') in rdfXml + assert b('3') in rdfXml + assert b('See also Å

''', datatype=RDF.XMLLiteral))) + # when: + xmlrepr = g.serialize(format='pretty-xml') + # then: + assert u'''

See also Å

'''.encode('utf-8') in xmlrepr + + def test_pretty_broken_xmlliteral(self): + # given: + g = ConjunctiveGraph() + g.add((BNode(), RDF.value, Literal(u'''

<p '''.encode('utf-8') in xmlrepr + + +def _assert_expected_object_types_for_predicates(graph, predicates, types): + for s, p, o in graph: + if p in predicates: + someTrue = [isinstance(o, t) for t in types] + assert True in someTrue, \ + "Bad type %s for object when predicate is <%s>." % (type(o), p) diff --git a/testbed/RDFLib__rdflib/test/test_rdfxml.py b/testbed/RDFLib__rdflib/test/test_rdfxml.py new file mode 100644 index 0000000000000000000000000000000000000000..94275e72a8027c2253744610727e9d9da9cbf507 --- /dev/null +++ b/testbed/RDFLib__rdflib/test/test_rdfxml.py @@ -0,0 +1,266 @@ +from __future__ import print_function + +import sys +from encodings.utf_8 import StreamWriter + +import unittest + +import os +import os.path + +from six.moves.urllib.request import url2pathname, urlopen + +from rdflib import RDF, RDFS, URIRef, BNode, Literal, Namespace, Graph +from rdflib.exceptions import ParserError +from rdflib.util import first + + +import logging + +_logger = logging.getLogger("parser_rdfcore") + +verbose = 0 + + +sw = StreamWriter(sys.stdout) + + +def write(msg): + _logger.info(msg + "\n") + # sw.write(msg+"\n") + + +class TestStore(Graph): + __test__ = False + + def __init__(self, expected): + super(TestStore, self).__init__() + self.expected = expected + + def add(self, spo): + (s, p, o) = spo + if not isinstance(s, BNode) and not isinstance(o, BNode): + if not (s, p, o) in self.expected: + m = "Triple not in expected result: %s, %s, %s" % ( + s.n3(), p.n3(), o.n3()) + if verbose: + write(m) + # raise Exception(m) + super(TestStore, self).add((s, p, o)) + + +TEST = Namespace("http://www.w3.org/2000/10/rdf-tests/rdfcore/testSchema#") + +CACHE_DIR = os.path.join(os.path.dirname(__file__), "rdf") + +skipped = ( + # "datatypes/Manifest.rdf#test002", + # "rdf-containers-syntax-vs-schema/Manifest.rdf#test004", + # "rdfms-xml-literal-namespaces/Manifest.rdf#test001", + # "rdfms-xml-literal-namespaces/Manifest.rdf#test002", + # "rdfms-xmllang/Manifest.rdf#test001", + # "rdfms-xmllang/Manifest.rdf#test002", + # "xml-canon/Manifest.rdf#test001" +) + + +def cached_file(url): + fname = url2pathname(relative(url)) + + fpath = os.path.join(CACHE_DIR, fname) + if not os.path.exists(fpath): + print("%s does not exist, fetching from %s" % (fpath, url)) + folder = os.path.dirname(fpath) + if not os.path.exists(folder): + os.makedirs(folder) + f = open(fpath, 'w') + try: + f.write(urlopen(url).read()) + finally: + f.close() + return fpath + + +RDFCOREBASE = "http://www.w3.org/2000/10/rdf-tests/rdfcore/" + + +def relative(url): + return url[len(RDFCOREBASE):] + + +def resolve(rel): + return RDFCOREBASE + rel + + +def _testPositive(uri, manifest): + if verbose: + write(u"TESTING: %s" % uri) + result = 0 # 1=failed, 0=passed + inDoc = first(manifest.objects(uri, TEST["inputDocument"])) + outDoc = first(manifest.objects(uri, TEST["outputDocument"])) + expected = Graph() + if outDoc[-3:] == ".nt": + format = "nt" + else: + format = "xml" + expected.parse(cached_file(outDoc), publicID=outDoc, format=format) + store = TestStore(expected) + if inDoc[-3:] == ".nt": + format = "nt" + else: + format = "xml" + + try: + store.parse(cached_file(inDoc), publicID=inDoc, format=format) + except ParserError as pe: + write("Failed '") + write(inDoc) + write("' failed with") + raise pe + try: + write(type(pe)) + except: + write("sorry could not dump out error.") + result = 1 + else: + if not store.isomorphic(expected): + write(u"""Failed: '%s'""" % uri) + if verbose: + write(""" In:\n""") + for s, p, o in store: + write("%s %s %s." % (repr(s), repr(p), repr(o))) + write(""" Out:\n""") + for s, p, o in expected: + write("%s %s %s." % (repr(s), repr(p), repr(o))) + result += 1 + return result + + +def _testNegative(uri, manifest): + if verbose: + write(u"TESTING: %s" % uri) + result = 0 # 1=failed, 0=passed + inDoc = first(manifest.objects(uri, TEST["inputDocument"])) + store = Graph() + + test = BNode() + results.add((test, RESULT["test"], uri)) + results.add((test, RESULT["system"], system)) + + try: + if inDoc[-3:] == ".nt": + format = "nt" + else: + format = "xml" + store.parse(cached_file(inDoc), publicID=inDoc, format=format) + except ParserError: + results.add((test, RDF.type, RESULT["PassingRun"])) + # pass + else: + write(u"""Failed: '%s'""" % uri) + results.add((test, RDF.type, RESULT["FailingRun"])) + result = 1 + return result + + +class ParserTestCase(unittest.TestCase): + store = 'default' + path = 'store' + slow = True + + def setUp(self): + self.manifest = manifest = Graph(store=self.store) + manifest.open(self.path) + manifest.load(cached_file( + "http://www.w3.org/2000/10/rdf-tests/rdfcore/Manifest.rdf")) + + def tearDown(self): + self.manifest.close() + + def testNegative(self): + manifest = self.manifest + num_failed = total = 0 + negs = list(manifest.subjects(RDF.type, TEST["NegativeParserTest"])) + negs.sort() + for neg in negs: + status = first(manifest.objects(neg, TEST["status"])) + if status == Literal("APPROVED"): + result = _testNegative(neg, manifest) + total += 1 + num_failed += result + self.assertEqual( + num_failed, 0, "Failed: %s of %s." % (num_failed, total)) + + def testPositive(self): + manifest = self.manifest + uris = list(manifest.subjects(RDF.type, TEST["PositiveParserTest"])) + uris.sort() + num_failed = total = 0 + for uri in uris: + status = first(manifest.objects(uri, TEST["status"])) + # Failing tests, skipped + if uri[44:] in skipped: + status = Literal("Locally DISAPPROVED") + write("Skipping %s" % uri) + if status == Literal("APPROVED"): + result = _testPositive(uri, manifest) + test = BNode() + results.add((test, RESULT["test"], uri)) + results.add((test, RESULT["system"], system)) + if not result: + results.add((test, RDF.type, RESULT["PassingRun"])) + else: + results.add((test, RDF.type, RESULT["FailingRun"])) + total += 1 + num_failed += result + self.assertEqual( + num_failed, 0, "Failed: %s of %s." % (num_failed, total)) + + +RESULT = Namespace("http://www.w3.org/2002/03owlt/resultsOntology#") +FOAF = Namespace("http://xmlns.com/foaf/0.1/") + + +results = Graph() + +system = BNode("system") +results.add((system, FOAF["homepage"], URIRef("http://rdflib.net/"))) +results.add((system, RDFS.label, Literal("RDFLib"))) +results.add((system, RDFS.comment, Literal(""))) + + +if __name__ == "__main__": + manifest = Graph() + manifest.load(cached_file( + "http://www.w3.org/2000/10/rdf-tests/rdfcore/Manifest.rdf")) + import sys + import getopt + try: + optlist, args = getopt.getopt(sys.argv[1:], 'h:', ["help"]) + except getopt.GetoptError as msg: + write(msg) + # usage() + + try: + argv = sys.argv + if len(argv) > 1: + _logger.setLevel(logging.INFO) + _logger.addHandler(logging.StreamHandler()) + + for arg in argv[1:]: + verbose = 1 + case = URIRef(arg) + write(u"Testing: %s" % case) + if (case, RDF.type, TEST["PositiveParserTest"]) in manifest: + result = _testPositive(case, manifest) + write(u"Positive test %s" % ["PASSED", "FAILED"][result]) + elif (case, RDF.type, TEST["NegativeParserTest"]) in manifest: + result = _testNegative(case, manifest) + write(u"Negative test %s" % ["PASSED", "FAILED"][result]) + else: + write(u"%s not ??" % case) + + if len(argv) <= 1: + unittest.main() + finally: + results.serialize("results.rdf") diff --git a/testbed/RDFLib__rdflib/test/test_roundtrip.py b/testbed/RDFLib__rdflib/test/test_roundtrip.py new file mode 100644 index 0000000000000000000000000000000000000000..819c944a9d50828fbdbb3073300da3589f808ef8 --- /dev/null +++ b/testbed/RDFLib__rdflib/test/test_roundtrip.py @@ -0,0 +1,101 @@ +import sys +import rdflib +import rdflib.compare + +try: + from .test_nt_suite import all_nt_files + assert all_nt_files +except: + from test.test_nt_suite import all_nt_files + +""" +Test round-tripping by all serializers/parser that are registerd. +This means, you may test more than just core rdflib! + +run with no arguments to test all formats + all files +run with a single argument, to test only that format, i.e. "n3" +run with three arguments to test round-tripping in a given format +and reading a single file in the given format, i.e.: + +python test/test_roundtrip.py xml nt test/nt/literals-02.nt + +tests roundtripping through rdf/xml with only the literals-02 file + +""" + + +SKIP = [ + ('xml', 'test/nt/qname-02.nt'), # uses a property that cannot be qname'd + # uses a property that cannot be qname'd + ('application/rdf+xml', 'test/nt/qname-02.nt'), +] + + +def roundtrip(e, verbose=False): + infmt, testfmt, source = e + + g1 = rdflib.ConjunctiveGraph() + + g1.parse(source, format=infmt) + + s = g1.serialize(format=testfmt) + + if verbose: + print("S:") + print(s) + + g2 = rdflib.ConjunctiveGraph() + g2.parse(data=s, format=testfmt) + + if verbose: + both, first, second = rdflib.compare.graph_diff(g1, g2) + print("Diff:") + print("%d triples in both" % len(both)) + print("G1 Only:") + for t in first: + print(t) + + print("--------------------") + print("G2 Only") + for t in second: + print(t) + + assert rdflib.compare.isomorphic(g1, g2) + + if verbose: + print("Ok!") + + +formats = None + + +def test_cases(): + global formats + if not formats: + serializers = set( + x.name for x in rdflib.plugin.plugins( + None, rdflib.plugin.Serializer)) + parsers = set( + x.name for x in rdflib.plugin.plugins( + None, rdflib.plugin.Parser)) + formats = parsers.intersection(serializers) + + for testfmt in formats: + if "/" in testfmt: + continue # skip double testing + for f, infmt in all_nt_files(): + if (testfmt, f) not in SKIP: + yield roundtrip, (infmt, testfmt, f) + + +if __name__ == "__main__": + import nose + if len(sys.argv) == 1: + nose.main(defaultTest=sys.argv[0]) + elif len(sys.argv) == 2: + import test.test_roundtrip + test.test_roundtrip.formats = [sys.argv[1]] + nose.main(defaultTest=sys.argv[0], argv=sys.argv[:1]) + else: + roundtrip( + (sys.argv[2], sys.argv[1], sys.argv[3]), verbose=True) diff --git a/testbed/RDFLib__rdflib/test/test_serializexml.py b/testbed/RDFLib__rdflib/test/test_serializexml.py new file mode 100644 index 0000000000000000000000000000000000000000..0dfa5e69d1f6f181997784f0b9287c2668ca2eaf --- /dev/null +++ b/testbed/RDFLib__rdflib/test/test_serializexml.py @@ -0,0 +1,158 @@ +from rdflib.term import URIRef, BNode +from rdflib.namespace import RDFS +from six import b, BytesIO + +from rdflib.plugins.serializers.rdfxml import XMLSerializer + +from rdflib.graph import ConjunctiveGraph + + +class SerializerTestBase(object): + + repeats = 8 + + def setup(self): + graph = ConjunctiveGraph() + graph.parse(data=self.testContent, format=self.testContentFormat) + self.sourceGraph = graph + + def test_serialize_and_reparse(self): + reparsedGraph = serialize_and_load(self.sourceGraph, self.serializer) + _assert_equal_graphs(self.sourceGraph, reparsedGraph) + + def test_multiple(self): + """Repeats ``test_serialize`` ``self.repeats`` times, to reduce sucess based on in-memory ordering.""" + for i in range(self.repeats): + self.test_serialize_and_reparse() + + # test_multiple.slowtest=True # not really slow? + + +def _assert_equal_graphs(g1, g2): + assert len(g1) == len(g2), "Serialized graph not same size as source graph." + g1copy = _mangled_copy(g1) + g2copy = _mangled_copy(g2) + g1copy -= _mangled_copy(g2) + g2copy -= _mangled_copy(g1) + assert len(g1copy) == 0, "Source graph larger than serialized graph." + assert len(g2copy) == 0, "Serialized graph larger than source graph." + + +_blank = BNode() + + +def _mangled_copy(g): + "Makes a copy of the graph, replacing all bnodes with the bnode ``_blank``." + gcopy = ConjunctiveGraph() + + def isbnode(v): return isinstance(v, BNode) + for s, p, o in g: + if isbnode(s): + s = _blank + if isbnode(p): + p = _blank + if isbnode(o): + o = _blank + gcopy.add((s, p, o)) + return gcopy + + +def serialize(sourceGraph, makeSerializer, getValue=True, extra_args={}): + serializer = makeSerializer(sourceGraph) + stream = BytesIO() + serializer.serialize(stream, **extra_args) + return getValue and stream.getvalue() or stream + + +def serialize_and_load(sourceGraph, makeSerializer): + stream = serialize(sourceGraph, makeSerializer, False) + stream.seek(0) + reparsedGraph = ConjunctiveGraph() + reparsedGraph.load(stream) + return reparsedGraph + + +class TestXMLSerializer(SerializerTestBase): + + serializer = XMLSerializer + + testContent = """ + @prefix rdfs: . + @prefix owl: . + @prefix : . + + :value rdfs:domain :Test . + + :Test rdfs:subClassOf + [ a owl:Restriction; + owl:onProperty :value ], + [ a owl:Restriction; + owl:onProperty :name ] . + + a :Test; + rdfs:seeAlso ; + :value "A" . + + + :name "Bee"@en, "Be"@sv; + :value "B" . + + a rdfs:Resource; + rdfs:seeAlso ; + :value 3 . + + a rdfs:Resource; + rdfs:seeAlso ; + rdfs:seeAlso ; + rdfs:seeAlso . + + _:bnode1 a :BNode; + rdfs:seeAlso _:bnode2 . + + _:bnode2 a :BNode ; + rdfs:seeAlso _:bnode3 . + + _:bnode3 a :BNode ; + rdfs:seeAlso _:bnode2 . + + """ + testContentFormat = 'n3' + + def test_result_fragments(self): + rdfXml = serialize(self.sourceGraph, self.serializer) + # print "--------" + # print rdfXml + # print "--------" + assert b('') in rdfXml + assert b('') in rdfXml + assert b('') in rdfXml + assert b('Bee') in rdfXml + assert b('3') in rdfXml + assert b('') in rdfXml + assert b('') in rdfXml + assert b('') in rdfXml + assert b('3') in rdfXml + assert b('." % (type(o), p) diff --git a/testbed/RDFLib__rdflib/test/test_slice.py b/testbed/RDFLib__rdflib/test/test_slice.py new file mode 100644 index 0000000000000000000000000000000000000000..27e6e49a3789910391310d699839ce32b239d166 --- /dev/null +++ b/testbed/RDFLib__rdflib/test/test_slice.py @@ -0,0 +1,81 @@ + +from rdflib import Graph, URIRef +import unittest + + +class GraphSlice(unittest.TestCase): + + def testSlice(self): + """ + We pervert the slice object, + and use start, stop, step as subject, predicate, object + + all operations return generators over full triples + """ + + def sl(x, y): return self.assertEqual(len(list(x)), y) + + def soe(x, y): return self.assertEqual( + set([a[2] for a in x]), set(y)) # equals objects + g = self.graph + + # Single terms are all trivial: + + # single index slices by subject, i.e. return triples((x,None,None)) + # tell me everything about "tarek" + sl(g[self.tarek], 2) + + # single slice slices by s,p,o, with : used to split + # tell me everything about "tarek" (same as above) + sl(g[self.tarek::], 2) + + # give me every "likes" relationship + sl(g[:self.likes:], 5) + + # give me every relationship to pizza + sl(g[::self.pizza], 3) + + # give me everyone who likes pizza + sl(g[:self.likes:self.pizza], 2) + + # does tarek like pizza? + self.assertTrue(g[self.tarek:self.likes:self.pizza]) + + # More intesting is using paths + + # everything hated or liked + sl(g[:self.hates | self.likes], 7) + + def setUp(self): + self.graph = Graph() + + self.michel = URIRef(u'michel') + self.tarek = URIRef(u'tarek') + self.bob = URIRef(u'bob') + self.likes = URIRef(u'likes') + self.hates = URIRef(u'hates') + self.pizza = URIRef(u'pizza') + self.cheese = URIRef(u'cheese') + + self.addStuff() + + def addStuff(self): + tarek = self.tarek + michel = self.michel + bob = self.bob + likes = self.likes + hates = self.hates + pizza = self.pizza + cheese = self.cheese + + self.graph.add((tarek, likes, pizza)) + self.graph.add((tarek, likes, cheese)) + self.graph.add((michel, likes, pizza)) + self.graph.add((michel, likes, cheese)) + self.graph.add((bob, likes, cheese)) + self.graph.add((bob, hates, pizza)) + self.graph.add((bob, hates, michel)) # gasp! + + +if __name__ == '__main__': + unittest.main() diff --git a/testbed/RDFLib__rdflib/test/test_sparql.py b/testbed/RDFLib__rdflib/test/test_sparql.py new file mode 100644 index 0000000000000000000000000000000000000000..c3f289fc010f73d2c7d2961e013ac7ccc1274918 --- /dev/null +++ b/testbed/RDFLib__rdflib/test/test_sparql.py @@ -0,0 +1,113 @@ +from rdflib import Graph, URIRef, Literal, BNode +from rdflib.plugins.sparql import prepareQuery +from rdflib.compare import isomorphic + +from nose.tools import eq_ + + +def test_graph_prefix(): + """ + This is issue https://github.com/RDFLib/rdflib/issues/313 + """ + + g1 = Graph() + g1.parse(data=""" + @prefix : . + :foo

42. + """, format="n3") + + g2 = Graph() + g2.parse(data=""" + @prefix : . +

42. + """, format="n3") + + assert isomorphic(g1, g2) + + q_str = (""" + PREFIX : + SELECT ?val + WHERE { :foo ?p ?val } + """) + q_prepared = prepareQuery(q_str) + + expected = [(Literal(42),)] + + eq_(list(g1.query(q_prepared)), expected) + eq_(list(g2.query(q_prepared)), expected) + + eq_(list(g1.query(q_str)), expected) + eq_(list(g2.query(q_str)), expected) + + +def test_variable_order(): + + g = Graph() + g.add((URIRef("http://foo"), URIRef("http://bar"), URIRef("http://baz"))) + res = g.query("SELECT (42 AS ?a) ?b { ?b ?c ?d }") + + row = list(res)[0] + print(row) + assert len(row) == 2 + assert row[0] == Literal(42) + assert row[1] == URIRef("http://foo") + + +def test_sparql_bnodelist(): + """ + + syntax tests for a few corner-cases not touched by the + official tests. + + """ + + prepareQuery('select * where { ?s ?p ( [] ) . }') + prepareQuery('select * where { ?s ?p ( [ ?p2 ?o2 ] ) . }') + prepareQuery('select * where { ?s ?p ( [ ?p2 ?o2 ] [] ) . }') + prepareQuery('select * where { ?s ?p ( [] [ ?p2 ?o2 ] [] ) . }') + + +def test_complex_sparql_construct(): + + g = Graph() + q = '''select ?subject ?study ?id where { + ?s a ; + ?c; + ?mother, ?father; + [ a ; ?id]. + }''' + g.query(q) + + +def test_sparql_update_with_bnode(): + """ + Test if the blank node is inserted correctly. + """ + graph = Graph() + graph.update( + "INSERT DATA { _:blankA }") + for t in graph.triples((None, None, None)): + assert isinstance(t[0], BNode) + eq_(t[1].n3(), "") + eq_(t[2].n3(), "") + + +def test_sparql_update_with_bnode_serialize_parse(): + """ + Test if the blank node is inserted correctly, can be serialized and parsed. + """ + graph = Graph() + graph.update( + "INSERT DATA { _:blankA }") + string = graph.serialize(format='ntriples').decode('utf-8') + raised = False + try: + Graph().parse(data=string, format="ntriples") + except Exception as e: + raised = True + assert not raised + + +if __name__ == '__main__': + import nose + nose.main(defaultTest=__name__) diff --git a/testbed/RDFLib__rdflib/test/test_sparql_agg_distinct.py b/testbed/RDFLib__rdflib/test/test_sparql_agg_distinct.py new file mode 100644 index 0000000000000000000000000000000000000000..7ab0f58af01abe2f69023ad04a4e01444353924f --- /dev/null +++ b/testbed/RDFLib__rdflib/test/test_sparql_agg_distinct.py @@ -0,0 +1,108 @@ +from rdflib import Graph + +query_tpl = ''' +SELECT ?x (MIN(?y_) as ?y) (%s(DISTINCT ?z_) as ?z) { + VALUES (?x ?y_ ?z_) { + ("x1" 10 1) + ("x1" 11 1) + ("x2" 20 2) + } +} GROUP BY ?x ORDER BY ?x +''' + + +def test_group_concat_distinct(): + g = Graph() + results = g.query(query_tpl % 'GROUP_CONCAT') + results = [[lit.toPython() for lit in line] for line in results] + + # this is the tricky part + assert results[0][2] == "1", results[0][2] + + # still check the whole result, to be on the safe side + assert results == [ + ["x1", 10, "1"], + ["x2", 20, "2"], + ], results + + +def test_sum_distinct(): + g = Graph() + results = g.query(query_tpl % 'SUM') + results = [[lit.toPython() for lit in line] for line in results] + + # this is the tricky part + assert results[0][2] == 1, results[0][2] + + # still check the whole result, to be on the safe side + assert results == [ + ["x1", 10, 1], + ["x2", 20, 2], + ], results + + +def test_avg_distinct(): + g = Graph() + results = g.query(""" + SELECT ?x (MIN(?y_) as ?y) (AVG(DISTINCT ?z_) as ?z) { + VALUES (?x ?y_ ?z_) { + ("x1" 10 1) + ("x1" 11 1) + ("x1" 12 3) + ("x2" 20 2) + } + } GROUP BY ?x ORDER BY ?x + """) + results = [[lit.toPython() for lit in line] for line in results] + + # this is the tricky part + assert results[0][2] == 2, results[0][2] + + # still check the whole result, to be on the safe side + assert results == [ + ["x1", 10, 2], + ["x2", 20, 2], + ], results + + +def test_count_distinct(): + g = Graph() + + g.parse(format="turtle", publicID="http://example.org/", data=""" + @prefix : <> . + + <#a> + :knows <#b>, <#c> ; + :age 42 . + + <#b> + :knows <#a>, <#c> ; + :age 36 . + + <#c> + :knows <#b>, <#c> ; + :age 20 . + + """) + + # Query 1: people knowing someone younger + results = g.query(""" + PREFIX : + + SELECT DISTINCT ?x { + ?x :age ?ax ; :knows [ :age ?ay ]. + FILTER( ?ax > ?ay ) + } + """) + assert len(results) == 2 + + # nQuery 2: count people knowing someone younger + results = g.query(""" + PREFIX : + + SELECT (COUNT(DISTINCT ?x) as ?cx) { + ?x :age ?ax ; :knows [ :age ?ay ]. + FILTER( ?ax > ?ay ) + } + """) + assert list(results)[0][0].toPython() == 2 diff --git a/testbed/RDFLib__rdflib/test/test_sparqlstore.py b/testbed/RDFLib__rdflib/test/test_sparqlstore.py new file mode 100644 index 0000000000000000000000000000000000000000..26a694603b5ea419a13aa29fd26b2d74dca1245d --- /dev/null +++ b/testbed/RDFLib__rdflib/test/test_sparqlstore.py @@ -0,0 +1,71 @@ +from rdflib import Graph, URIRef, Literal +from six.moves.urllib.request import urlopen +import os +import unittest +from nose import SkipTest +from requests import HTTPError + + +try: + assert len(urlopen("http://dbpedia.org/sparql").read()) > 0 +except: + raise SkipTest("No HTTP connection.") + + +class SPARQLStoreDBPediaTestCase(unittest.TestCase): + store_name = 'SPARQLStore' + path = "http://dbpedia.org/sparql" + storetest = True + create = False + + def setUp(self): + self.graph = Graph(store="SPARQLStore") + self.graph.open(self.path, create=self.create) + ns = list(self.graph.namespaces()) + assert len(ns) > 0, ns + + def tearDown(self): + self.graph.close() + + def test_Query(self): + query = "select distinct ?Concept where {[] a ?Concept} LIMIT 1" + res = self.graph.query(query, initNs={}) + for i in res: + assert type(i[0]) == URIRef, i[0].n3() + + def test_initNs(self): + query = """\ + SELECT ?label WHERE + { ?s a xyzzy:Concept ; xyzzy:prefLabel ?label . } LIMIT 10 + """ + res = self.graph.query( + query, + initNs={"xyzzy": "http://www.w3.org/2004/02/skos/core#"}) + for i in res: + assert type(i[0]) == Literal, i[0].n3() + + def test_noinitNs(self): + query = """\ + SELECT ?label WHERE + { ?s a xyzzy:Concept ; xyzzy:prefLabel ?label . } LIMIT 10 + """ + self.assertRaises( + HTTPError, + self.graph.query, + query) + + def test_query_with_added_prolog(self): + prologue = """\ + PREFIX xyzzy: + """ + query = """\ + SELECT ?label WHERE + { ?s a xyzzy:Concept ; xyzzy:prefLabel ?label . } LIMIT 10 + """ + res = self.graph.query(prologue + query) + for i in res: + assert type(i[0]) == Literal, i[0].n3() + + +if __name__ == '__main__': + unittest.main() diff --git a/testbed/RDFLib__rdflib/test/test_sparqlupdatestore.py b/testbed/RDFLib__rdflib/test/test_sparqlupdatestore.py new file mode 100644 index 0000000000000000000000000000000000000000..161ed6a079ea38844546196333957b81fc80b980 --- /dev/null +++ b/testbed/RDFLib__rdflib/test/test_sparqlupdatestore.py @@ -0,0 +1,340 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from nose import SkipTest + +import unittest +import re + +from rdflib import ConjunctiveGraph, URIRef, Literal, BNode, Graph +from six import text_type +from six.moves.urllib.request import urlopen + +HOST = 'http://localhost:3031' +DB = '/db/' + +# this assumes SPARQL1.1 query/update endpoints running locally at +# http://localhost:3031/db/ +# +# The ConjunctiveGraph tests below require that the SPARQL endpoint renders its +# default graph as the union of all known graphs! This is incompatible with the +# endpoint behavior required by our Dataset tests in test_dataset.py, so you +# need to run a second SPARQL endpoint on a non standard port, +# e.g. fuseki started with: +# ./fuseki-server --port 3031 --memTDB --update --set tdb:unionDefaultGraph=true /db + +# THIS WILL DELETE ALL DATA IN THE /db dataset + +michel = URIRef(u'urn:michel') +tarek = URIRef(u'urn:tarek') +bob = URIRef(u'urn:bob') +likes = URIRef(u'urn:likes') +hates = URIRef(u'urn:hates') +pizza = URIRef(u'urn:pizza') +cheese = URIRef(u'urn:cheese') + +graphuri = URIRef('urn:graph') +othergraphuri = URIRef('urn:othergraph') + + +class TestSparql11(unittest.TestCase): + + def setUp(self): + self.longMessage = True + self.graph = ConjunctiveGraph('SPARQLUpdateStore') + + root = HOST + DB + self.graph.open((root + "sparql", root + "update")) + + # clean out the store + for c in self.graph.contexts(): + c.remove((None, None, None)) + assert len(c) == 0 + + def tearDown(self): + self.graph.close() + + def testSimpleGraph(self): + g = self.graph.get_context(graphuri) + g.add((tarek, likes, pizza)) + g.add((bob, likes, pizza)) + g.add((bob, likes, cheese)) + + g2 = self.graph.get_context(othergraphuri) + g2.add((michel, likes, pizza)) + + self.assertEqual(3, len(g), 'graph contains 3 triples') + self.assertEqual(1, len(g2), 'other graph contains 1 triple') + + r = g.query("SELECT * WHERE { ?s . }") + self.assertEqual(2, len(list(r)), "two people like pizza") + + r = g.triples((None, likes, pizza)) + self.assertEqual(2, len(list(r)), "two people like pizza") + + # Test initBindings + r = g.query("SELECT * WHERE { ?s . }", + initBindings={'s': tarek}) + self.assertEqual(1, len(list(r)), "i was asking only about tarek") + + r = g.triples((tarek, likes, pizza)) + self.assertEqual(1, len(list(r)), "i was asking only about tarek") + + r = g.triples((tarek, likes, cheese)) + self.assertEqual(0, len(list(r)), "tarek doesn't like cheese") + + g2.add((tarek, likes, pizza)) + g.remove((tarek, likes, pizza)) + r = g.query("SELECT * WHERE { ?s . }") + self.assertEqual(1, len(list(r)), "only bob likes pizza") + + def testConjunctiveDefault(self): + g = self.graph.get_context(graphuri) + g.add((tarek, likes, pizza)) + g2 = self.graph.get_context(othergraphuri) + g2.add((bob, likes, pizza)) + g.add((tarek, hates, cheese)) + + self.assertEqual(2, len(g), 'graph contains 2 triples') + + # the following are actually bad tests as they depend on your endpoint, + # as pointed out in the sparqlstore.py code: + # + # For ConjunctiveGraphs, reading is done from the "default graph" Exactly + # what this means depends on your endpoint, because SPARQL does not offer a + # simple way to query the union of all graphs as it would be expected for a + # ConjuntiveGraph. + ## + # Fuseki/TDB has a flag for specifying that the default graph + # is the union of all graphs (tdb:unionDefaultGraph in the Fuseki config). + self.assertEqual(3, len(self.graph), + 'default union graph should contain three triples but contains:\n' + '%s' % list(self.graph)) + + r = self.graph.query("SELECT * WHERE { ?s . }") + self.assertEqual(2, len(list(r)), "two people like pizza") + + r = self.graph.query("SELECT * WHERE { ?s . }", + initBindings={'s': tarek}) + self.assertEqual(1, len(list(r)), "i was asking only about tarek") + + r = self.graph.triples((tarek, likes, pizza)) + self.assertEqual(1, len(list(r)), "i was asking only about tarek") + + r = self.graph.triples((tarek, likes, cheese)) + self.assertEqual(0, len(list(r)), "tarek doesn't like cheese") + + g2.remove((bob, likes, pizza)) + + r = self.graph.query("SELECT * WHERE { ?s . }") + self.assertEqual(1, len(list(r)), "only tarek likes pizza") + + def testUpdate(self): + self.graph.update("INSERT DATA { GRAPH { . } }") + + g = self.graph.get_context(graphuri) + self.assertEqual(1, len(g), 'graph contains 1 triples') + + def testUpdateWithInitNs(self): + self.graph.update( + "INSERT DATA { GRAPH ns:graph { ns:michel ns:likes ns:pizza . } }", + initNs={'ns': URIRef('urn:')} + ) + + g = self.graph.get_context(graphuri) + self.assertEqual( + set(g.triples((None, None, None))), + set([(michel, likes, pizza)]), + 'only michel likes pizza' + ) + + def testUpdateWithInitBindings(self): + self.graph.update( + "INSERT { GRAPH { ?a ?b ?c . } } WherE { }", + initBindings={ + 'a': URIRef('urn:michel'), + 'b': URIRef('urn:likes'), + 'c': URIRef('urn:pizza'), + } + ) + + g = self.graph.get_context(graphuri) + self.assertEqual( + set(g.triples((None, None, None))), + set([(michel, likes, pizza)]), + 'only michel likes pizza' + ) + + def testUpdateWithBlankNode(self): + self.graph.update( + "INSERT DATA { GRAPH { _:blankA } }") + g = self.graph.get_context(graphuri) + for t in g.triples((None, None, None)): + self.assertTrue(isinstance(t[0], BNode)) + self.assertEqual(t[1].n3(), "") + self.assertEqual(t[2].n3(), "") + + def testUpdateWithBlankNodeSerializeAndParse(self): + self.graph.update( + "INSERT DATA { GRAPH { _:blankA } }") + g = self.graph.get_context(graphuri) + string = g.serialize(format='ntriples').decode('utf-8') + raised = False + try: + Graph().parse(data=string, format="ntriples") + except Exception as e: + raised = True + self.assertFalse(raised, 'Exception raised when parsing: ' + string) + + def testMultipleUpdateWithInitBindings(self): + self.graph.update( + "INSERT { GRAPH { ?a ?b ?c . } } WHERE { };" + "INSERT { GRAPH { ?d ?b ?c . } } WHERE { }", + initBindings={ + 'a': URIRef('urn:michel'), + 'b': URIRef('urn:likes'), + 'c': URIRef('urn:pizza'), + 'd': URIRef('urn:bob'), + } + ) + + g = self.graph.get_context(graphuri) + self.assertEqual( + set(g.triples((None, None, None))), + set([(michel, likes, pizza), (bob, likes, pizza)]), + 'michel and bob like pizza' + ) + + def testNamedGraphUpdate(self): + g = self.graph.get_context(graphuri) + r1 = "INSERT DATA { }" + g.update(r1) + self.assertEqual( + set(g.triples((None, None, None))), + set([(michel, likes, pizza)]), + 'only michel likes pizza' + ) + + r2 = "DELETE { } " + \ + "INSERT { } WHERE {}" + g.update(r2) + self.assertEqual( + set(g.triples((None, None, None))), + set([(bob, likes, pizza)]), + 'only bob likes pizza' + ) + says = URIRef("urn:says") + + # Strings with unbalanced curly braces + tricky_strs = ["With an unbalanced curly brace %s " % brace + for brace in ["{", "}"]] + for tricky_str in tricky_strs: + r3 = """INSERT { ?b "%s" } + WHERE { ?b } """ % tricky_str + g.update(r3) + + values = set() + for v in g.objects(bob, says): + values.add(str(v)) + self.assertEqual(values, set(tricky_strs)) + + # Complicated Strings + r4strings = [] + r4strings.append(r'''"1: adfk { ' \\\" \" { "''') + r4strings.append(r'''"2: adfk } #éï \\"''') + + r4strings.append(r"""'3: adfk { " \\\' \' { '""") + r4strings.append(r"""'4: adfk } #éï \\'""") + + r4strings.append(r'''"""5: adfk { ' \\\" \" { """''') + r4strings.append(r'''"""6: adfk } #éï \\"""''') + r4strings.append('"""7: ad adsfj \n { \n sadfj"""') + + r4strings.append(r"""'''8: adfk { " \\\' \' { '''""") + r4strings.append(r"""'''9: adfk } #éï \\'''""") + r4strings.append("'''10: ad adsfj \n { \n sadfj'''") + + r4 = "\n".join([ + u'INSERT DATA { %s } ;' % s + for s in r4strings + ]) + g.update(r4) + values = set() + for v in g.objects(michel, says): + values.add(text_type(v)) + self.assertEqual(values, set([re.sub(r"\\(.)", r"\1", re.sub( + r"^'''|'''$|^'|'$|" + r'^"""|"""$|^"|"$', r"", s)) for s in r4strings])) + + # IRI Containing ' or # + # The fragment identifier must not be misinterpreted as a comment + # (commenting out the end of the block). + # The ' must not be interpreted as the start of a string, causing the } + # in the literal to be identified as the end of the block. + r5 = """INSERT DATA { , "'}" }""" + + g.update(r5) + values = set() + for v in g.objects(michel, hates): + values.add(text_type(v)) + self.assertEqual(values, set([u"urn:foo'bar?baz;a=1&b=2#fragment", u"'}"])) + + # Comments + r6 = u""" + INSERT DATA { + . # No closing brace: } + . + } + #Final { } comment""" + + g.update(r6) + values = set() + for v in g.objects(bob, hates): + values.add(v) + self.assertEqual(values, set([bob, michel])) + + def testNamedGraphUpdateWithInitBindings(self): + g = self.graph.get_context(graphuri) + r = "INSERT { ?a ?b ?c } WHERE {}" + g.update(r, initBindings={ + 'a': michel, + 'b': likes, + 'c': pizza + }) + self.assertEqual( + set(g.triples((None, None, None))), + set([(michel, likes, pizza)]), + 'only michel likes pizza' + ) + + def testEmptyNamedGraph(self): + empty_graph_iri = "urn:empty-graph-1" + self.graph.update("CREATE GRAPH <%s>" % empty_graph_iri) + named_graphs = [text_type(r[0]) for r in self.graph.query( + "SELECT ?name WHERE { GRAPH ?name {} }")] + # Some SPARQL endpoint backends (like TDB) are not able to find empty named graphs + # (at least with this query) + if empty_graph_iri in named_graphs: + self.assertTrue(empty_graph_iri in [text_type(g.identifier) + for g in self.graph.contexts()]) + + def testEmptyLiteral(self): + # test for https://github.com/RDFLib/rdflib/issues/457 + # also see test_issue457.py which is sparql store independent! + g = self.graph.get_context(graphuri) + g.add(( + URIRef('http://example.com/s'), + URIRef('http://example.com/p'), + Literal(''))) + + o = tuple(g)[0][2] + self.assertEqual(o, Literal(''), repr(o)) + + +try: + assert len(urlopen(HOST).read()) > 0 +except: + raise SkipTest(HOST + " is unavailable.") + + +if __name__ == '__main__': + unittest.main() diff --git a/testbed/RDFLib__rdflib/test/test_swap_n3.py b/testbed/RDFLib__rdflib/test/test_swap_n3.py new file mode 100644 index 0000000000000000000000000000000000000000..c81378e144d089aabd36506c84976fdc3f16204f --- /dev/null +++ b/testbed/RDFLib__rdflib/test/test_swap_n3.py @@ -0,0 +1,154 @@ +from nose.exc import SkipTest +import os +import sys +import unittest +try: + maketrans = str.maketrans +except AttributeError: + from string import maketrans +import rdflib + +""" +SWAP N3 parser test suite +""" + +rdf = rdflib.Namespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#") +rdfs = rdflib.Namespace("http://www.w3.org/2000/01/rdf-schema#") +xsd = rdflib.Namespace("http://www.w3.org/2001/XMLSchema#") +owl = rdflib.Namespace("http://www.w3.org/2002/07/owl#") +test = rdflib.Namespace("http://www.w3.org/2000/10/swap/test.n3#") +n3test = rdflib.Namespace("http://www.w3.org/2004/11/n3test#") +rdft = rdflib.Namespace("http://www.w3.org/2000/10/rdf-tests/rdfcore/testSchema#") +triage = rdflib.Namespace("http://www.w3.org/2000/10/swap/test/triage#") +mf = rdflib.Namespace("http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#") +qt = rdflib.Namespace("http://www.w3.org/2001/sw/DataAccess/tests/test-query#") + + +# class TestSWAPN3(unittest.TestCase): +# """SWAP 2000/10/n3 tests""" + +# def setUp(self): + +# def test_foo(self): +# """footest""" +# self.graph.parse(os.getcwd()+'/test/swap-n3/n3-rdf.tests', format="n3") +# tfiles = [] +# for tst in self.graph.subjects(): +# files = [str(tfile).replace('http://www.w3.org/2000/10/', 'file://'+os.getcwd()+'/test/swap-n3/') +# for tfile in self.graph.objects(tst, rdflib.URIRef("http://www.w3.org/2004/11/n3test#inputDocument")) if tfile.endswith('n3')] +# tfiles += files +# for tfile in tfiles: +# self.graph.parse(tfile, format="n3") + + +skiptests = [ + 'syntax_neg_single_quote', + 'syntax_neg_literal_predicate', + 'syntax_this_quantifiers', + 'syntax_trailing_semicolon', + 'syntax_neg_thisadoc', + 'syntax_equals1', + 'syntax_equals2', + 'syntax_this_rules', + 'syntax_neg_keywords3', + 'syntax_zero_objects', + 'syntax_neg_formula_predicate', + 'syntax_zero_predicates', + # 'syntax_qvars1', + # 'syntax_qvars2', + # 'contexts', + 'syntax_too_nested' +] + + +class Envelope(object): + def __init__(self, n, f): + self.name = n + self.file = f + + def __repr__(self): + return self.name + + +def generictest(e): + """Documentation""" + if e.skip: + raise SkipTest("%s skipped, known issue" % e.name) + g = rdflib.Graph() + for i in [rdf, rdfs, xsd, owl, test, n3test, rdft, triage, mf, qt]: + g.bind(str(i), i) + g.parse(e.file, format="n3") + + +def dir_to_uri(directory, sep=os.path.sep): + ''' + Convert a local path to a File URI. + + >>> dir_to_uri('c:\\\\temp\\\\foo\\\\file.txt', sep='\\\\') + 'file:///c:/temp/foo/file.txt' + + >>> dir_to_uri('/tmp/foo/file.txt', sep='/') + 'file:///tmp/foo/file.txt' + ''' + items = directory.split(sep) + path = '/'.join(items) + if path.startswith('/'): + path = path[1:] + return 'file:///%s' % (path,) + + +def test_cases(): + from copy import deepcopy + g = rdflib.Graph() + swap_dir = os.path.join(os.getcwd(), 'test', 'swap-n3') + g.parse(os.path.join(swap_dir, 'n3-rdf.tests'), format="n3") + g.parse(os.path.join(swap_dir, 'n3-full.tests'), format="n3") + tfiles = [] + swap_dir_uri = dir_to_uri(swap_dir) + '/' + for tst in g.subjects(): + files = [str(tfile).replace('http://www.w3.org/2000/10/', swap_dir_uri) + for tfile in g.objects(tst, rdflib.URIRef("http://www.w3.org/2004/11/n3test#inputDocument")) if tfile.endswith('n3')] + tfiles += files + for tfile in set(tfiles): + gname = tfile.split('/swap-n3/swap/test/')[1][:-3].translate(maketrans('-/','__')) + e = Envelope(gname, tfile) + if gname in skiptests: + e.skip = True + else: + e.skip = False + # e.skip = True + if sys.version_info[:2] == (2, 4): + import pickle + gjt = pickle.dumps(generictest) + gt = pickle.loads(gjt) + else: + gt = deepcopy(generictest) + gt.__doc__ = tfile + yield gt, e + + +if __name__ == "__main__": + test_cases() + # unittest.main() + + +""" +Interesting failure in Python 2.4 ... + +====================================================================== +ERROR: Failure: TypeError (function() takes at least 2 arguments (0 given)) +---------------------------------------------------------------------- +Traceback (most recent call last): + File ".../python2.4/site-packages/nose/loader.py", line 231, in generate + for test in g(): + File ".../rdflib/test/test_swap_n3.py", line 95, in test_cases + gt = deepcopy(generictest) + File "/usr/local/python2.4/lib/python2.4/copy.py", line 204, in deepcopy + y = _reconstruct(x, rv, 1, memo) + File "/usr/local/python2.4/lib/python2.4/copy.py", line 336, in _reconstruct + y = callable(*args) + File "...py24/lib/python2.4/copy_reg.py", line 92, in __newobj__ + return cls.__new__(cls, *args) +TypeError: function() takes at least 2 arguments (0 given) + +""" diff --git a/testbed/RDFLib__rdflib/test/test_term.py b/testbed/RDFLib__rdflib/test/test_term.py new file mode 100644 index 0000000000000000000000000000000000000000..c222a8d29d070c01184f13c074c632c4b42478d6 --- /dev/null +++ b/testbed/RDFLib__rdflib/test/test_term.py @@ -0,0 +1,140 @@ +""" +some more specific Literal tests are in test_literal.py +""" + +import base64 +import unittest +import random + +from rdflib.term import URIRef, BNode, Literal, _is_valid_unicode +from rdflib.graph import QuotedGraph, Graph +from rdflib.namespace import XSD + +from six import PY3 + + +def uformat(s): + if PY3: + return s.replace("u'", "'") + return s + + +class TestURIRefRepr(unittest.TestCase): + """ + see also test_literal.TestRepr + """ + + def testSubclassNameAppearsInRepr(self): + class MyURIRef(URIRef): + pass + x = MyURIRef('http://example.com/') + self.assertEqual(repr(x), uformat("MyURIRef(u'http://example.com/')")) + + def testGracefulOrdering(self): + u = URIRef('cake') + g = Graph() + a = u > u + a = u > BNode() + a = u > QuotedGraph(g.store, u) + a = u > g + + +class TestBNodeRepr(unittest.TestCase): + + def testSubclassNameAppearsInRepr(self): + class MyBNode(BNode): + pass + x = MyBNode() + self.assertTrue(repr(x).startswith("MyBNode(")) + + +class TestLiteral(unittest.TestCase): + + def test_base64_values(self): + b64msg = 'cmRmbGliIGlzIGNvb2whIGFsc28gaGVyZSdzIHNvbWUgYmluYXJ5IAAR83UC' + decoded_b64msg = base64.b64decode(b64msg) + lit = Literal(b64msg, datatype=XSD.base64Binary) + self.assertEqual(lit.value, decoded_b64msg) + self.assertEqual(str(lit), b64msg) + + def test_total_order(self): + types = { + XSD.dateTime: ( + '2001-01-01T00:00:00', + '2001-01-01T00:00:00Z', + '2001-01-01T00:00:00-00:00' + ), + XSD.date: ( + '2001-01-01', + '2001-01-01Z', + '2001-01-01-00:00' + ), + XSD.time: ( + '00:00:00', + '00:00:00Z', + '00:00:00-00:00' + ), + XSD.gYear: ( + '2001', + '2001Z', + '2001-00:00' + ), # interval + XSD.gYearMonth: ( + '2001-01', + '2001-01Z', + '2001-01-00:00' + ), + } + literals = [ + Literal(literal, datatype=t) + for t, literals in types.items() + for literal in literals + ] + try: + sorted(literals) + orderable = True + except TypeError as e: + for l in literals: + print(repr(l), repr(l.value)) + print(e) + orderable = False + self.assertTrue(orderable) + + # also make sure that within a datetime things are still ordered: + l1 = [ + Literal(l, datatype=XSD.dateTime) + for l in [ + '2001-01-01T00:00:00', + '2001-01-01T01:00:00', + '2001-01-01T01:00:01', + '2001-01-02T01:00:01', + '2001-01-01T00:00:00Z', + '2001-01-01T00:00:00-00:00', + '2001-01-01T01:00:00Z', + '2001-01-01T01:00:00-00:00', + '2001-01-01T00:00:00-01:30', + '2001-01-01T01:00:00-01:30', + '2001-01-02T01:00:01Z', + '2001-01-02T01:00:01-00:00', + '2001-01-02T01:00:01-01:30' + ] + ] + l2 = list(l1) + random.shuffle(l2) + self.assertListEqual(l1, sorted(l2)) + + +class TestValidityFunctions(unittest.TestCase): + + def test_is_valid_unicode(self): + testcase_list = ( + (None, True), + (1, True), + (['foo'], True), + ({'foo': b'bar'}, True), + ('foo', True), + (b'foo\x00', True), + (b'foo\xf3\x02', False) + ) + for val, expected in testcase_list: + self.assertEqual(_is_valid_unicode(val), expected) diff --git a/testbed/RDFLib__rdflib/test/test_trig_w3c.py b/testbed/RDFLib__rdflib/test/test_trig_w3c.py new file mode 100644 index 0000000000000000000000000000000000000000..bb8588e070df2f88003e6f89e40e9b37190b3966 --- /dev/null +++ b/testbed/RDFLib__rdflib/test/test_trig_w3c.py @@ -0,0 +1,85 @@ +"""Runs the tests for the W3C RDF Working Group's TriG test suite. + +""" + +from rdflib import ConjunctiveGraph +from rdflib.namespace import split_uri +from rdflib.compare import graph_diff, isomorphic + +from .manifest import nose_tests, RDFT +from .testutils import nose_tst_earl_report + +verbose = False + + +def trig(test): + g = ConjunctiveGraph() + + try: + base = 'http://www.w3.org/2013/TriGTests/' + split_uri(test.action)[1] + + g.parse(test.action, publicID=base, format='trig') + if not test.syntax: + raise AssertionError("Input shouldn't have parsed!") + + if test.result: # eval test + res = ConjunctiveGraph() + res.parse(test.result, format='nquads') + + if verbose: + + both, first, second = graph_diff(g, res) + if not first and not second: + return + + print('===============================') + print('TriG') + print(g.serialize(format='nquads')) + print('===============================') + print('NQuads') + print(res.serialize(format='nquads')) + print('===============================') + + print("Diff:") + # print "%d triples in both"%len(both) + print("TriG Only:") + for t in first: + print(t) + + print("--------------------") + print("NQuads Only") + for t in second: + print(t) + raise Exception('Graphs do not match!') + + assert isomorphic(g, res), 'graphs must be the same' + + except: + if test.syntax: + raise + + +testers = { + RDFT.TestTrigPositiveSyntax: trig, + RDFT.TestTrigNegativeSyntax: trig, + RDFT.TestTrigEval: trig, + RDFT.TestTrigNegativeEval: trig +} + + +def test_trig(tests=None): + for t in nose_tests(testers, 'test/w3c/trig/manifest.ttl'): + if tests: + for test in tests: + if test in t[1].uri: + break + else: + continue + + yield t + + +if __name__ == '__main__': + verbose = True + + nose_tst_earl_report(test_trig, 'rdflib_trig') diff --git a/testbed/RDFLib__rdflib/test/test_trix_parse.py b/testbed/RDFLib__rdflib/test/test_trix_parse.py new file mode 100644 index 0000000000000000000000000000000000000000..1b0f9fb9ab612a2277122db6c5433a411d00edb2 --- /dev/null +++ b/testbed/RDFLib__rdflib/test/test_trix_parse.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python + + +from rdflib.graph import ConjunctiveGraph +import unittest + + +class TestTrixParse(unittest.TestCase): + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAperture(self): + + g = ConjunctiveGraph() + + g.parse("test/trix/aperture.trix", format="trix") + c = list(g.contexts()) + + # print list(g.contexts()) + t = sum(map(len, g.contexts())) + + self.assertEqual(t, 24) + self.assertEqual(len(c), 4) + + # print "Parsed %d triples"%t + + def testSpec(self): + + g = ConjunctiveGraph() + + g.parse("test/trix/nokia_example.trix", format="trix") + + # print "Parsed %d triples"%len(g) + + def testNG4j(self): + + g = ConjunctiveGraph() + + g.parse("test/trix/ng4jtest.trix", format="trix") + + # print "Parsed %d triples"%len(g) + + +if __name__ == '__main__': + unittest.main() diff --git a/testbed/RDFLib__rdflib/test/test_trix_serialize.py b/testbed/RDFLib__rdflib/test/test_trix_serialize.py new file mode 100644 index 0000000000000000000000000000000000000000..f1b68de4623ae98334fc964dde02f6eb1cd5d260 --- /dev/null +++ b/testbed/RDFLib__rdflib/test/test_trix_serialize.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python + +import unittest + +from rdflib.graph import ConjunctiveGraph +from rdflib.term import URIRef, Literal +from rdflib.graph import Graph +from six import BytesIO + + +class TestTrixSerialize(unittest.TestCase): + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSerialize(self): + + s1 = URIRef('store:1') + r1 = URIRef('resource:1') + r2 = URIRef('resource:2') + + label = URIRef('predicate:label') + + g1 = Graph(identifier=s1) + g1.add((r1, label, Literal("label 1", lang="en"))) + g1.add((r1, label, Literal("label 2"))) + + s2 = URIRef('store:2') + g2 = Graph(identifier=s2) + g2.add((r2, label, Literal("label 3"))) + + g = ConjunctiveGraph() + for s, p, o in g1.triples((None, None, None)): + g.addN([(s, p, o, g1)]) + for s, p, o in g2.triples((None, None, None)): + g.addN([(s, p, o, g2)]) + r3 = URIRef('resource:3') + g.add((r3, label, Literal(4))) + + r = g.serialize(format='trix') + g3 = ConjunctiveGraph() + + g3.parse(BytesIO(r), format='trix') + + for q in g3.quads((None, None, None)): + # TODO: Fix once getGraph/getContext is in conjunctive graph + if isinstance(q[3].identifier, URIRef): + tg = Graph(store=g.store, identifier=q[3].identifier) + else: + # BNode, this is a bit ugly + # we cannot match the bnode to the right graph automagically + # here I know there is only one anonymous graph, + # and that is the default one, but this is not always the case + tg = g.default_context + self.assertTrue(q[0:3] in tg) + + def test_issue_250(self): + """ + + https://github.com/RDFLib/rdflib/issues/250 + + When I have a ConjunctiveGraph with the default namespace set, + for example + + import rdflib + g = rdflib.ConjunctiveGraph() + g.bind(None, "http://defaultnamespace") + + then the Trix serializer binds the default namespace twice in its XML + output, once for the Trix namespace and once for the namespace I used: + + print(g.serialize(format='trix').decode('UTF-8')) + + + + + """ + + graph = ConjunctiveGraph() + graph.bind(None, "http://defaultnamespace") + sg = graph.serialize(format='trix').decode('UTF-8') + self.assertTrue( + 'xmlns="http://defaultnamespace"' not in sg, sg) + self.assertTrue( + 'xmlns="http://www.w3.org/2004/03/trix/trix-1/' in sg, sg) + + +if __name__ == '__main__': + unittest.main() diff --git a/testbed/RDFLib__rdflib/test/test_tsvresults.py b/testbed/RDFLib__rdflib/test/test_tsvresults.py new file mode 100644 index 0000000000000000000000000000000000000000..d5222a34eae472fe41d14546aec1a76e8564b1b8 --- /dev/null +++ b/testbed/RDFLib__rdflib/test/test_tsvresults.py @@ -0,0 +1,20 @@ +import unittest +from six import StringIO +from rdflib.plugins.sparql.results.tsvresults import TSVResultParser + + +class TestTSVResults(unittest.TestCase): + + def test_empty_tsvresults_bindings(self): + # check that optional bindings are ordered properly + source = """?s\t?p\t?o + \t\t + \t\t + \t\t""" + + parser = TSVResultParser() + source = StringIO(source) + result = parser.parse(source) + + for idx, row in enumerate(result): + self.assertTrue(row[idx] is None) diff --git a/testbed/RDFLib__rdflib/test/test_turtle_serialize.py b/testbed/RDFLib__rdflib/test/test_turtle_serialize.py new file mode 100644 index 0000000000000000000000000000000000000000..0b602b347f1d5f78de795e9c1d82e2d45216c003 --- /dev/null +++ b/testbed/RDFLib__rdflib/test/test_turtle_serialize.py @@ -0,0 +1,76 @@ +from rdflib import Graph, URIRef, BNode, RDF, Literal, Namespace +from rdflib.collection import Collection +from rdflib.plugins.serializers.turtle import TurtleSerializer +from six import b + + +def testTurtleFinalDot(): + """ + https://github.com/RDFLib/rdflib/issues/282 + """ + + g = Graph() + u = URIRef("http://ex.org/bob.") + g.bind("ns", "http://ex.org/") + g.add((u, u, u)) + s = g.serialize(format='turtle') + assert b("ns:bob.") not in s + + +def testTurtleBoolList(): + subject = URIRef("http://localhost/user") + predicate = URIRef("http://localhost/vocab#hasList") + g1 = Graph() + list_item1 = BNode() + list_item2 = BNode() + list_item3 = BNode() + g1.add((subject, predicate, list_item1)) + g1.add((list_item1, RDF.first, Literal(True))) + g1.add((list_item1, RDF.rest, list_item2)) + g1.add((list_item2, RDF.first, Literal(False))) + g1.add((list_item2, RDF.rest, list_item3)) + g1.add((list_item3, RDF.first, Literal(True))) + g1.add((list_item3, RDF.rest, RDF.nil)) + + ttl_dump = g1.serialize(format="turtle") + g2 = Graph() + g2.parse(data=ttl_dump, format="turtle") + + list_id = g2.value(subject, predicate) + bool_list = [i.toPython() for i in Collection(g2, list_id)] + assert bool_list == [True, False, True] + + +def testUnicodeEscaping(): + turtle_string = " . . ." + g = Graph() + + # shouldn't get an exception + g.parse(data=turtle_string, format="turtle") + triples = sorted(list(g)) + assert len(triples) == 3 + print(triples) + # Now check that was decoded into python values properly + assert triples[0][2] == URIRef(u'http://example.com/aaa\xf3bbbb') + assert triples[1][2] == URIRef(u'http://example.com/zzz\U00100000zzz') + assert triples[2][2] == URIRef(u'http://example.com/aaa\xf3bbb') + + +def test_turtle_valid_list(): + NS = Namespace('http://example.org/ns/') + g = Graph() + g.parse(data=""" + @prefix : <{0}> . + :s :p (""), (0), (false) . + """.format(NS), format='turtle') + + turtle_serializer = TurtleSerializer(g) + + for o in g.objects(NS.s, NS.p): + assert turtle_serializer.isValidList(o) + + +if __name__ == "__main__": + import nose + import sys + nose.main(defaultTest=sys.argv[0]) diff --git a/testbed/RDFLib__rdflib/test/test_turtle_sort_issue613.py b/testbed/RDFLib__rdflib/test/test_turtle_sort_issue613.py new file mode 100644 index 0000000000000000000000000000000000000000..f81cba335cab02b3a80b3a2a35d4b61a6b75b797 --- /dev/null +++ b/testbed/RDFLib__rdflib/test/test_turtle_sort_issue613.py @@ -0,0 +1,40 @@ +import rdflib + +""" +In py3, some objects are not comparable. When the turtle serializer tries to sort them everything breaks. + +* Timezone aware datetime objects and "naive" datetime objects are not comparable + +https://github.com/RDFLib/rdflib/issues/648 +https://github.com/RDFLib/rdflib/issues/613 + +* DocumentFragment +https://github.com/RDFLib/rdflib/issues/676 + +""" + + +def test_sort_dates(): + + g = rdflib.Graph() + y = '''@prefix ex: . +ex:X ex:p "2016-01-01T00:00:00"^^, "2016-01-01T00:00:00Z"^^ . ''' + + p = g.parse(data=y, format="turtle") + p.serialize(format="turtle") + + +def test_sort_docfrag(): + + g = rdflib.Graph() + y = '''@prefix ex: . +@prefix rdf: . +ex:X ex:p "

hi

"^^rdf:HTML, "

ho

"^^rdf:HTML . ''' + + p = g.parse(data=y, format="turtle") + p.serialize(format="turtle") + + +if __name__ == '__main__': + + test_sort_docfrag() diff --git a/testbed/RDFLib__rdflib/test/test_turtle_w3c.py b/testbed/RDFLib__rdflib/test/test_turtle_w3c.py new file mode 100644 index 0000000000000000000000000000000000000000..469ed02383733bc44fc80bbc277daa482e36e228 --- /dev/null +++ b/testbed/RDFLib__rdflib/test/test_turtle_w3c.py @@ -0,0 +1,76 @@ +"""This runs the turtle tests for the W3C RDF Working Group's N-Quads +test suite.""" + +from rdflib import Graph +from rdflib.namespace import split_uri +from rdflib.compare import graph_diff, isomorphic + +from .manifest import nose_tests, RDFT +from .testutils import nose_tst_earl_report + +verbose = False + + +def turtle(test): + g = Graph() + + try: + base = 'http://www.w3.org/2013/TurtleTests/' + split_uri(test.action)[1] + + g.parse(test.action, publicID=base, format='turtle') + if not test.syntax: + raise AssertionError("Input shouldn't have parsed!") + + if test.result: # eval test + res = Graph() + res.parse(test.result, format='nt') + + if verbose: + both, first, second = graph_diff(g, res) + if not first and not second: + return + print("Diff:") + # print "%d triples in both"%len(both) + print("Turtle Only:") + for t in first: + print(t) + + print("--------------------") + print("NT Only") + for t in second: + print(t) + raise Exception('Graphs do not match!') + + assert isomorphic(g, res), 'graphs must be the same' + + except: + if test.syntax: + raise + + +testers = { + RDFT.TestTurtlePositiveSyntax: turtle, + RDFT.TestTurtleNegativeSyntax: turtle, + RDFT.TestTurtleEval: turtle, + RDFT.TestTurtleNegativeEval: turtle +} + + +def test_turtle(tests=None): + for t in nose_tests(testers, + 'test/w3c/turtle/manifest.ttl'): + if tests: + for test in tests: + if test in t[1].uri: + break + else: + continue + + yield t + + +if __name__ == '__main__': + + verbose = True + + nose_tst_earl_report(test_turtle, 'rdflib_turtle') diff --git a/testbed/RDFLib__rdflib/test/test_util.py b/testbed/RDFLib__rdflib/test/test_util.py new file mode 100644 index 0000000000000000000000000000000000000000..61e5b33c2ccef0c654a3f7cc91b651a713afc93b --- /dev/null +++ b/testbed/RDFLib__rdflib/test/test_util.py @@ -0,0 +1,350 @@ +import unittest +import time +from rdflib.graph import Graph +from rdflib.graph import QuotedGraph +from rdflib.graph import ConjunctiveGraph +from rdflib.term import BNode +from rdflib.term import Literal +from rdflib.term import URIRef +from rdflib import util +from rdflib import XSD +from rdflib.exceptions import SubjectTypeError +from rdflib.exceptions import PredicateTypeError +from rdflib.exceptions import ObjectTypeError +from rdflib.exceptions import ContextTypeError + +n3source = """\ +@prefix : . +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix dc: . +@prefix foo: . +@prefix swap: . + +<> dc:title + "Primer - Getting into the Semantic Web and RDF using N3". + +<#pat> <#knows> <#jo> . +<#pat> <#age> 24 . +<#al> is <#child> of <#pat> . + +<#pat> <#child> <#al>, <#chaz>, <#mo> ; + <#age> 24 ; + <#eyecolor> "blue" . + +:Person a rdfs:Class. + +:Pat a :Person. + +:Woman a rdfs:Class; rdfs:subClassOf :Person . + +:sister a rdf:Property. + +:sister rdfs:domain :Person; + rdfs:range :Woman. + +:Woman = foo:FemaleAdult . +:Title a rdf:Property; = dc:title . + +""" # --- End of primer code + + +class TestUtilMisc(unittest.TestCase): + def setUp(self): + self.x = Literal("2008-12-01T18:02:00Z", + datatype=URIRef('http://www.w3.org/2001/XMLSchema#dateTime')) + + def test_util_list2set(self): + base = [Literal('foo'), self.x] + r = util.list2set(base + base) + self.assertTrue(r == base) + + def test_util_uniq(self): + base = ["michel", "hates", "pizza"] + r = util.uniq(base + base) + self.assertEqual(sorted(r), sorted(base)) + base = ["michel", "hates", "pizza"] + r = util.uniq(base + base, strip=True) + self.assertEqual(sorted(r), sorted(base)) + + def test_coverage_dodge(self): + util.test() + + +class TestUtilDateTime(unittest.TestCase): + + def setUp(self): + self.x = Literal("2008-12-01T18:02:00Z", + datatype=URIRef('http://www.w3.org/2001/XMLSchema#dateTime')) + + def test_util_date_time_tisnoneandnotz(self): + t = None + res = util.date_time(t, local_time_zone=False) + self.assertTrue(res[4:5] == "-") + + def test_util_date_time_tisnonebuttz(self): + t = None + res = util.date_time(t, local_time_zone=True) + self.assertTrue(res[4:5] == "-") + + def test_util_date_time_tistime(self): + t = time.time() + res = util.date_time(t, local_time_zone=False) + self.assertTrue(res[4:5] == "-") + + def test_util_date_time_tistimewithtz(self): + t = time.time() + res = util.date_time(t, local_time_zone=True) + self.assertTrue(res[4:5] == "-") + + def test_util_parse_date_time(self): + t = time.time() + res = util.parse_date_time("1970-01-01") + self.assertTrue(res is not t) + + def test_util_parse_date_timewithtz(self): + t = time.time() + res = util.parse_date_time("1970-01-01") + self.assertTrue(res is not t) + + def test_util_date_timewithtoutz(self): + t = time.time() + + def ablocaltime(t): + from time import gmtime + res = gmtime(t) + return res + util.localtime = ablocaltime + res = util.date_time(t, local_time_zone=True) + self.assertTrue(res is not t) + + +class TestUtilTermConvert(unittest.TestCase): + def setUp(self): + self.x = Literal("2008-12-01T18:02:00Z", + datatype=URIRef('http://www.w3.org/2001/XMLSchema#dateTime')) + + def test_util_to_term_sisNone(self): + s = None + self.assertEqual(util.to_term(s), s) + self.assertEqual(util.to_term(s, default=""), "") + + def test_util_to_term_sisstr(self): + s = '"http://example.com"' + res = util.to_term(s) + self.assertTrue(isinstance(res, Literal)) + self.assertEqual(str(res), s[1:-1]) + + def test_util_to_term_sisurl(self): + s = "" + res = util.to_term(s) + self.assertTrue(isinstance(res, URIRef)) + self.assertEqual(str(res), s[1:-1]) + + def test_util_to_term_sisbnode(self): + s = '_http%23%4F%4Fexample%33com' + res = util.to_term(s) + self.assertTrue(isinstance(res, BNode)) + + def test_util_to_term_sisunknown(self): + s = 'http://example.com' + self.assertRaises(Exception, util.to_term, s) + + def test_util_to_term_sisnotstr(self): + s = self.x + self.assertRaises(Exception, util.to_term, s) + + def test_util_from_n3_sisnonenodefault(self): + s = None + default = None + res = util.from_n3(s, default=default, backend=None) + self.assertTrue(res == default) + + def test_util_from_n3_sisnonewithdefault(self): + s = None + default = "TestofDefault" + res = util.from_n3(s, default=default, backend=None) + self.assertTrue(res == default) + + def test_util_from_n3_expectdefaultbnode(self): + s = "michel" + res = util.from_n3(s, default=None, backend=None) + self.assertTrue(isinstance(res, BNode)) + + def test_util_from_n3_expectbnode(self): + s = "_:michel" + res = util.from_n3(s, default=None, backend=None) + self.assertTrue(isinstance(res, BNode)) + + def test_util_from_n3_expectliteral(self): + s = '"michel"' + res = util.from_n3(s, default=None, backend=None) + self.assertTrue(isinstance(res, Literal)) + + def test_util_from_n3_expecturiref(self): + s = '' + res = util.from_n3(s, default=None, backend=None) + self.assertTrue(isinstance(res, URIRef)) + + def test_util_from_n3_expectliteralandlang(self): + s = '"michel"@fr' + res = util.from_n3(s, default=None, backend=None) + self.assertTrue(isinstance(res, Literal)) + + def test_util_from_n3_expectliteralandlangdtype(self): + s = '"michel"@fr^^xsd:fr' + res = util.from_n3(s, default=None, backend=None) + self.assertTrue(isinstance(res, Literal)) + self.assertEqual(res, Literal('michel', + datatype=XSD['fr'])) + + def test_util_from_n3_expectliteralanddtype(self): + s = '"true"^^xsd:boolean' + res = util.from_n3(s, default=None, backend=None) + self.assertTrue(res.eq(Literal('true', datatype=XSD['boolean']))) + + def test_util_from_n3_expectliteralwithdatatypefromint(self): + s = '42' + res = util.from_n3(s) + self.assertEqual(res, Literal(42)) + + def test_util_from_n3_expectliteralwithdatatypefrombool(self): + s = 'true' + res = util.from_n3(s) + self.assertEqual(res, Literal(True)) + s = 'false' + res = util.from_n3(s) + self.assertEqual(res, Literal(False)) + + def test_util_from_n3_expectliteralmultiline(self): + s = '"""multi\nline\nstring"""@en' + res = util.from_n3(s, default=None, backend=None) + self.assertTrue(res, Literal('multi\nline\nstring', lang='en')) + + def test_util_from_n3_expectliteralwithescapedquote(self): + s = '"\\""' + res = util.from_n3(s, default=None, backend=None) + self.assertTrue(res, Literal('\\"', lang='en')) + + def test_util_from_n3_expectliteralwithtrailingbackslash(self): + s = '"trailing\\\\"^^' + res = util.from_n3(s) + self.assertTrue(res, Literal('trailing\\', datatype=XSD['string'])) + self.assertTrue(res.n3(), s) + + def test_util_from_n3_expectpartialidempotencewithn3(self): + for n3 in ('', + '"foo"@de', + # '"\\""', # exception as '\\"' --> '"' by orig parser as well + '"""multi\n"line"\nstring"""@en'): + self.assertEqual(util.from_n3(n3).n3(), n3, + 'from_n3(%(n3e)r).n3() != %(n3e)r' % {'n3e': n3}) + + def test_util_from_n3_expectsameasn3parser(self): + def parse_n3(term_n3): + ''' Disclaimer: Quick and dirty hack using the n3 parser. ''' + prepstr = ("@prefix xsd: .\n" + " %s.\n" % term_n3) + g = ConjunctiveGraph() + g.parse(data=prepstr, format='n3') + return [t for t in g.triples((None, None, None))][0][2] + + for n3 in ( # "michel", # won't parse in original parser + # "_:michel", # BNodes won't be the same + '"michel"', + '', + '"michel"@fr', + # '"michel"@fr^^xsd:fr', # FIXME: invalid n3, orig parser will prefer datatype + # '"true"^^xsd:boolean', # FIXME: orig parser will expand xsd prefix + '42', + 'true', + 'false', + '"""multi\nline\nstring"""@en', + '', + '"foo"@de', + '"\\""@en', + '"""multi\n"line"\nstring"""@en'): + res, exp = util.from_n3(n3), parse_n3(n3) + self.assertEqual(res, exp, + 'from_n3(%(n3e)r): %(res)r != parser.notation3: %(exp)r' % { + 'res': res, 'exp': exp, 'n3e': n3}) + + def test_util_from_n3_expectquotedgraph(self): + s = '{}' + res = util.from_n3(s, default=None, backend="IOMemory") + self.assertTrue(isinstance(res, QuotedGraph)) + + def test_util_from_n3_expectgraph(self): + s = '[]' + res = util.from_n3(s, default=None, backend="IOMemory") + self.assertTrue(isinstance(res, Graph)) + + +class TestUtilCheckers(unittest.TestCase): + def setUp(self): + self.c = URIRef("http://example.com") + self.s = BNode("http://example.com") + self.p = URIRef("http://example.com/predicates/isa") + self.o = Literal("Objectification") + + def test_util_checker_exceptions(self): + c = "http://example.com" + self.assertRaises(ContextTypeError, util.check_context, c) + self.assertRaises(SubjectTypeError, util.check_subject, c) + self.assertRaises(PredicateTypeError, util.check_predicate, c) + self.assertRaises(ObjectTypeError, util.check_object, c) + + def test_util_check_context(self): + res = util.check_context(self.c) + self.assertTrue(res == None) + + def test_util_check_subject(self): + res = util.check_subject(self.s) + self.assertTrue(res == None) + + def test_util_check_predicate(self): + res = util.check_predicate(self.p) + self.assertTrue(res == None) + + def test_util_check_object(self): + res = util.check_object(self.o) + self.assertTrue(res == None) + + def test_util_check_statement(self): + c = "http://example.com" + self.assertRaises( + SubjectTypeError, + util.check_statement, + (c, self.p, self.o)) + self.assertRaises( + PredicateTypeError, + util.check_statement, + (self.s, c, self.o)) + self.assertRaises( + ObjectTypeError, + util.check_statement, + (self.s, self.p, c)) + res = util.check_statement((self.s, self.p, self.o)) + self.assertTrue(res == None) + + def test_util_check_pattern(self): + c = "http://example.com" + self.assertRaises( + SubjectTypeError, + util.check_pattern, + (c, self.p, self.o)) + self.assertRaises( + PredicateTypeError, + util.check_pattern, + (self.s, c, self.o)) + self.assertRaises( + ObjectTypeError, + util.check_pattern, + (self.s, self.p, c)) + res = util.check_pattern((self.s, self.p, self.o)) + self.assertTrue(res == None) + + +if __name__ == "__main__": + unittest.main() diff --git a/testbed/RDFLib__rdflib/test/test_wide_python.py b/testbed/RDFLib__rdflib/test/test_wide_python.py new file mode 100644 index 0000000000000000000000000000000000000000..feef4519ba8a12001c662d698eeea02eaccbbf8d --- /dev/null +++ b/testbed/RDFLib__rdflib/test/test_wide_python.py @@ -0,0 +1,14 @@ + +def test_wide_python_build(): + """This test is meant to fail on narrow python builds (common on Mac OS X). + + See https://github.com/RDFLib/rdflib/issues/456 for more information. + """ + assert len(u'\U0010FFFF') == 1, ( + 'You are using a narrow Python build!\n' + 'This means that your Python does not properly support chars > 16bit.\n' + 'On your system chars like c=u"\\U0010FFFF" will have a len(c)==2.\n' + 'As this can cause hard to debug problems with string processing\n' + '(slicing, regexp, ...) later on, we strongly advise to use a wide\n' + 'Python build in production systems.' + ) diff --git a/testbed/RDFLib__rdflib/test/test_xmlliterals.py b/testbed/RDFLib__rdflib/test/test_xmlliterals.py new file mode 100644 index 0000000000000000000000000000000000000000..b467e82a3758891dbe28369f7f0b2dc19d541165 --- /dev/null +++ b/testbed/RDFLib__rdflib/test/test_xmlliterals.py @@ -0,0 +1,84 @@ +import rdflib +from rdflib import RDF, Graph, Literal + + +def testPythonRoundtrip(): + l1 = Literal('hello', datatype=RDF.XMLLiteral) + assert l1.value is not None, 'xml must have been parsed' + assert l1.datatype == RDF.XMLLiteral, 'literal must have right datatype' + + l2 = Literal('good morning', datatype=RDF.XMLLiteral) + assert l2.value is not None, 'xml must have been parsed' + assert not l1.eq(l2), 'literals must NOT be equal' + + l3 = Literal(l1.value) + assert l1.eq(l3), 'roundtripped literals must be equal' + assert l3.datatype == RDF.XMLLiteral, 'literal must have right datatype' + + l4 = Literal('hello', datatype=RDF.XMLLiteral) + assert l1 == l4 + assert l1.eq(l4) + + rdflib.NORMALIZE_LITERALS = False + l4 = Literal('hello', datatype=RDF.XMLLiteral) + assert l1 != l4 + assert l1.eq(l4) + rdflib.NORMALIZE_LITERALS = True + + +def testRDFXMLParse(): + rdfxml = """\ + + + + +

+
+
+ +
""" + + g = rdflib.Graph() + g.parse(data=rdfxml) + l1 = list(g)[0][2] + assert l1.datatype == RDF.XMLLiteral + + +def graph(): + g = rdflib.Graph() + g.add((rdflib.URIRef('http://example.org/a'), + rdflib.URIRef('http://example.org/p'), + rdflib.Literal('hei', datatype=RDF.XMLLiteral))) + return g + + +def roundtrip(fmt): + g1 = graph() + l1 = list(g1)[0][2] + g2 = rdflib.Graph() + g2.parse(data=g1.serialize(format=fmt), format=fmt) + l2 = list(g2)[0][2] + assert l1.eq(l2) + + +def testRoundtrip(): + roundtrip('xml') + roundtrip('n3') + roundtrip('nt') + + +def testHTML(): + + l1 = Literal('hello', datatype=RDF.XMLLiteral) + assert l1.value is not None, 'xml must have been parsed' + assert l1.datatype == RDF.XMLLiteral, 'literal must have right datatype' + + l2 = Literal('hello', datatype=RDF.HTML) + assert l2.value is not None, 'xml must have been parsed' + assert l2.datatype == RDF.HTML, 'literal must have right datatype' + + assert l1 != l2 + assert not l1.eq(l2) diff --git a/testbed/RDFLib__rdflib/test/testutils.py b/testbed/RDFLib__rdflib/test/testutils.py new file mode 100644 index 0000000000000000000000000000000000000000..02bc4b231af0d82af3db04f27c0298475a13b6eb --- /dev/null +++ b/testbed/RDFLib__rdflib/test/testutils.py @@ -0,0 +1,103 @@ +from __future__ import print_function + +import sys +import isodate +import datetime + +from traceback import print_exc +from nose import SkipTest +from .earl import add_test, report + +from rdflib import BNode, Graph, ConjunctiveGraph + + +# TODO: make an introspective version (like this one) of +# rdflib.graphutils.isomorphic and use instead. +def crapCompare(g1, g2): + """A really crappy way to 'check' if two graphs are equal. It ignores blank + nodes completely and ignores subgraphs.""" + if len(g1) != len(g2): + raise Exception("Graphs dont have same length") + for t in g1: + s = _no_blank(t[0]) + o = _no_blank(t[2]) + if not (s, t[1], o) in g2: + e = "(%s, %s, %s) is not in both graphs!" % (s, t[1], o) + raise Exception(e) + + +def _no_blank(node): + if isinstance(node, BNode): + return None + if isinstance(node, Graph): + return None # node._Graph__identifier = _SQUASHED_NODE + return node + + +def check_serialize_parse(fpath, infmt, testfmt, verbose=False): + g = ConjunctiveGraph() + _parse_or_report(verbose, g, fpath, format=infmt) + if verbose: + for t in g: + print(t) + print("========================================") + print("Parsed OK!") + s = g.serialize(format=testfmt) + if verbose: + print(s) + g2 = ConjunctiveGraph() + _parse_or_report(verbose, g2, data=s, format=testfmt) + if verbose: + print(g2.serialize()) + crapCompare(g, g2) + + +def _parse_or_report(verbose, graph, *args, **kwargs): + try: + graph.parse(*args, **kwargs) + except: + if verbose: + print("========================================") + print("Error in parsing serialization:") + print(args, kwargs) + raise + + +def nose_tst_earl_report(generator, earl_report_name=None): + from optparse import OptionParser + p = OptionParser() + (options, args) = p.parse_args() + + skip = 0 + tests = 0 + success = 0 + + for t in generator(args): + tests += 1 + print('Running ', t[1].uri) + try: + t[0](t[1]) + add_test(t[1].uri, "passed") + success += 1 + except SkipTest as e: + add_test(t[1].uri, "untested", e.message) + print("skipping %s - %s" % (t[1].uri, e.message)) + skip += 1 + + except KeyboardInterrupt: + raise + except AssertionError: + add_test(t[1].uri, "failed") + except: + add_test(t[1].uri, "failed", "error") + print_exc() + sys.stderr.write("%s\n" % t[1].uri) + + print("Ran %d tests, %d skipped, %d failed. "%(tests, skip, tests-skip-success)) + if earl_report_name: + now = isodate.datetime_isoformat(datetime.datetime.utcnow()) + earl_report = 'test_reports/%s-%s.ttl' % (earl_report_name, now) + + report.serialize(earl_report, format='n3') + report.serialize('test_reports/%s-latest.ttl'%earl_report_name, format='n3') + print("Wrote EARL-report to '%s'" % earl_report) diff --git a/testbed/RDFLib__rdflib/test/triple_store.py b/testbed/RDFLib__rdflib/test/triple_store.py new file mode 100644 index 0000000000000000000000000000000000000000..b9c5221ab0bd0ce70d59101279afe8ae9810792a --- /dev/null +++ b/testbed/RDFLib__rdflib/test/triple_store.py @@ -0,0 +1,35 @@ +import unittest + +from rdflib.term import BNode, Literal +from rdflib.namespace import RDFS +from rdflib.graph import Graph + + +class GraphTest(unittest.TestCase): + backend = 'default' + path = 'store' + + def setUp(self): + self.store = Graph(store=self.backend) + self.store.open(self.path) + self.remove_me = (BNode(), RDFS.label, Literal("remove_me")) + self.store.add(self.remove_me) + + def tearDown(self): + self.store.close() + + def testAdd(self): + subject = BNode() + self.store.add((subject, RDFS.label, Literal("foo"))) + + def testRemove(self): + self.store.remove(self.remove_me) + self.store.remove((None, None, None)) + + def testTriples(self): + for s, p, o in self.store: + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/testbed/RDFLib__rdflib/test/type_check.py b/testbed/RDFLib__rdflib/test/type_check.py new file mode 100644 index 0000000000000000000000000000000000000000..605f09161778229343e5e2a59858e71c826eab68 --- /dev/null +++ b/testbed/RDFLib__rdflib/test/type_check.py @@ -0,0 +1,34 @@ +import unittest + +from rdflib.graph import Graph +from rdflib.exceptions import SubjectTypeError +from rdflib.exceptions import PredicateTypeError +from rdflib.exceptions import ObjectTypeError +from rdflib.term import URIRef + +foo = URIRef("foo") + + +class TypeCheckCase(unittest.TestCase): + unstable = True # TODO: until we decide if we want to add type checking back to rdflib + backend = 'default' + path = 'store' + + def setUp(self): + self.store = Graph(backend=self.backend) + self.store.open(self.path) + + def tearDown(self): + self.store.close() + + def testSubjectTypeCheck(self): + self.assertRaises(SubjectTypeError, + self.store.add, (None, foo, foo)) + + def testPredicateTypeCheck(self): + self.assertRaises(PredicateTypeError, + self.store.add, (foo, None, foo)) + + def testObjectTypeCheck(self): + self.assertRaises(ObjectTypeError, + self.store.add, (foo, foo, None)) diff --git a/testbed/RDFLib__rdflib/test_reports/rdflib_nquads-2013-12-22T19:22:34.ttl b/testbed/RDFLib__rdflib/test_reports/rdflib_nquads-2013-12-22T19:22:34.ttl new file mode 100644 index 0000000000000000000000000000000000000000..344e186111dde9af8c0a4812bb6c71d51854c0ed --- /dev/null +++ b/testbed/RDFLib__rdflib/test_reports/rdflib_nquads-2013-12-22T19:22:34.ttl @@ -0,0 +1,697 @@ +@prefix dc: . +@prefix doap: . +@prefix earl: . +@prefix foaf: . +@prefix rdf: . +@prefix rdfs: . +@prefix xml: . +@prefix xsd: . + + a foaf:Person ; + foaf:homepage ; + foaf:name "Gunnar Aastrand Grimnes" . + + a doap:Project ; + doap:homepage ; + doap:name "rdflib" . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + diff --git a/testbed/RDFLib__rdflib/test_reports/rdflib_nt-2013-12-22T19:12:25.ttl b/testbed/RDFLib__rdflib/test_reports/rdflib_nt-2013-12-22T19:12:25.ttl new file mode 100644 index 0000000000000000000000000000000000000000..24dc06a4bb943f4b1d27043135cb26f8149f94d5 --- /dev/null +++ b/testbed/RDFLib__rdflib/test_reports/rdflib_nt-2013-12-22T19:12:25.ttl @@ -0,0 +1,401 @@ +@prefix dc: . +@prefix doap: . +@prefix earl: . +@prefix foaf: . +@prefix rdf: . +@prefix rdfs: . +@prefix xml: . +@prefix xsd: . + + a foaf:Person ; + foaf:homepage ; + foaf:name "Gunnar Aastrand Grimnes" . + + a doap:Project ; + doap:homepage ; + doap:name "rdflib" . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:12:25.300887"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + diff --git a/testbed/RDFLib__rdflib/test_reports/rdflib_sparql-2013-12-22T19:36:48.ttl b/testbed/RDFLib__rdflib/test_reports/rdflib_sparql-2013-12-22T19:36:48.ttl new file mode 100644 index 0000000000000000000000000000000000000000..1e2b4f9b6fdffd99638c9ae033556bf00cce3618 --- /dev/null +++ b/testbed/RDFLib__rdflib/test_reports/rdflib_sparql-2013-12-22T19:36:48.ttl @@ -0,0 +1,6021 @@ +@prefix dc: . +@prefix doap: . +@prefix earl: . +@prefix foaf: . +@prefix rdf: . +@prefix rdfs: . +@prefix xml: . +@prefix xsd: . + + a foaf:Person ; + foaf:homepage ; + foaf:name "Gunnar Aastrand Grimnes" . + + a doap:Project ; + doap:homepage ; + doap:name "rdflib" . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "xsd:date not supported" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "service not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "service not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "service not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "service not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "service not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "service not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "known issue with update and datasets" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "known issue with update and datasets" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "service not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "xsd:date not supported" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:info "entailment not implemented" ; + earl:outcome earl:untested ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:34:58.715073"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + diff --git a/testbed/RDFLib__rdflib/test_reports/rdflib_trig-2013-12-22T19:31:52.ttl b/testbed/RDFLib__rdflib/test_reports/rdflib_trig-2013-12-22T19:31:52.ttl new file mode 100644 index 0000000000000000000000000000000000000000..325759f19e5adb87df221f56d46b58316d38129e --- /dev/null +++ b/testbed/RDFLib__rdflib/test_reports/rdflib_trig-2013-12-22T19:31:52.ttl @@ -0,0 +1,1609 @@ +@prefix dc: . +@prefix doap: . +@prefix earl: . +@prefix foaf: . +@prefix rdf: . +@prefix rdfs: . +@prefix xml: . +@prefix xsd: . + + a foaf:Person ; + foaf:homepage ; + foaf:name "Gunnar Aastrand Grimnes" . + + a doap:Project ; + doap:homepage ; + doap:name "rdflib" . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:31:52.081600"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + diff --git a/testbed/RDFLib__rdflib/test_reports/rdflib_trig-2013-12-30T15:56:57.ttl b/testbed/RDFLib__rdflib/test_reports/rdflib_trig-2013-12-30T15:56:57.ttl new file mode 100644 index 0000000000000000000000000000000000000000..84bbbc0697ba828f983a5ebcfee47cf3972d6bac --- /dev/null +++ b/testbed/RDFLib__rdflib/test_reports/rdflib_trig-2013-12-30T15:56:57.ttl @@ -0,0 +1,2697 @@ +@prefix dc: . +@prefix doap: . +@prefix earl: . +@prefix foaf: . +@prefix rdf: . +@prefix rdfs: . +@prefix xml: . +@prefix xsd: . + + a foaf:Person ; + foaf:homepage ; + foaf:name "Gunnar Aastrand Grimnes" . + + a doap:Project ; + doap:homepage ; + doap:name "rdflib" . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-30T16:56:55.925293"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + diff --git a/testbed/RDFLib__rdflib/test_reports/rdflib_turtle-2013-12-22T19:13:51.ttl b/testbed/RDFLib__rdflib/test_reports/rdflib_turtle-2013-12-22T19:13:51.ttl new file mode 100644 index 0000000000000000000000000000000000000000..22bc440bcdb2226f1be99138518b0a735b54833c --- /dev/null +++ b/testbed/RDFLib__rdflib/test_reports/rdflib_turtle-2013-12-22T19:13:51.ttl @@ -0,0 +1,2313 @@ +@prefix dc: . +@prefix doap: . +@prefix earl: . +@prefix foaf: . +@prefix rdf: . +@prefix rdfs: . +@prefix xml: . +@prefix xsd: . + + a foaf:Person ; + foaf:homepage ; + foaf:name "Gunnar Aastrand Grimnes" . + + a doap:Project ; + doap:homepage ; + doap:name "rdflib" . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + +[] a earl:Assertion ; + dc:date "2013-12-22T20:13:50.860387"^^xsd:dateTime ; + earl:assertedBy ; + earl:result [ a earl:TestResult ; + earl:outcome earl:passed ] ; + earl:subject ; + earl:test . + diff --git a/testbed/RDFLib__rdflib/tox.ini b/testbed/RDFLib__rdflib/tox.ini new file mode 100644 index 0000000000000000000000000000000000000000..ee712287d460c3384933e0a1cdbddfb3c9b2565b --- /dev/null +++ b/testbed/RDFLib__rdflib/tox.ini @@ -0,0 +1,36 @@ +[tox] +envlist = + py27,py34,py35,py36 + +[testenv] +setenv = + BERKELEYDB_DIR = /usr +commands = + {envpython} setup.py clean --all + {envpython} setup.py build + {envpython} run_tests.py --with-xunit +deps = + nose + isodate + html5lib + pyparsing + bsddb3 + six + SPARQLWrapper>=1.6.2 + +[testenv:cover] +basepython = + python2.7 +commands = + {envpython} run_tests.py --where=./ \ + --with-coverage --cover-html --cover-html-dir=./coverage \ + --cover-package=rdflib --cover-inclusive +deps = + coverage + nose + isodate + html5lib + pyparsing + bsddb3 + six + SPARQLWrapper>=1.6.2 diff --git a/testbed/Textualize__rich/.github/FUNDING.yml b/testbed/Textualize__rich/.github/FUNDING.yml new file mode 100644 index 0000000000000000000000000000000000000000..2d926775af03b85c2bef899e9a97d6ba173a5f75 --- /dev/null +++ b/testbed/Textualize__rich/.github/FUNDING.yml @@ -0,0 +1,4 @@ +# These are supported funding model platforms + +github: willmcgugan +custom: https://www.willmcgugan.com/sponsorship/ diff --git a/testbed/Textualize__rich/.github/ISSUE_TEMPLATE/bug_report.md b/testbed/Textualize__rich/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000000000000000000000000000000000000..8d1af54e7e023abd50ae4d7595d7aeba80c81969 --- /dev/null +++ b/testbed/Textualize__rich/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,17 @@ +--- +name: Bug report +about: Create a report to help us improve +title: "[BUG]" +labels: Needs triage +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +A minimal code example that reproduces the problem would be a big help if you can provide it. If the issue is visual in nature, consider posting a screenshot. + +**Platform** +What platform (Win/Linux/Mac) are you running on? What terminal software are you using. Which version of Rich? diff --git a/testbed/Textualize__rich/.github/ISSUE_TEMPLATE/feature_request.md b/testbed/Textualize__rich/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000000000000000000000000000000000000..ab4de7198de9fc662d811890affd80e787a9758a --- /dev/null +++ b/testbed/Textualize__rich/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: "[REQUEST]" +labels: Needs triage +assignees: '' + +--- + +Consider posting in https://github.com/willmcgugan/rich/discussions for feedback before raising a feature request. + +Have you checked the issues for a similar suggestions? + +**How would you improve Rich?** + +Give as much detail as you can. Example code of how you would like it to work would help. + +**What problem does it solved for you?** + +What problem do you have that this feature would solve? I may be able to suggest an existing way of solving it. diff --git a/testbed/Textualize__rich/.github/dependabot.yml b/testbed/Textualize__rich/.github/dependabot.yml new file mode 100644 index 0000000000000000000000000000000000000000..cf7a39fb649eddd8458214d7a797bceb39adb28f --- /dev/null +++ b/testbed/Textualize__rich/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "pip" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "daily" diff --git a/testbed/Textualize__rich/.github/workflows/pythonpackage.yml b/testbed/Textualize__rich/.github/workflows/pythonpackage.yml new file mode 100644 index 0000000000000000000000000000000000000000..9685a6f5ace357f234565adf1a3b65713fd147d2 --- /dev/null +++ b/testbed/Textualize__rich/.github/workflows/pythonpackage.yml @@ -0,0 +1,45 @@ +name: Test Rich module + +on: [pull_request] + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [windows-latest, ubuntu-latest, macos-latest] + python-version: [3.6, 3.7, 3.8, 3.9] + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@v1 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + architecture: x64 + - name: Install and configure Poetry + uses: snok/install-poetry@v1.1.1 + with: + version: 1.1.4 + virtualenvs-create: false + - name: Install dependencies + run: poetry install + if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' + - name: Format check with black + run: make format-check + - name: Typecheck with mypy + run: make typecheck + - name: Test with pytest + run: | + pip install . + python -m pytest tests -v --cov=./rich --cov-report=xml:./coverage.xml --cov-report term-missing + - name: Upload code coverage + uses: codecov/codecov-action@v1.0.10 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./coverage.xml + name: rich + flags: unittests + env_vars: OS,PYTHON diff --git a/testbed/Textualize__rich/.gitignore b/testbed/Textualize__rich/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..bc0dfdb715bc7ff7078f1dffc7132f63905432ba --- /dev/null +++ b/testbed/Textualize__rich/.gitignore @@ -0,0 +1,114 @@ +*.ipynb +.pytype +.DS_Store +.vscode +mypy_report +docs/build +docs/source/_build +tools/*.txt +playground/ + +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# pyenv +.python-version + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ diff --git a/testbed/Textualize__rich/.readthedocs.yml b/testbed/Textualize__rich/.readthedocs.yml new file mode 100644 index 0000000000000000000000000000000000000000..05c863a93dd968675df9b4df6b1e047ae315660d --- /dev/null +++ b/testbed/Textualize__rich/.readthedocs.yml @@ -0,0 +1,19 @@ +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Build documentation in the docs/ directory with Sphinx +sphinx: + configuration: docs/source/conf.py + +# Optionally build your docs in additional formats such as PDF and ePub +formats: all + +python: + version: 3.7 + install: + - requirements: docs/requirements.txt + - method: pip + path: . diff --git a/testbed/Textualize__rich/CHANGELOG.md b/testbed/Textualize__rich/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..a0f1d036c67871d71e2873a42aa538a8be8ce6ba --- /dev/null +++ b/testbed/Textualize__rich/CHANGELOG.md @@ -0,0 +1,1107 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [9.8.0] + +- Allow passing markdown over STDIN when using `python -m rich.markdown` + +## [9.7.0] - 2021-01-09 + +### Added + +- Added rich.tree +- Added no_color argument to Console + +## [9.6.2] - 2021-01-07 + +### Fixed + +- Fixed markup escaping edge case https://github.com/willmcgugan/rich/issues/878 +- Double tag escape, i.e. `"\\[foo]"` results in a backslash plus `[foo]` tag + +## [9.6.1] - 2020-12-31 + +### Fixed + +- Fixed encoding error on Windows when loading code for Tracebacks + +## [9.6.0] - 2020-12-30 + +### Changed + +- MarkupError exception raise from None to omit internal exception +- Factored out RichHandler.render and RichHandler.render_message for easier extending +- Display pretty printed value in rich.inspect + +### Added + +- Added Progress.TimeElapsedColumn +- Added IPython support to pretty.install + +### Fixed + +- Fixed display of locals in Traceback for stdin + +## [9.5.1] - 2020-12-19 + +### Fixed + +- Fixed terminal size detection on Windows https://github.com/willmcgugan/rich/issues/836 +- Fixed hex number highlighting + +## [9.5.0] - 2020-12-18 + +### Changed + +- If file is not specified on Console then the Console.file will return the current sys.stdout. Prior to 9.5.0 sys.stdout was cached on the Console, which could break code that wrapped sys.stdout after the Console was constructed. +- Changed `Color.__str__` to not include ansi codes +- Changed Console.size to get the terminal dimensions via sys.stdin. This means that if you set file to be an io.StringIO file then the width will be set to the current terminal dimensions and not a default of 80. + +### Added + +- Added stderr parameter to Console +- Added rich.reconfigure +- Added `Color.__rich__` +- Added Console.soft_wrap +- Added Console.style parameter +- Added Table.highlight parameter to enable highlighting of cells +- Added Panel.highlight parameter to enable highlighting of panel title +- Added highlight to ConsoleOptions + +### Fixed + +- Fixed double output in rich.live https://github.com/willmcgugan/rich/issues/485 +- Fixed Console.out highlighting not reflecting defaults https://github.com/willmcgugan/rich/issues/827 +- FileProxy now raises TypeError for empty non-str arguments https://github.com/willmcgugan/rich/issues/828 + +## [9.4.0] - 2020-12-12 + +### Added + +- Added rich.live https://github.com/willmcgugan/rich/pull/382 +- Added algin parameter to Rule and Console.rule +- Added rich.Status class and Console.status +- Added getitem to Text +- Added style parameter to Console.log +- Added rich.diagnose command + +### Changed + +- Table.add_row style argument now applies to entire line and not just cells +- Added end_section parameter to Table.add_row to force a line underneath row + +## Fixed + +- Fixed suppressed traceback context https://github.com/willmcgugan/rich/issues/468 + +## [9.3.0] - 2020-12-1 + +### Added + +- Added get_datetime parameter to Console, to allow for repeatable tests +- Added get_time parameter to Console +- Added rich.abc.RichRenderable +- Added expand_all to rich.pretty.install() +- Added locals_max_length, and locals_max_string to Traceback and logging.RichHandler +- Set defaults of max_length and max_string for Traceback to 10 and 80 +- Added disable argument to Progress + +### Changed + +- Reformatted test card (python -m rich) + +### Fixed + +- Fixed redirecting of stderr in Progress +- Fixed broken expanded tuple of one https://github.com/willmcgugan/rich/issues/445 +- Fixed traceback message with `from` exceptions +- Fixed justify argument not working in console.log https://github.com/willmcgugan/rich/issues/460 + +## [9.2.0] - 2020-11-08 + +### Added + +- Added tracebacks_show_locals parameter to RichHandler +- Added max_string to Pretty +- Added rich.ansi.AnsiDecoder +- Added decoding of ansi codes to captured stdout in Progress +- Added expand_all to rich.pretty.pprint + +### Changed + +- Applied dim=True to indent guide styles +- Factored out RichHandler.get_style_and_level to allow for overriding in subclasses +- Hid progress bars from html export +- rich.pretty.pprint now soft wraps + +## [9.1.0] - 2020-10-23 + +### Added + +- Added Text.with_indentation_guide +- Added Text.detect_indentation +- Added Pretty.indent_guides +- Added Syntax.indent_guides +- Added indent_guides parameter on pretty.install +- Added rich.pretty.pprint +- Added max_length to Pretty + +### Changed + +- Enabled indent guides on Tracebacks + +### Fixed + +- Fixed negative time remaining in Progress bars https://github.com/willmcgugan/rich/issues/378 + +## [9.0.1] - 2020-10-19 + +### Fixed + +- Fixed broken ANSI codes in input on windows legacy https://github.com/willmcgugan/rich/issues/393 + +## [9.0.0] - 2020-10-18 + +### Fixed + +- Progress download column now displays decimal units + +### Added + +- Support for Python 3.9 +- Added legacy_windows to ConsoleOptions +- Added ascii_only to ConsoleOptions +- Added box.SQUARE_DOUBLE_HEAD +- Added highlighting of EUI-48 and EUI-64 (MAC addresses) +- Added Console.pager +- Added Console.out +- Added binary_units in progress download column +- Added Progress.reset +- Added Style.background_style property +- Added Bar renderable https://github.com/willmcgugan/rich/pull/361 +- Added Table.min_width +- Added table.Column.min_width and table.Column.max_width, and same to Table.add_column + +### Changed + +- Dropped box.get_safe_box function in favor of Box.substitute +- Changed default padding in Panel from 0 to (0, 1) https://github.com/willmcgugan/rich/issues/385 +- Table with row_styles will extend background color between cells if the box has no vertical dividerhttps://github.com/willmcgugan/rich/issues/383 +- Changed default of fit kwarg in render_group() from False to True +- Renamed rich.bar to rich.progress_bar, and Bar class to ProgressBar, rich.bar is now the new solid bar class + +### Fixed + +- Fixed typo in `Style.transparent_background` method name. + +## [8.0.0] - 2020-10-03 + +### Added + +- Added Console.bell method +- Added Set to types that Console.print will automatically pretty print +- Added show_locals to Traceback +- Added theme stack mechanism, see Console.push_theme and Console.pop_theme + +### Changed + +- Changed Style.empty to Style.null to better reflect what it does +- Optimized combining styles involving a null style +- Change error messages in Style.parse to read better + +### Fixed + +- Fixed Table.\_\_rich_measure\_\_ +- Fixed incorrect calculation of fixed width columns + +## [7.1.0] - 2020-09-26 + +### Added + +- Added Console.begin_capture, Console.end_capture and Console.capture +- Added Table.title_justify and Table.caption_justify https://github.com/willmcgugan/rich/issues/301 + +### Changed + +- Improved formatting of exceptions +- Enabled Rich exceptions in logging https://github.com/taliraj +- UTF-8 encoding is now mentioned in HTML head section + +### Removed + +- Removed line_numbers argument from traceback.install, which was undocumented and did nothing + +## [7.0.0] - 2020-09-18 + +### Added + +- New ansi_dark and ansi_light themes +- Added Text.append_tokens for fast appending of string + Style pairs +- Added Text.remove_suffix +- Added Text.append_tokens + +### Changed + +- Text.tabs_to_spaces was renamed to Text.expand_tabs, which works in place rather than returning a new instance +- Renamed Column.index to Column.\_index +- Optimized Style.combine and Style.chain +- Optimized text rendering by fixing internal cache mechanism +- Optimized hash generation for Styles + +## [6.2.0] - 2020-09-13 + +### Added + +- Added inline code highlighting to Markdown + +## [6.1.2] - 2020-09-11 + +### Added + +- Added ipv4 and ipv6 to ReprHighlighter + +### Changed + +- The `#` sign is included in url highlighting + +### Fixed + +- Fixed force-color switch in rich.syntax and rich.markdown commands + +## [6.1.1] - 2020-09-07 + +### Changed + +- Restored "def" in inspect signature + +## [6.1.0] - 2020-09-07 + +### Added + +- New inspect module +- Added os.\_Environ to pretty print + +### Fixed + +- Prevented recursive renderables from getting stuck + +## Changed + +- force_terminal and force_jupyter can now be used to force the disabled state, or left as None to auto-detect. +- Panel now expands to fit title if supplied + +## [6.0.0] - 2020-08-25 + +### Fixed + +- Fixed use of `__rich__` cast + +### Changed + +- New algorithm to pretty print which fits more on a line if possible +- Deprecated `character` parameter in Rule and Console.rule, in favor of `characters` +- Optimized Syntax.from_path to avoid searching all lexers, which also speeds up tracebacks + +### Added + +- Added soft_wrap flag to Console.print + +## [5.2.1] - 2020-08-19 + +### Fixed + +- Fixed underscore with display hook https://github.com/willmcgugan/rich/issues/235 + +## [5.2.0] - 2020-08-14 + +### Changed + +- Added crop argument to Console.print +- Added "ignore" overflow method +- Added multiple characters per rule @hedythedev https://github.com/willmcgugan/rich/pull/207 + +## [5.1.2] - 2020-08-10 + +### Fixed + +- Further optimized pretty printing ~5X. + +## [5.1.1] - 2020-08-09 + +### Fixed + +- Optimized pretty printing ~3X faster + +## [5.1.0] - 2020-08-08 + +### Added + +- Added Text.cell_len +- Added helpful message regarding unicode decoding errors https://github.com/willmcgugan/rich/issues/212 +- Added display hook with pretty.install() + +### Fixed + +- Fixed deprecation warnings re backslash https://github.com/willmcgugan/rich/issues/210 +- Fixed repr highlighting of scientific notation, e.g. 1e100 + +### Changed + +- Implemented pretty printing, and removed pprintpp from dependencies +- Optimized Text.join + +## [5.0.0] - 2020-08-02 + +### Changed + +- Change to console markup syntax to not parse Python structures as markup, i.e. `[1,2,3]` is treated as a literal, not a tag. +- Standard color numbers syntax has changed to `"color()"` so that `[5]` (for example) is considered a literal. +- Markup escape method has changed from double brackets to preceding with a backslash, so `foo[[]]` would be `foo\[bar]` + +## [4.2.2] - 2020-07-30 + +### Changed + +- Added thread to automatically call update() in progress.track(). Replacing previous adaptive algorithm. +- Second attempt at working around https://bugs.python.org/issue37871 + +## [4.2.1] - 2020-07-29 + +### Added + +- Added show_time and show_level parameters to RichHandler https://github.com/willmcgugan/rich/pull/182 + +### Fixed + +- Fixed progress.track iterator exiting early https://github.com/willmcgugan/rich/issues/189 +- Added workaround for Python bug https://bugs.python.org/issue37871, fixing https://github.com/willmcgugan/rich/issues/186 + +### Changed + +- Set overflow=fold for log messages https://github.com/willmcgugan/rich/issues/190 + +## [4.2.0] - 2020-07-27 + +### Fixed + +- Fixed missing new lines https://github.com/willmcgugan/rich/issues/178 +- Fixed Progress.track https://github.com/willmcgugan/rich/issues/184 +- Remove control codes from exported text https://github.com/willmcgugan/rich/issues/181 +- Implemented auto-detection and color rendition of 16-color mode + +## [4.1.0] - 2020-07-26 + +### Changed + +- Optimized progress.track for very quick iterations +- Force default size of 80x25 if get_terminal_size reports size of 0,0 + +## [4.0.0] - 2020-07-23 + +Major version bump for a breaking change to `Text.stylize signature`, which corrects a minor but irritating API wart. The style now comes first and the `start` and `end` offsets default to the entire text. This allows for `text.stylize_all(style)` to be replaced with `text.stylize(style)`. The `start` and `end` offsets now support negative indexing, so `text.stylize("bold", -1)` makes the last character bold. + +### Added + +- Added markup switch to RichHandler https://github.com/willmcgugan/rich/issues/171 + +### Changed + +- Change signature of Text.stylize to accept style first +- Remove Text.stylize_all which is no longer necessary + +### Fixed + +- Fixed rendering of Confirm prompt https://github.com/willmcgugan/rich/issues/170 + +## [3.4.1] - 2020-07-22 + +### Fixed + +- Fixed incorrect default of expand in Table.grid + +## [3.4.0] - 2020-07-22 + +### Added + +- Added stream parameter to Console.input +- Added password parameter to Console.input +- Added description parameter to Progress.update +- Added rich.prompt +- Added detecting 'dumb' terminals +- Added Text.styled alternative constructor + +### Fixes + +- Fixed progress bars so that they are readable when color is disabled + +## [3.3.2] - 2020-07-14 + +### Changed + +- Optimized Text.pad + +### Added + +- Added rich.scope +- Change log_locals to use scope.render_scope +- Added title parameter to Columns + +## [3.3.1] - 2020-07-13 + +### Added + +- box.ASCII_DOUBLE_HEAD + +### Changed + +- Removed replace of -- --- ... from Markdown, as it made it impossible to include CLI info + +## [3.3.0] - 2020-07-12 + +### Added + +- Added title and title_align options to Panel +- Added pad and width parameters to Align +- Added end parameter to Rule +- Added Text.pad and Text.align methods +- Added leading parameter to Table + +## [3.2.0] - 2020-07-10 + +### Added + +- Added Align.left Align.center Align.right shortcuts +- Added Panel.fit shortcut +- Added align parameter to Columns + +### Fixed + +- Align class now pads to the right, like Text +- ipywidgets added as an optional dependency +- Issue with Panel and background color +- Fixed missing `__bool__` on Segment + +### Changed + +- Added `border_style` argument to Panel (note, `style` now applies to interior of the panel) + +## [3.1.0] - 2020-07-09 + +### Changed + +- Progress bars now work in Jupyter + +## Added + +- Added refresh_per_second to progress.track +- Added styles to BarColumn and progress.track + +## [3.0.5] - 2020-07-07 + +### Fixed + +- Fixed Windows version number require for truecolor + +## [3.0.4] - 2020-07-07 + +### Changed + +- More precise detection of Windows console https://github.com/willmcgugan/rich/issues/140 + +## [3.0.3] - 2020-07-03 + +### Fixed + +- Fixed edge case with wrapped and overflowed text + +### Changed + +- New algorithm for compressing table that priorities smaller columns + +### Added + +- Added safe_box parameter to Console constructor + +## [3.0.2] - 2020-07-02 + +### Added + +- Added rich.styled.Styled class to apply styles to renderable +- Table.add_row now has an optional style parameter +- Added table_movie.py to examples + +### Changed + +- Modified box options to use half line characters at edges +- Non no_wrap columns will now shrink below minimum width if table is compressed + +## [3.0.1] - 2020-06-30 + +### Added + +- Added box.ASCII2 +- Added markup argument to logging extra + +### Changed + +- Setting a non-None width now implies expand=True + +## [3.0.0] - 2020-06-28 + +### Changed + +- Enabled supported box chars for legacy Windows, and introduce `safe_box` flag +- Disable hyperlinks on legacy Windows +- Constructors for Rule and Panel now have keyword only arguments (reason for major version bump) +- Table.add_colum added keyword only arguments + +### Fixed + +- Fixed Table measure + +## [2.3.1] - 2020-06-26 + +### Fixed + +- Disabled legacy_windows if jupyter is detected https://github.com/willmcgugan/rich/issues/125 + +## [2.3.0] - 2020-06-26 + +### Fixed + +- Fixed highlighting of paths / filenames +- Corrected docs for RichHandler which erroneously said default console writes to stderr + +### Changed + +- Allowed `style` parameter for `highlight_regex` to be a callable that returns a style + +### Added + +- Added optional highlighter parameter to RichHandler + +## [2.2.6] - 2020-06-24 + +### Changed + +- Store a "link id" on Style instance, so links containing different styles are highlighted together. (https://github.com/willmcgugan/rich/pull/123) + +## [2.2.5] - 2020-06-23 + +### Fixed + +- Fixed justify of tables (https://github.com/willmcgugan/rich/issues/117) + +## [2.2.4] - 2020-06-21 + +### Added + +- Added enable_link_path to RichHandler +- Added legacy_windows switch to Console constructor + +## [2.2.3] - 2020-06-15 + +### Fixed + +- Fixed console.log hyperlink not containing full path + +### Changed + +- Used random number for hyperlink id + +## [2.2.2] - 2020-06-14 + +### Changed + +- Exposed RichHandler highlighter as a class var + +## [2.2.1] - 2020-06-14 + +### Changed + +- Linked path in log render to file + +## [2.2.0] - 2020-06-14 + +### Added + +- Added redirect_stdout and redirect_stderr to Progress + +### Changed + +- printing to console with an active Progress doesn't break visuals + +## [2.1.0] - 2020-06-11 + +### Added + +- Added 'transient' option to Progress + +### Changed + +- Truncated overly long text in Rule with ellipsis overflow + +## [2.0.1] - 2020-06-10 + +### Added + +- Added expand option to Padding + +### Changed + +- Some minor optimizations in Text + +### Fixed + +- Fixed broken rule with CJK text + +## [2.0.0] - 2020-06-06 + +### Added + +- Added overflow methods +- Added no_wrap option to print() +- Added width option to print +- Improved handling of compressed tables + +### Fixed + +- Fixed erroneous space at end of log +- Fixed erroneous space at end of progress bar + +### Changed + +- Renamed \_ratio.ratio_divide to \_ratio.ratio_distribute +- Renamed JustifyValues to JustifyMethod (backwards incompatible) +- Optimized \_trim_spans +- Enforced keyword args in Console / Text interfaces (backwards incompatible) +- Return self from text.append + +## [1.3.1] - 2020-06-01 + +### Changed + +- Changed defaults of Table.grid +- Polished listdir.py example + +### Added + +- Added width argument to Columns + +### Fixed + +- Fixed for `columns_first` argument in Columns +- Fixed incorrect padding in columns with fixed width + +## [1.3.0] - 2020-05-31 + +### Added + +- Added rich.get_console() function to get global console instance. +- Added Columns class + +### Changed + +- Updated `markdown.Heading.create()` to work with subclassing. +- Console now transparently works with Jupyter + +### Fixed + +- Fixed issue with broken table with show_edge=False and a non-None box arg + +## [1.2.3] - 2020-05-24 + +### Added + +- Added `padding` parameter to Panel +- Added 'indeterminate' state when progress bars aren't started + +### Fixed + +- Fixed Progress deadlock https://github.com/willmcgugan/rich/issues/90 + +### Changed + +- Auto-detect "truecolor" color system when in Windows Terminal + +## [1.2.2] - 2020-05-22 + +### Fixed + +- Issue with right aligned wrapped text adding extra spaces + +## [1.2.1] - 2020-05-22 + +### Fixed + +- Issue with sum and Style + +## [1.2.0] - 2020-05-22 + +### Added + +- Support for double underline, framed, encircled, and overlined attributes + +### Changed + +- Optimized Style +- Changed methods `__console__` to `__rich_console__`, and `__measure__` to `__rich_measure__` + +## [1.1.9] - 2020-05-20 + +### Fixed + +- Exception when BarColumn.bar_width == None + +## [1.1.8] - 2020-05-20 + +### Changed + +- Optimizations for Segment, Console and Table + +### Added + +- Added Console.clear method +- Added exporting of links to HTML + +## [1.1.7] - 2020-05-19 + +### Added + +- Added collapse_padding option to Table. + +### Changed + +- Some style attributes may be abbreviated (b for bold, i for italic etc). Previously abbreviations worked in console markup but only one at a time, i.e. "[b]Hello[/]" but not "[b i]Hello[/]" -- now they work everywhere. +- Renamed 'text' property on Text to 'plain'. i.e. text.plain returns a string version of the Text instance. + +### Fixed + +- Fixed zero division if total is 0 in progress bar + +## [1.1.6] - 2020-05-17 + +### Added + +- Added rich.align.Align class +- Added justify argument to Console.print and console.log + +## [1.1.5] - 2020-05-15 + +### Changed + +- Changed progress bars to write to stdout on terminal and hide on non-terminal + +## [1.1.4] - 2020-05-15 + +### Fixed + +- Fixed incorrect file and link in progress.log +- Fixes for legacy windows: Bar, Panel, and Rule now use ASCII characters +- show_cursor is now a no-op on legacy windows + +### Added + +- Added Console.input + +### Changed + +- Disable progress bars when not writing to a terminal + +## [1.1.3] - 2020-05-14 + +### Fixed + +- Issue with progress of one line` + +## [1.1.2] - 2020-05-14 + +### Added + +- Added -p switch to python -m rich.markdown to page output +- Added Console.control to output control codes + +### Changed + +- Changed Console log_time_format to no longer require a space at the end +- Added print and log to Progress to render terminal output when progress is active + +## [1.1.1] - 2020-05-12 + +### Changed + +- Stripped cursor moving control codes from text + +## [1.1.0] - 2020-05-10 + +### Added + +- Added hyperlinks to Style and markup +- Added justify and code theme switches to markdown command + +## [1.0.3] - 2020-05-08 + +### Added + +- Added `python -m rich.syntax` command + +## [1.0.2] - 2020-05-08 + +### Fixed + +- Issue with Windows legacy support https://github.com/willmcgugan/rich/issues/59 + +## [1.0.1] - 2020-05-08 + +### Changed + +- Applied console markup after highlighting +- Documented highlighting +- Changed Markup parser to handle overlapping styles +- Relaxed dependency on colorama +- Allowed Theme to accept values as style definitions (str) as well as Style instances +- Added a panel to emphasize code in Markdown + +### Added + +- Added markup.escape +- Added `python -m rich.theme` command +- Added `python -m rich.markdown` command +- Added rendering of images in Readme (links only) + +### Fixed + +- Fixed Text.assemble not working with strings https://github.com/willmcgugan/rich/issues/57 +- Fixed table when column widths must be compressed to fit + +## [1.0.0] - 2020-05-03 + +### Changed + +- Improvements to repr highlighter to highlight URLs + +## [0.8.13] - 2020-04-28 + +### Fixed + +- Fixed incorrect markdown rendering for quotes and changed style + +## [0.8.12] - 2020-04-21 + +### Fixed + +- Removed debug print from rich.progress + +## [0.8.11] - 2020-04-14 + +### Added + +- Added Table.show_lines to render lines between rows + +### Changed + +- Added markup escape with double square brackets + +## [0.8.10] - 2020-04-12 + +### Fixed + +- Fix row_styles applying to header + +## [0.8.9] - 2020-04-12 + +### Changed + +- Added force_terminal option to `Console.__init__` + +### Added + +- Added Table.row_styles to enable zebra striping. + +## [0.8.8] - 2020-03-31 + +### Fixed + +- Fixed background in Syntax + +## [0.8.7] - 2020-03-31 + +### Fixed + +- Broken wrapping of long lines +- Fixed wrapping in Syntax + +### Changed + +- Added word_wrap option to Syntax, which defaults to False. +- Added word_wrap option to Traceback. + +## [0.8.6] - 2020-03-29 + +### Added + +- Experimental Jupyter notebook support: from rich.jupyter import print + +## [0.8.5] - 2020-03-29 + +### Changed + +- Smarter number parsing regex for repr highlighter + +### Added + +- uuid highlighter for repr + +## [0.8.4] - 2020-03-28 + +### Added + +- Added 'test card', run python -m rich + +### Changed + +- Detected windows terminal, defaulting to colorama support + +### Fixed + +- Fixed table scaling issue + +## [0.8.3] - 2020-03-27 + +### Fixed + +- CJK right align + +## [0.8.2] - 2020-03-27 + +### Changed + +- Fixed issue with 0 speed resulting in zero division error +- Changed signature of Progress.update +- Made calling start() a second time a no-op + +## [0.8.1] - 2020-03-22 + +### Added + +- Added progress.DownloadColumn + +## [0.8.0] - 2020-03-17 + +### Added + +- CJK support +- Console level highlight flag +- Added encoding argument to Syntax.from_path + +### Changed + +- Dropped support for Windows command prompt (try https://www.microsoft.com/en-gb/p/windows-terminal-preview/) +- Added task_id to Progress.track + +## [0.7.2] - 2020-03-15 + +### Fixed + +- KeyError for missing pygments style + +## [0.7.1] - 2020-03-13 + +### Fixed + +- Issue with control codes being used in length calculation + +### Changed + +- Remove current_style concept, which wasn't really used and was problematic for concurrency + +## [0.7.0] - 2020-03-12 + +### Changed + +- Added width option to Panel +- Change special method `__render_width__` to `__measure__` +- Dropped the "markdown style" syntax in console markup +- Optimized style rendering + +### Added + +- Added Console.show_cursor method +- Added Progress bars + +### Fixed + +- Fixed wrapping when a single word was too large to fit in a line + +## [0.6.0] - 2020-03-03 + +### Added + +- Added tab_size to Console and Text +- Added protocol.is_renderable for runtime check +- Added emoji switch to Console +- Added inherit boolean to Theme +- Made Console thread safe, with a thread local buffer + +### Changed + +- Console.markup attribute now effects Table +- SeparatedConsoleRenderable and RichCast types + +### Fixed + +- Fixed tabs breaking rendering by converting to spaces + +## [0.5.0] - 2020-02-23 + +### Changed + +- Replaced `__console_str__` with `__rich__` + +## [0.4.1] - 2020-02-22 + +### Fixed + +- Readme links in Pypi + +## [0.4.0] - 2020-02-22 + +### Added + +- Added Traceback rendering and handler +- Added rich.constrain +- Added rich.rule + +### Fixed + +- Fixed unnecessary padding + +## [0.3.3] - 2020-02-04 + +### Fixed + +- Fixed Windows color support +- Fixed line width on windows issue (https://github.com/willmcgugan/rich/issues/7) +- Fixed Pretty print on Windows + +## [0.3.2] - 2020-01-26 + +### Added + +- Added rich.logging + +## [0.3.1] - 2020-01-22 + +### Added + +- Added colorama for Windows support + +## [0.3.0] - 2020-01-19 + +### Added + +- First official release, API still to be stabilized diff --git a/testbed/Textualize__rich/CODE_OF_CONDUCT.md b/testbed/Textualize__rich/CODE_OF_CONDUCT.md new file mode 100644 index 0000000000000000000000000000000000000000..c68a49b071e6a9b776060173a42830a5ffa7b233 --- /dev/null +++ b/testbed/Textualize__rich/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at willmcgugan@gmail.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/testbed/Textualize__rich/LICENSE b/testbed/Textualize__rich/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..8d9e799c3d85fd122477a0faab67c61f59bd387e --- /dev/null +++ b/testbed/Textualize__rich/LICENSE @@ -0,0 +1,8 @@ +Copyright 2020 Will McGugan + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/testbed/Textualize__rich/README.cn.md b/testbed/Textualize__rich/README.cn.md new file mode 100644 index 0000000000000000000000000000000000000000..7597b7ceb7df45185c235350461a45808341ad47 --- /dev/null +++ b/testbed/Textualize__rich/README.cn.md @@ -0,0 +1,307 @@ +# Rich + +[![PyPI version](https://badge.fury.io/py/rich.svg)](https://badge.fury.io/py/rich) +[![codecov](https://codecov.io/gh/willmcgugan/rich/branch/master/graph/badge.svg)](https://codecov.io/gh/willmcgugan/rich) +[![Rich blog](https://img.shields.io/badge/blog-rich%20news-yellowgreen)](https://www.willmcgugan.com/tag/rich/) +[![Twitter Follow](https://img.shields.io/twitter/follow/willmcgugan.svg?style=social)](https://twitter.com/willmcgugan) + +Rich 是一个 Python 库,可以为您在终端中提供富文本和精美格式。 + +[Rich API](https://rich.readthedocs.io/en/latest/) 可以很容易的在终端输出添加各种颜色和不同风格。Rich 还可以绘制漂亮的表格,进度条,markdown,突出显示语法的源代码及回溯等等,不胜枚举。 + +![功能纵览](https://github.com/willmcgugan/rich/raw/master/imgs/features.png) + +有关 Rich 的视频介绍,请参见 +[@fishnets88](https://twitter.com/fishnets88)录制的 +[calmcode.io](https://calmcode.io/rich/introduction.html)。 + +## 兼容性 + +Rich 适用于 Linux,OSX 和 Windows。真彩色/表情符号可与新的 Windows 终端一起使用,Windows 的经典终端仅限 8 种颜色。 + +Rich 还可以与[Jupyter 笔记本](https://jupyter.org/)一起使用,而无需其他配置。 + +## 安装说明 + +使用`pip`或其他 PyPi 软件包管理器进行安装。 + +``` +pip install rich +``` + +## Rich 的打印功能 + +想毫不费力地将 Rich 的输出功能添加到您的应用程序中,您只需导入[rich 打印](https://rich.readthedocs.io/en/latest/introduction.html#quick-start)方法,该方法和其他 Python 的自带功能的参数类似。 +您可以试试: + +```python +from rich import print + +print("Hello, [bold magenta]World[/bold magenta]!", ":vampire:", locals()) +``` + +![Hello World](https://github.com/willmcgugan/rich/raw/master/imgs/print.png) + +## 使用控制台 + +想要对 Rich 终端内容进行更多控制,请您导入并构造一个[控制台](https://rich.readthedocs.io/en/latest/reference/console.html#rich.console.Console)对象。 + +```python +from rich.console import Console + +console = Console() +``` + +Console 对象含有一个`print` 方法,它的界面与 python 内置的`print`功能界面相似。 + +您可以试试: + +```python +console.print("Hello", "World!") +``` + +您可能已经料到,这时终端上会显示“ Hello World!”。请注意,与内置的“打印”功能不同,Rich 会将文字自动换行以适合终端宽度。 + +有几种方法可以为输出添加颜色和样式。您可以通过添加`style`关键字参数来为整个输出设置样式。例子如下: + +```python +console.print("Hello", "World!", style="bold red") +``` + +输出如下图: + +![Hello World](https://github.com/willmcgugan/rich/raw/master/imgs/hello_world.png) + +这个范例一次只设置了一行文字的样式。如果想获得更细腻更复杂的样式,Rich 可以渲染一个特殊的标记,其语法类似于[bbcode](https://en.wikipedia.org/wiki/BBCode)。示例如下: + +```python +console.print("Where there is a [bold cyan]Will[/bold cyan] there [u]is[/u] a [i]way[/i].") +``` + +![控制台标记](https://github.com/willmcgugan/rich/raw/master/imgs/where_there_is_a_will.png) + +### 控制台记录 + +Console 对象具有一个`log()`方法,该方法具有与`print()`类似的界面,除此之外,还能成列显示当前时间以及被调用的文件和行。默认情况下,Rich 将针对 Python 结构和 repr 字符串进行语法突出显示。如果您记录一个集合(如字典或列表),Rich 会把它漂亮地打印出来,使其切合可用空间。下面是其中一些功能的示例: + +```python +from rich.console import Console +console = Console() + +test_data = [ + {"jsonrpc": "2.0", "method": "sum", "params": [None, 1, 2, 4, False, True], "id": "1",}, + {"jsonrpc": "2.0", "method": "notify_hello", "params": [7]}, + {"jsonrpc": "2.0", "method": "subtract", "params": [42, 23], "id": "2"}, +] + +def test_log(): + enabled = False + context = { + "foo": "bar", + } + movies = ["Deadpool", "Rise of the Skywalker"] + console.log("Hello from", console, "!") + console.log(test_data, log_locals=True) + + +test_log() +``` + +以上范例的输出如下: + +![日志](https://github.com/willmcgugan/rich/raw/master/imgs/log.png) + +注意其中的`log_locals`参数会输出一个表格,该表格包含调用 log 方法的局部变量。 + +log 方法既可用于将长时间运行应用程序(例如服务器)的日志记录到终端,也可用于辅助调试。 + +### 记录处理程序 + +您还可以使用内置的[处理类](https://rich.readthedocs.io/en/latest/logging.html)来对 Python 日志记录模块的输出进行格式化和着色。下面是输出示例: + +![记录](https://github.com/willmcgugan/rich/raw/master/imgs/logging.png) + +## 表情符号 + +将名称放在两个冒号之间即可在控制台输出中插入表情符号。示例如下: + +```python +>>> console.print(":smiley: :vampire: :pile_of_poo: :thumbs_up: :raccoon:") +😃 🧛 💩 👍 🦝 +``` + +请谨慎地使用此功能。 + +## 表格 + +Rich 可以使用 Unicode 框字符来呈现多变的[表格](https://rich.readthedocs.io/en/latest/tables.html)。Rich 包含多种边框,样式,单元格对齐等格式设置的选项。下面是一个简单的示例: + +```python +from rich.console import Console +from rich.table import Column, Table + +console = Console() + +table = Table(show_header=True, header_style="bold magenta") +table.add_column("Date", style="dim", width=12) +table.add_column("Title") +table.add_column("Production Budget", justify="right") +table.add_column("Box Office", justify="right") +table.add_row( + "Dev 20, 2019", "Star Wars: The Rise of Skywalker", "$275,000,000", "$375,126,118" +) +table.add_row( + "May 25, 2018", + "[red]Solo[/red]: A Star Wars Story", + "$275,000,000", + "$393,151,347", +) +table.add_row( + "Dec 15, 2017", + "Star Wars Ep. VIII: The Last Jedi", + "$262,000,000", + "[bold]$1,332,539,889[/bold]", +) + +console.print(table) +``` + +该示例的输出如下: + +![表格](https://github.com/willmcgugan/rich/raw/master/imgs/table.png) + +请注意,控制台标记的呈现方式与`print()`和`log()`相同。实际上,由 Rich 渲染的任何内容都可以添加到标题/行(甚至其他表格)中。 + +`Table`类很聪明,可以调整列的大小以适合终端的可用宽度,并能根据需要环绕文本。下面是相同的示例,输出与比上表小的终端上: + +![表格 2](https://github.com/willmcgugan/rich/raw/master/imgs/table2.png) + +## 进度条 + +Rich 可以渲染多个不闪烁的[进度](https://rich.readthedocs.io/en/latest/progress.html)条形图,以跟踪长时间运行的任务。 + +基本用法:用`track`函数调用任何程序并迭代结果。下面是一个例子: + +```python +from rich.progress import track + +for step in track(range(100)): + do_step(step) +``` + +添加多个进度条并不难。以下是从文档中获取的示例: + +![进度](https://github.com/willmcgugan/rich/raw/master/imgs/progress.gif) + +这些列可以配置为显示您所需的任何详细信息。内置列包括完成百分比,文件大小,文件速度和剩余时间。下面是显示正在进行的下载的示例: + +![进度](https://github.com/willmcgugan/rich/raw/master/imgs/downloader.gif) + +要自己尝试一下,请参阅[examples/downloader.py](https://github.com/willmcgugan/rich/blob/master/examples/downloader.py),它可以在显示进度的同时下载多个 URL。 + +## 列 + +Rich 可以将内容通过排列整齐的,具有相等或最佳的宽度的[列](https://rich.readthedocs.io/en/latest/columns.html)来呈现。下面是(macOS / Linux)`ls`命令的一个非常基本的克隆,用于用列来显示目录列表: + +```python +import os +import sys + +from rich import print +from rich.columns import Columns + +directory = os.listdir(sys.argv[1]) +print(Columns(directory)) +``` + +以下屏幕截图是[列示例](https://github.com/willmcgugan/rich/blob/master/examples/columns.py)的输出,该列显示了从 API 提取的数据: + +![列](https://github.com/willmcgugan/rich/raw/master/imgs/columns.png) + +## Markdown + +Rich 可以呈现[markdown](https://rich.readthedocs.io/en/latest/markdown.html),并可相当不错的将其格式转移到终端。 + +为了渲染 markdown,请导入`Markdown` 类,并使用包含 markdown 代码的字符串来构造它,然后将其打印到控制台。例子如下: + +```python +from rich.console import Console +from rich.markdown import Markdown + +console = Console() +with open("README.md") as readme: + markdown = Markdown(readme.read()) +console.print(markdown) +``` + +该例子的输出如下图: + +![markdown](https://github.com/willmcgugan/rich/raw/master/imgs/markdown.png) + +## 语法突出显示 + +Rich 使用[pygments](https://pygments.org/)库来实现[语法高亮显示](https://rich.readthedocs.io/en/latest/syntax.html)。用法类似于渲染 markdown。构造一个`Syntax`对象并将其打印到控制台。下面是一个例子: + +```python +from rich.console import Console +from rich.syntax import Syntax + +my_code = ''' +def iter_first_last(values: Iterable[T]) -> Iterable[Tuple[bool, bool, T]]: + """Iterate and generate a tuple with a flag for first and last value.""" + iter_values = iter(values) + try: + previous_value = next(iter_values) + except StopIteration: + return + first = True + for value in iter_values: + yield first, False, previous_value + first = False + previous_value = value + yield first, True, previous_value +''' +syntax = Syntax(my_code, "python", theme="monokai", line_numbers=True) +console = Console() +console.print(syntax) +``` + +输出如下: + +![语法](https://github.com/willmcgugan/rich/raw/master/imgs/syntax.png) + +## 回溯 + +Rich 可以渲染漂亮的回溯,比标准 Python 回溯更容易阅读,并能显示更多代码。您可以将 Rich 设置为默认的回溯处理程序,这样所有难以捕获的异常都将由 Rich 为您呈现。 + +下面是在 OSX(与 Linux 类似)上的外观: + +![回溯](https://github.com/willmcgugan/rich/raw/master/imgs/traceback.png) + +## 使用Rich的项目 + +这里是一些使用Rich的项目: + +- [BrancoLab/BrainRender](https://github.com/BrancoLab/BrainRender) + 一个用于三维神经解剖数据可视化的python包 +- [Ciphey/Ciphey](https://github.com/Ciphey/Ciphey) + 自动解密工具 +- [emeryberger/scalene](https://github.com/emeryberger/scalene) + 一个高性能、高精度的Python CPU和内存剖析器 +- [hedythedev/StarCli](https://github.com/hedythedev/starcli) + 通过命令行浏览GitHub热门项目 +- [intel/cve-bin-tool](https://github.com/intel/cve-bin-tool) + 这个工具可以扫描一些常见的、有漏洞的组件(openssl、libpng、libxml2、expat和其他一些组件),让你知道你的系统是否包含有已知漏洞的常用库。 +- [nf-core/tools](https://github.com/nf) + 包含nf-core社区帮助工具的Python包 +- [cansarigol/pdbr](https://github.com/cansarigol/pdbr) + pdb + rich 的库,增强调试功能 +- [plant99/felicette](https://github.com/plant99/felicette) + 傻瓜式卫星图像 +- [seleniumbase/SeleniumBase](https://github.com/seleniumbase/SeleniumBase) + 使用Selenium和pytest使自动化和测试速度提高10倍,包括电池 +- [smacke/ffsubsync](https://github.com/smacke/ffsubsync) + 自动将字幕与视频同步 +- [tryolabs/norfair](https://github.com/tryolabs/norfair) + 轻量级Python库,用于向任何检测器添加实时2D对象跟踪 +- +[还有很多](https://github.com/willmcgugan/rich/network/dependents)! diff --git a/testbed/Textualize__rich/README.md b/testbed/Textualize__rich/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8c27631a42fe494c6cdd31c5379f4eb14674af94 --- /dev/null +++ b/testbed/Textualize__rich/README.md @@ -0,0 +1,388 @@ +# Rich + +[![PyPI version](https://badge.fury.io/py/rich.svg)](https://badge.fury.io/py/rich) +[![codecov](https://codecov.io/gh/willmcgugan/rich/branch/master/graph/badge.svg)](https://codecov.io/gh/willmcgugan/rich) +[![Rich blog](https://img.shields.io/badge/blog-rich%20news-yellowgreen)](https://www.willmcgugan.com/tag/rich/) +[![Twitter Follow](https://img.shields.io/twitter/follow/willmcgugan.svg?style=social)](https://twitter.com/willmcgugan) + +[中文 readme](https://github.com/willmcgugan/rich/blob/master/README.cn.md) • [lengua española readme](https://github.com/willmcgugan/rich/blob/master/README.es.md) + +Rich is a Python library for _rich_ text and beautiful formatting in the terminal. + +The [Rich API](https://rich.readthedocs.io/en/latest/) makes it easy to add color and style to terminal output. Rich can also render pretty tables, progress bars, markdown, syntax highlighted source code, tracebacks, and more — out of the box. + +![Features](https://github.com/willmcgugan/rich/raw/master/imgs/features.png) + +For a video introduction to Rich see [calmcode.io](https://calmcode.io/rich/introduction.html) by [@fishnets88](https://twitter.com/fishnets88). + +See what [people are saying about Rich](https://www.willmcgugan.com/blog/pages/post/rich-tweets/). + +## Compatibility + +Rich works with Linux, OSX, and Windows. True color / emoji works with new Windows Terminal, classic terminal is limited to 8 colors. Rich requires Python 3.6.1 or later. + +Rich works with [Jupyter notebooks](https://jupyter.org/) with no additional configuration required. + +## Installing + +Install with `pip` or your favorite PyPi package manager. + +``` +pip install rich +``` + +Run the following to test Rich output on your terminal: + +``` +python -m rich +``` + +## Rich print function + +To effortlessly add rich output to your application, you can import the [rich print](https://rich.readthedocs.io/en/latest/introduction.html#quick-start) method, which has the same signature as the builtin Python function. Try this: + +```python +from rich import print + +print("Hello, [bold magenta]World[/bold magenta]!", ":vampire:", locals()) +``` + +![Hello World](https://github.com/willmcgugan/rich/raw/master/imgs/print.png) + +## Rich REPL + +Rich can be installed in the Python REPL, so that any data structures will be pretty printed and highlighted. + +```python +>>> from rich import pretty +>>> pretty.install() +``` + +![REPL](https://github.com/willmcgugan/rich/raw/master/imgs/repl.png) + +## Rich Inspect + +Rich has an [inspect](https://rich.readthedocs.io/en/latest/reference/init.html?highlight=inspect#rich.inspect) function which can produce a report on any Python object, such as class, instance, or builtin. + +```python +>>> from rich import inspect +>>> inspect(str, methods=True) +``` + +## Using the Console + +For more control over rich terminal content, import and construct a [Console](https://rich.readthedocs.io/en/latest/reference/console.html#rich.console.Console) object. + +```python +from rich.console import Console + +console = Console() +``` + +The Console object has a `print` method which has an intentionally similar interface to the builtin `print` function. Here's an example of use: + +```python +console.print("Hello", "World!") +``` + +As you might expect, this will print `"Hello World!"` to the terminal. Note that unlike the builtin `print` function, Rich will word-wrap your text to fit within the terminal width. + +There are a few ways of adding color and style to your output. You can set a style for the entire output by adding a `style` keyword argument. Here's an example: + +```python +console.print("Hello", "World!", style="bold red") +``` + +The output will be something like the following: + +![Hello World](https://github.com/willmcgugan/rich/raw/master/imgs/hello_world.png) + +That's fine for styling a line of text at a time. For more finely grained styling, Rich renders a special markup which is similar in syntax to [bbcode](https://en.wikipedia.org/wiki/BBCode). Here's an example: + +```python +console.print("Where there is a [bold cyan]Will[/bold cyan] there [u]is[/u] a [i]way[/i].") +``` + +![Console Markup](https://github.com/willmcgugan/rich/raw/master/imgs/where_there_is_a_will.png) + +### Console logging + +The Console object has a `log()` method which has a similar interface to `print()`, but also renders a column for the current time and the file and line which made the call. By default Rich will do syntax highlighting for Python structures and for repr strings. If you log a collection (i.e. a dict or a list) Rich will pretty print it so that it fits in the available space. Here's an example of some of these features. + +```python +from rich.console import Console +console = Console() + +test_data = [ + {"jsonrpc": "2.0", "method": "sum", "params": [None, 1, 2, 4, False, True], "id": "1",}, + {"jsonrpc": "2.0", "method": "notify_hello", "params": [7]}, + {"jsonrpc": "2.0", "method": "subtract", "params": [42, 23], "id": "2"}, +] + +def test_log(): + enabled = False + context = { + "foo": "bar", + } + movies = ["Deadpool", "Rise of the Skywalker"] + console.log("Hello from", console, "!") + console.log(test_data, log_locals=True) + + +test_log() +``` + +The above produces the following output: + +![Log](https://github.com/willmcgugan/rich/raw/master/imgs/log.png) + +Note the `log_locals` argument, which outputs a table containing the local variables where the log method was called. + +The log method could be used for logging to the terminal for long running applications such as servers, but is also a very nice debugging aid. + +### Logging Handler + +You can also use the builtin [Handler class](https://rich.readthedocs.io/en/latest/logging.html) to format and colorize output from Python's logging module. Here's an example of the output: + +![Logging](https://github.com/willmcgugan/rich/raw/master/imgs/logging.png) + +## Emoji + +To insert an emoji in to console output place the name between two colons. Here's an example: + +```python +>>> console.print(":smiley: :vampire: :pile_of_poo: :thumbs_up: :raccoon:") +😃 🧛 💩 👍 🦝 +``` + +Please use this feature wisely. + +## Tables + +Rich can render flexible [tables](https://rich.readthedocs.io/en/latest/tables.html) with unicode box characters. There is a large variety of formatting options for borders, styles, cell alignment etc. + +![table movie](https://github.com/willmcgugan/rich/raw/master/imgs/table_movie.gif) + +The animation above was generated with [table_movie.py](https://github.com/willmcgugan/rich/blob/master/examples/table_movie.py) in the examples directory. + +Here's a simpler table example: + +```python +from rich.console import Console +from rich.table import Table + +console = Console() + +table = Table(show_header=True, header_style="bold magenta") +table.add_column("Date", style="dim", width=12) +table.add_column("Title") +table.add_column("Production Budget", justify="right") +table.add_column("Box Office", justify="right") +table.add_row( + "Dev 20, 2019", "Star Wars: The Rise of Skywalker", "$275,000,000", "$375,126,118" +) +table.add_row( + "May 25, 2018", + "[red]Solo[/red]: A Star Wars Story", + "$275,000,000", + "$393,151,347", +) +table.add_row( + "Dec 15, 2017", + "Star Wars Ep. VIII: The Last Jedi", + "$262,000,000", + "[bold]$1,332,539,889[/bold]", +) + +console.print(table) +``` + +This produces the following output: + +![table](https://github.com/willmcgugan/rich/raw/master/imgs/table.png) + +Note that console markup is rendered in the same way as `print()` and `log()`. In fact, anything that is renderable by Rich may be included in the headers / rows (even other tables). + +The `Table` class is smart enough to resize columns to fit the available width of the terminal, wrapping text as required. Here's the same example, with the terminal made smaller than the table above: + +![table2](https://github.com/willmcgugan/rich/raw/master/imgs/table2.png) + +## Progress Bars + +Rich can render multiple flicker-free [progress](https://rich.readthedocs.io/en/latest/progress.html) bars to track long-running tasks. + +For basic usage, wrap any sequence in the `track` function and iterate over the result. Here's an example: + +```python +from rich.progress import track + +for step in track(range(100)): + do_step(step) +``` + +It's not much harder to add multiple progress bars. Here's an example taken from the docs: + +![progress](https://github.com/willmcgugan/rich/raw/master/imgs/progress.gif) + +The columns may be configured to show any details you want. Built-in columns include percentage complete, file size, file speed, and time remaining. Here's another example showing a download in progress: + +![progress](https://github.com/willmcgugan/rich/raw/master/imgs/downloader.gif) + +To try this out yourself, see [examples/downloader.py](https://github.com/willmcgugan/rich/blob/master/examples/downloader.py) which can download multiple URLs simultaneously while displaying progress. + +## Status + +For situations where it is hard to calculate progress, you can use the [status](https://rich.readthedocs.io/en/latest/reference/console.html#rich.console.Console.status) method which will display a 'spinner' animation and message. The animation won't prevent you from using the console as normal. Here's an example: + +```python +from time import sleep +from rich.console import Console + +console = Console() +tasks = [f"task {n}" for n in range(1, 11)] + +with console.status("[bold green]Working on tasks...") as status: + while tasks: + task = tasks.pop(0) + sleep(1) + console.log(f"{task} complete") +``` + +This generates the following output in the terminal. + +![status](https://github.com/willmcgugan/rich/raw/master/imgs/status.gif) + +The spinner animations were borrowed from [cli-spinners](https://www.npmjs.com/package/cli-spinners). You can select a spinner by specifying the `spinner` parameter. Run the following command to see the available values: + +``` +python -m rich.spinner +``` + +The above command generate the following output in the terminal: + +![spinners](https://github.com/willmcgugan/rich/raw/master/imgs/spinners.gif) + +## Tree + +Rich can render a [tree](https://rich.readthedocs.io/en/latest/tree.html) with guide lines. A tree is ideal for displaying a file structure, or any other hierarchical data. + +The labels of the tree can be simple text or anything else Rich can render. Run the following for a demonstration: + +``` +python -m rich.tree +``` + +This generates the following output: + +![markdown](https://github.com/willmcgugan/rich/raw/master/imgs/tree.png) + +See the [tree.py](https://github.com/willmcgugan/rich/blob/master/examples/tree.py) example for a script that displays a tree view of any directory, similar to the linux `tree` command. + +## Columns + +Rich can render content in neat [columns](https://rich.readthedocs.io/en/latest/columns.html) with equal or optimal width. Here's a very basic clone of the (MacOS / Linux) `ls` command which displays a directory listing in columns: + +```python +import os +import sys + +from rich import print +from rich.columns import Columns + +directory = os.listdir(sys.argv[1]) +print(Columns(directory)) +``` + +The following screenshot is the output from the [columns example](https://github.com/willmcgugan/rich/blob/master/examples/columns.py) which displays data pulled from an API in columns: + +![columns](https://github.com/willmcgugan/rich/raw/master/imgs/columns.png) + +## Markdown + +Rich can render [markdown](https://rich.readthedocs.io/en/latest/markdown.html) and does a reasonable job of translating the formatting to the terminal. + +To render markdown import the `Markdown` class and construct it with a string containing markdown code. Then print it to the console. Here's an example: + +```python +from rich.console import Console +from rich.markdown import Markdown + +console = Console() +with open("README.md") as readme: + markdown = Markdown(readme.read()) +console.print(markdown) +``` + +This will produce output something like the following: + +![markdown](https://github.com/willmcgugan/rich/raw/master/imgs/markdown.png) + +## Syntax Highlighting + +Rich uses the [pygments](https://pygments.org/) library to implement [syntax highlighting](https://rich.readthedocs.io/en/latest/syntax.html). Usage is similar to rendering markdown; construct a `Syntax` object and print it to the console. Here's an example: + +```python +from rich.console import Console +from rich.syntax import Syntax + +my_code = ''' +def iter_first_last(values: Iterable[T]) -> Iterable[Tuple[bool, bool, T]]: + """Iterate and generate a tuple with a flag for first and last value.""" + iter_values = iter(values) + try: + previous_value = next(iter_values) + except StopIteration: + return + first = True + for value in iter_values: + yield first, False, previous_value + first = False + previous_value = value + yield first, True, previous_value +''' +syntax = Syntax(my_code, "python", theme="monokai", line_numbers=True) +console = Console() +console.print(syntax) +``` + +This will produce the following output: + +![syntax](https://github.com/willmcgugan/rich/raw/master/imgs/syntax.png) + +## Tracebacks + +Rich can render [beautiful tracebacks](https://rich.readthedocs.io/en/latest/traceback.html) which are easier to read and show more code than standard Python tracebacks. You can set Rich as the default traceback handler so all uncaught exceptions will be rendered by Rich. + +Here's what it looks like on OSX (similar on Linux): + +![traceback](https://github.com/willmcgugan/rich/raw/master/imgs/traceback.png) + +## Project using Rich + +Here are a few projects using Rich: + +- [BrancoLab/BrainRender](https://github.com/BrancoLab/BrainRender) + a python package for the visualization of three dimensional neuro-anatomical data +- [Ciphey/Ciphey](https://github.com/Ciphey/Ciphey) + Automated decryption tool +- [emeryberger/scalene](https://github.com/emeryberger/scalene) + a high-performance, high-precision CPU and memory profiler for Python +- [hedythedev/StarCli](https://github.com/hedythedev/starcli) + Browse GitHub trending projects from your command line +- [intel/cve-bin-tool](https://github.com/intel/cve-bin-tool) + This tool scans for a number of common, vulnerable components (openssl, libpng, libxml2, expat and a few others) to let you know if your system includes common libraries with known vulnerabilities. +- [nf-core/tools](https://github.com/nf-core/tools) + Python package with helper tools for the nf-core community. +- [cansarigol/pdbr](https://github.com/cansarigol/pdbr) + pdb + Rich library for enhanced debugging +- [plant99/felicette](https://github.com/plant99/felicette) + Satellite imagery for dummies. +- [seleniumbase/SeleniumBase](https://github.com/seleniumbase/SeleniumBase) + Automate & test 10x faster with Selenium & pytest. Batteries included. +- [smacke/ffsubsync](https://github.com/smacke/ffsubsync) + Automagically synchronize subtitles with video. +- [tryolabs/norfair](https://github.com/tryolabs/norfair) + Lightweight Python library for adding real-time 2D object tracking to any detector. +- [ansible/ansible-lint](https://github.com/ansible/ansible-lint) Ansible-lint checks playbooks for practices and behaviour that could potentially be improved +- [ansible-community/molecule](https://github.com/ansible-community/molecule) Ansible Molecule testing framework +- +[Many more](https://github.com/willmcgugan/rich/network/dependents)! diff --git a/testbed/Textualize__rich/docs/source/appendix.rst b/testbed/Textualize__rich/docs/source/appendix.rst new file mode 100644 index 0000000000000000000000000000000000000000..3ae7fa68b48e22113199e4d73b84ebb6bdaf1a31 --- /dev/null +++ b/testbed/Textualize__rich/docs/source/appendix.rst @@ -0,0 +1,9 @@ +Appendix +========= + +.. toctree:: + :maxdepth: 3 + + appendix/box.rst + appendix/colors.rst + \ No newline at end of file diff --git a/testbed/Textualize__rich/docs/source/appendix/box.rst b/testbed/Textualize__rich/docs/source/appendix/box.rst new file mode 100644 index 0000000000000000000000000000000000000000..9178953514ad3bec46b3a8bd02a44e605efae925 --- /dev/null +++ b/testbed/Textualize__rich/docs/source/appendix/box.rst @@ -0,0 +1,79 @@ +.. _appendix_box: + +Box +=== + +Rich has a number of constants that set the box characters used to draw tables and panels. To select a box style import one of the constants below from ``rich.box``. For example:: + + from rich import box + table = Table(box=box.SQUARE) + + +.. note:: + Some of the box drawing characters will not display correctly on Windows legacy terminal (cmd.exe) with *raster* fonts, and are disabled by default. If you want the full range of box options on Windows legacy terminal, use a *truetype* font and set the ``safe_box`` parameter on the Table class to ``False``. + + +The following table is generated with this command:: + + python -m rich.box + +.. raw:: html + +
╭──────────────────────────────────────────────────────────────────────────────╮
+                                    Box Constants                                 │
+    ╰──────────────────────────────────────────────────────────────────────────────╯
+
+            box.ASCII                   box.SQUARE                box.MINIMAL       
+    +------------------------+  ┌────────────┬───────────┐                          
+    | Header 1   | Header 2  |  │ Header 1    Header 2   Header 1   Header 2  
+    |------------+-----------|  ├────────────┼───────────┤   ───────────┼────────── 
+    | Cell       | Cell      |  │ Cell        Cell       Cell       Cell      
+    | Cell       | Cell      |  │ Cell        Cell       Cell       Cell      
+    |------------+-----------|  ├────────────┼───────────┤   ───────────┼────────── 
+    | Footer 1   | Footer 2  |  │ Footer 1    Footer 2   Footer 1   Footer 2  
+    +------------------------+  └────────────┴───────────┘                          
+                                                                                    
+                                                                                    
+      box.MINIMAL_HEAVY_HEAD     box.MINIMAL_DOUBLE_HEAD           box.SIMPLE       
+                                                                                    
+      Header 1    Header 2       Header 1    Header 2       Header 1    Header 2  
+     ━━━━━━━━━━━━┿━━━━━━━━━━━    ════════════╪═══════════   ────────────────────────
+      Cell        Cell           Cell        Cell           Cell        Cell      
+      Cell        Cell           Cell        Cell           Cell        Cell      
+     ────────────┼───────────    ────────────┼───────────   ────────────────────────
+      Footer 1    Footer 2       Footer 1    Footer 2       Footer 1    Footer 2  
+                                                                                    
+                                                                                    
+                                                                                    
+         box.SIMPLE_HEAVY            box.HORIZONTALS              box.ROUNDED       
+                                ──────────────────────────  ╭───────────┬──────────╮
+      Header 1     Header 2       Header 1     Header 2   Header 1   Header 2 │
+    ╺━━━━━━━━━━━━━━━━━━━━━━━━╸  ──────────────────────────  ├───────────┼──────────┤
+      Cell         Cell           Cell         Cell       Cell       Cell     │
+      Cell         Cell           Cell         Cell       Cell       Cell     │
+    ╺━━━━━━━━━━━━━━━━━━━━━━━━╸  ──────────────────────────  ├───────────┼──────────┤
+      Footer 1     Footer 2       Footer 1     Footer 2   Footer 1   Footer 2 │
+                                ──────────────────────────  ╰───────────┴──────────╯
+                                                                                    
+                                                                                    
+            box.HEAVY                 box.HEAVY_EDGE             box.HEAVY_HEAD     
+    ┏━━━━━━━━━━━━┳━━━━━━━━━━━┓  ┏━━━━━━━━━━━━┯━━━━━━━━━━━┓  ┏━━━━━━━━━━━┳━━━━━━━━━━┓
+    ┃ Header 1    Header 2  ┃  ┃ Header 1    Header 2  ┃  ┃ Header 1   Header 2 ┃
+    ┣━━━━━━━━━━━━╋━━━━━━━━━━━┫  ┠────────────┼───────────┨  ┡━━━━━━━━━━━╇━━━━━━━━━━┩
+    ┃ Cell        Cell      ┃  ┃ Cell        Cell      ┃  │ Cell       Cell     │
+    ┃ Cell        Cell      ┃  ┃ Cell        Cell      ┃  │ Cell       Cell     │
+    ┣━━━━━━━━━━━━╋━━━━━━━━━━━┫  ┠────────────┼───────────┨  ├───────────┼──────────┤
+    ┃ Footer 1    Footer 2  ┃  ┃ Footer 1    Footer 2  ┃  │ Footer 1   Footer 2 │
+    ┗━━━━━━━━━━━━┻━━━━━━━━━━━┛  ┗━━━━━━━━━━━━┷━━━━━━━━━━━┛  └───────────┴──────────┘
+                                                                                    
+                                                                                    
+            box.DOUBLE               box.DOUBLE_EDGE                                
+    ╔════════════╦═══════════╗  ╔════════════╤═══════════╗                          
+    ║ Header 1    Header 2  ║  ║ Header 1    Header 2  ║                          
+    ╠════════════╬═══════════╣  ╟────────────┼───────────╢                          
+    ║ Cell        Cell      ║  ║ Cell        Cell      ║                          
+    ║ Cell        Cell      ║  ║ Cell        Cell      ║                          
+    ╠════════════╬═══════════╣  ╟────────────┼───────────╢                          
+    ║ Footer 1    Footer 2  ║  ║ Footer 1    Footer 2  ║                          
+    ╚════════════╩═══════════╝  ╚════════════╧═══════════╝                          
+    
diff --git a/testbed/Textualize__rich/docs/source/appendix/colors.rst b/testbed/Textualize__rich/docs/source/appendix/colors.rst new file mode 100644 index 0000000000000000000000000000000000000000..fa65f4fd9d1c59cbc29adde31502e359af24a595 --- /dev/null +++ b/testbed/Textualize__rich/docs/source/appendix/colors.rst @@ -0,0 +1,220 @@ +.. _appendix-colors: + +Standard Colors +=============== + +The following is a list of the standard 8-bit colors supported in terminals. + +Note that the first 16 colors are generally defined by the system or your terminal software, and may not display exactly as rendered here. + +.. raw:: html + + +
╔════════════╤════════╤═══════════════════════╤═════════╤══════════════════╗
+    ║ Color       Number  Name                   Hex      RGB              ║
+    ╟────────────┼────────┼───────────────────────┼─────────┼──────────────────╢
+    ║                 0  "black"                                          ║
+    ║                 1  "red"                                            ║
+    ║                 2  "green"                                          ║
+    ║                 3  "yellow"                                         ║
+    ║                 4  "blue"                                           ║
+    ║                 5  "magenta"                                        ║
+    ║                 6  "cyan"                                           ║
+    ║                 7  "white"                                          ║
+    ║                 8  "bright_black"                                   ║
+    ║                 9  "bright_red"                                     ║
+    ║                10  "bright_green"                                   ║
+    ║                11  "bright_yellow"                                  ║
+    ║                12  "bright_blue"                                    ║
+    ║                13  "bright_magenta"                                 ║
+    ║                14  "bright_cyan"                                    ║
+    ║                15  "bright_white"                                   ║
+    ║                16  "grey0"                #000000  rgb(0,0,0)       ║
+    ║                17  "navy_blue"            #00005f  rgb(0,0,95)      ║
+    ║                18  "dark_blue"            #000087  rgb(0,0,135)     ║
+    ║                20  "blue3"                #0000d7  rgb(0,0,215)     ║
+    ║                21  "blue1"                #0000ff  rgb(0,0,255)     ║
+    ║                22  "dark_green"           #005f00  rgb(0,95,0)      ║
+    ║                25  "deep_sky_blue4"       #005faf  rgb(0,95,175)    ║
+    ║                26  "dodger_blue3"         #005fd7  rgb(0,95,215)    ║
+    ║                27  "dodger_blue2"         #005fff  rgb(0,95,255)    ║
+    ║                28  "green4"               #008700  rgb(0,135,0)     ║
+    ║                29  "spring_green4"        #00875f  rgb(0,135,95)    ║
+    ║                30  "turquoise4"           #008787  rgb(0,135,135)   ║
+    ║                32  "deep_sky_blue3"       #0087d7  rgb(0,135,215)   ║
+    ║                33  "dodger_blue1"         #0087ff  rgb(0,135,255)   ║
+    ║                36  "dark_cyan"            #00af87  rgb(0,175,135)   ║
+    ║                37  "light_sea_green"      #00afaf  rgb(0,175,175)   ║
+    ║                38  "deep_sky_blue2"       #00afd7  rgb(0,175,215)   ║
+    ║                39  "deep_sky_blue1"       #00afff  rgb(0,175,255)   ║
+    ║                40  "green3"               #00d700  rgb(0,215,0)     ║
+    ║                41  "spring_green3"        #00d75f  rgb(0,215,95)    ║
+    ║                43  "cyan3"                #00d7af  rgb(0,215,175)   ║
+    ║                44  "dark_turquoise"       #00d7d7  rgb(0,215,215)   ║
+    ║                45  "turquoise2"           #00d7ff  rgb(0,215,255)   ║
+    ║                46  "green1"               #00ff00  rgb(0,255,0)     ║
+    ║                47  "spring_green2"        #00ff5f  rgb(0,255,95)    ║
+    ║                48  "spring_green1"        #00ff87  rgb(0,255,135)   ║
+    ║                49  "medium_spring_green"  #00ffaf  rgb(0,255,175)   ║
+    ║                50  "cyan2"                #00ffd7  rgb(0,255,215)   ║
+    ║                51  "cyan1"                #00ffff  rgb(0,255,255)   ║
+    ║                55  "purple4"              #5f00af  rgb(95,0,175)    ║
+    ║                56  "purple3"              #5f00d7  rgb(95,0,215)    ║
+    ║                57  "blue_violet"          #5f00ff  rgb(95,0,255)    ║
+    ║                59  "grey37"               #5f5f5f  rgb(95,95,95)    ║
+    ║                60  "medium_purple4"       #5f5f87  rgb(95,95,135)   ║
+    ║                62  "slate_blue3"          #5f5fd7  rgb(95,95,215)   ║
+    ║                63  "royal_blue1"          #5f5fff  rgb(95,95,255)   ║
+    ║                64  "chartreuse4"          #5f8700  rgb(95,135,0)    ║
+    ║                66  "pale_turquoise4"      #5f8787  rgb(95,135,135)  ║
+    ║                67  "steel_blue"           #5f87af  rgb(95,135,175)  ║
+    ║                68  "steel_blue3"          #5f87d7  rgb(95,135,215)  ║
+    ║                69  "cornflower_blue"      #5f87ff  rgb(95,135,255)  ║
+    ║                71  "dark_sea_green4"      #5faf5f  rgb(95,175,95)   ║
+    ║                73  "cadet_blue"           #5fafaf  rgb(95,175,175)  ║
+    ║                74  "sky_blue3"            #5fafd7  rgb(95,175,215)  ║
+    ║                76  "chartreuse3"          #5fd700  rgb(95,215,0)    ║
+    ║                78  "sea_green3"           #5fd787  rgb(95,215,135)  ║
+    ║                79  "aquamarine3"          #5fd7af  rgb(95,215,175)  ║
+    ║                80  "medium_turquoise"     #5fd7d7  rgb(95,215,215)  ║
+    ║                81  "steel_blue1"          #5fd7ff  rgb(95,215,255)  ║
+    ║                83  "sea_green2"           #5fff5f  rgb(95,255,95)   ║
+    ║                85  "sea_green1"           #5fffaf  rgb(95,255,175)  ║
+    ║                87  "dark_slate_gray2"     #5fffff  rgb(95,255,255)  ║
+    ║                88  "dark_red"             #870000  rgb(135,0,0)     ║
+    ║                91  "dark_magenta"         #8700af  rgb(135,0,175)   ║
+    ║                94  "orange4"              #875f00  rgb(135,95,0)    ║
+    ║                95  "light_pink4"          #875f5f  rgb(135,95,95)   ║
+    ║                96  "plum4"                #875f87  rgb(135,95,135)  ║
+    ║                98  "medium_purple3"       #875fd7  rgb(135,95,215)  ║
+    ║                99  "slate_blue1"          #875fff  rgb(135,95,255)  ║
+    ║               101  "wheat4"               #87875f  rgb(135,135,95)  ║
+    ║               102  "grey53"               #878787  rgb(135,135,135) ║
+    ║               103  "light_slate_grey"     #8787af  rgb(135,135,175) ║
+    ║               104  "medium_purple"        #8787d7  rgb(135,135,215) ║
+    ║               105  "light_slate_blue"     #8787ff  rgb(135,135,255) ║
+    ║               106  "yellow4"              #87af00  rgb(135,175,0)   ║
+    ║               108  "dark_sea_green"       #87af87  rgb(135,175,135) ║
+    ║               110  "light_sky_blue3"      #87afd7  rgb(135,175,215) ║
+    ║               111  "sky_blue2"            #87afff  rgb(135,175,255) ║
+    ║               112  "chartreuse2"          #87d700  rgb(135,215,0)   ║
+    ║               114  "pale_green3"          #87d787  rgb(135,215,135) ║
+    ║               116  "dark_slate_gray3"     #87d7d7  rgb(135,215,215) ║
+    ║               117  "sky_blue1"            #87d7ff  rgb(135,215,255) ║
+    ║               118  "chartreuse1"          #87ff00  rgb(135,255,0)   ║
+    ║               120  "light_green"          #87ff87  rgb(135,255,135) ║
+    ║               122  "aquamarine1"          #87ffd7  rgb(135,255,215) ║
+    ║               123  "dark_slate_gray1"     #87ffff  rgb(135,255,255) ║
+    ║               125  "deep_pink4"           #af005f  rgb(175,0,95)    ║
+    ║               126  "medium_violet_red"    #af0087  rgb(175,0,135)   ║
+    ║               128  "dark_violet"          #af00d7  rgb(175,0,215)   ║
+    ║               129  "purple"               #af00ff  rgb(175,0,255)   ║
+    ║               133  "medium_orchid3"       #af5faf  rgb(175,95,175)  ║
+    ║               134  "medium_orchid"        #af5fd7  rgb(175,95,215)  ║
+    ║               136  "dark_goldenrod"       #af8700  rgb(175,135,0)   ║
+    ║               138  "rosy_brown"           #af8787  rgb(175,135,135) ║
+    ║               139  "grey63"               #af87af  rgb(175,135,175) ║
+    ║               140  "medium_purple2"       #af87d7  rgb(175,135,215) ║
+    ║               141  "medium_purple1"       #af87ff  rgb(175,135,255) ║
+    ║               143  "dark_khaki"           #afaf5f  rgb(175,175,95)  ║
+    ║               144  "navajo_white3"        #afaf87  rgb(175,175,135) ║
+    ║               145  "grey69"               #afafaf  rgb(175,175,175) ║
+    ║               146  "light_steel_blue3"    #afafd7  rgb(175,175,215) ║
+    ║               147  "light_steel_blue"     #afafff  rgb(175,175,255) ║
+    ║               149  "dark_olive_green3"    #afd75f  rgb(175,215,95)  ║
+    ║               150  "dark_sea_green3"      #afd787  rgb(175,215,135) ║
+    ║               152  "light_cyan3"          #afd7d7  rgb(175,215,215) ║
+    ║               153  "light_sky_blue1"      #afd7ff  rgb(175,215,255) ║
+    ║               154  "green_yellow"         #afff00  rgb(175,255,0)   ║
+    ║               155  "dark_olive_green2"    #afff5f  rgb(175,255,95)  ║
+    ║               156  "pale_green1"          #afff87  rgb(175,255,135) ║
+    ║               157  "dark_sea_green2"      #afffaf  rgb(175,255,175) ║
+    ║               159  "pale_turquoise1"      #afffff  rgb(175,255,255) ║
+    ║               160  "red3"                 #d70000  rgb(215,0,0)     ║
+    ║               162  "deep_pink3"           #d70087  rgb(215,0,135)   ║
+    ║               164  "magenta3"             #d700d7  rgb(215,0,215)   ║
+    ║               166  "dark_orange3"         #d75f00  rgb(215,95,0)    ║
+    ║               167  "indian_red"           #d75f5f  rgb(215,95,95)   ║
+    ║               168  "hot_pink3"            #d75f87  rgb(215,95,135)  ║
+    ║               169  "hot_pink2"            #d75faf  rgb(215,95,175)  ║
+    ║               170  "orchid"               #d75fd7  rgb(215,95,215)  ║
+    ║               172  "orange3"              #d78700  rgb(215,135,0)   ║
+    ║               173  "light_salmon3"        #d7875f  rgb(215,135,95)  ║
+    ║               174  "light_pink3"          #d78787  rgb(215,135,135) ║
+    ║               175  "pink3"                #d787af  rgb(215,135,175) ║
+    ║               176  "plum3"                #d787d7  rgb(215,135,215) ║
+    ║               177  "violet"               #d787ff  rgb(215,135,255) ║
+    ║               178  "gold3"                #d7af00  rgb(215,175,0)   ║
+    ║               179  "light_goldenrod3"     #d7af5f  rgb(215,175,95)  ║
+    ║               180  "tan"                  #d7af87  rgb(215,175,135) ║
+    ║               181  "misty_rose3"          #d7afaf  rgb(215,175,175) ║
+    ║               182  "thistle3"             #d7afd7  rgb(215,175,215) ║
+    ║               183  "plum2"                #d7afff  rgb(215,175,255) ║
+    ║               184  "yellow3"              #d7d700  rgb(215,215,0)   ║
+    ║               185  "khaki3"               #d7d75f  rgb(215,215,95)  ║
+    ║               187  "light_yellow3"        #d7d7af  rgb(215,215,175) ║
+    ║               188  "grey84"               #d7d7d7  rgb(215,215,215) ║
+    ║               189  "light_steel_blue1"    #d7d7ff  rgb(215,215,255) ║
+    ║               190  "yellow2"              #d7ff00  rgb(215,255,0)   ║
+    ║               192  "dark_olive_green1"    #d7ff87  rgb(215,255,135) ║
+    ║               193  "dark_sea_green1"      #d7ffaf  rgb(215,255,175) ║
+    ║               194  "honeydew2"            #d7ffd7  rgb(215,255,215) ║
+    ║               195  "light_cyan1"          #d7ffff  rgb(215,255,255) ║
+    ║               196  "red1"                 #ff0000  rgb(255,0,0)     ║
+    ║               197  "deep_pink2"           #ff005f  rgb(255,0,95)    ║
+    ║               199  "deep_pink1"           #ff00af  rgb(255,0,175)   ║
+    ║               200  "magenta2"             #ff00d7  rgb(255,0,215)   ║
+    ║               201  "magenta1"             #ff00ff  rgb(255,0,255)   ║
+    ║               202  "orange_red1"          #ff5f00  rgb(255,95,0)    ║
+    ║               204  "indian_red1"          #ff5f87  rgb(255,95,135)  ║
+    ║               206  "hot_pink"             #ff5fd7  rgb(255,95,215)  ║
+    ║               207  "medium_orchid1"       #ff5fff  rgb(255,95,255)  ║
+    ║               208  "dark_orange"          #ff8700  rgb(255,135,0)   ║
+    ║               209  "salmon1"              #ff875f  rgb(255,135,95)  ║
+    ║               210  "light_coral"          #ff8787  rgb(255,135,135) ║
+    ║               211  "pale_violet_red1"     #ff87af  rgb(255,135,175) ║
+    ║               212  "orchid2"              #ff87d7  rgb(255,135,215) ║
+    ║               213  "orchid1"              #ff87ff  rgb(255,135,255) ║
+    ║               214  "orange1"              #ffaf00  rgb(255,175,0)   ║
+    ║               215  "sandy_brown"          #ffaf5f  rgb(255,175,95)  ║
+    ║               216  "light_salmon1"        #ffaf87  rgb(255,175,135) ║
+    ║               217  "light_pink1"          #ffafaf  rgb(255,175,175) ║
+    ║               218  "pink1"                #ffafd7  rgb(255,175,215) ║
+    ║               219  "plum1"                #ffafff  rgb(255,175,255) ║
+    ║               220  "gold1"                #ffd700  rgb(255,215,0)   ║
+    ║               222  "light_goldenrod2"     #ffd787  rgb(255,215,135) ║
+    ║               223  "navajo_white1"        #ffd7af  rgb(255,215,175) ║
+    ║               224  "misty_rose1"          #ffd7d7  rgb(255,215,215) ║
+    ║               225  "thistle1"             #ffd7ff  rgb(255,215,255) ║
+    ║               226  "yellow1"              #ffff00  rgb(255,255,0)   ║
+    ║               227  "light_goldenrod1"     #ffff5f  rgb(255,255,95)  ║
+    ║               228  "khaki1"               #ffff87  rgb(255,255,135) ║
+    ║               229  "wheat1"               #ffffaf  rgb(255,255,175) ║
+    ║               230  "cornsilk1"            #ffffd7  rgb(255,255,215) ║
+    ║               231  "grey100"              #ffffff  rgb(255,255,255) ║
+    ║               232  "grey3"                #080808  rgb(8,8,8)       ║
+    ║               233  "grey7"                #121212  rgb(18,18,18)    ║
+    ║               234  "grey11"               #1c1c1c  rgb(28,28,28)    ║
+    ║               235  "grey15"               #262626  rgb(38,38,38)    ║
+    ║               236  "grey19"               #303030  rgb(48,48,48)    ║
+    ║               237  "grey23"               #3a3a3a  rgb(58,58,58)    ║
+    ║               238  "grey27"               #444444  rgb(68,68,68)    ║
+    ║               239  "grey30"               #4e4e4e  rgb(78,78,78)    ║
+    ║               240  "grey35"               #585858  rgb(88,88,88)    ║
+    ║               241  "grey39"               #626262  rgb(98,98,98)    ║
+    ║               242  "grey42"               #6c6c6c  rgb(108,108,108) ║
+    ║               243  "grey46"               #767676  rgb(118,118,118) ║
+    ║               244  "grey50"               #808080  rgb(128,128,128) ║
+    ║               245  "grey54"               #8a8a8a  rgb(138,138,138) ║
+    ║               246  "grey58"               #949494  rgb(148,148,148) ║
+    ║               247  "grey62"               #9e9e9e  rgb(158,158,158) ║
+    ║               248  "grey66"               #a8a8a8  rgb(168,168,168) ║
+    ║               249  "grey70"               #b2b2b2  rgb(178,178,178) ║
+    ║               250  "grey74"               #bcbcbc  rgb(188,188,188) ║
+    ║               251  "grey78"               #c6c6c6  rgb(198,198,198) ║
+    ║               252  "grey82"               #d0d0d0  rgb(208,208,208) ║
+    ║               253  "grey85"               #dadada  rgb(218,218,218) ║
+    ║               254  "grey89"               #e4e4e4  rgb(228,228,228) ║
+    ║               255  "grey93"               #eeeeee  rgb(238,238,238) ║
+    ╚════════════╧════════╧═══════════════════════╧═════════╧══════════════════╝
+    
diff --git a/testbed/Textualize__rich/docs/source/highlighting.rst b/testbed/Textualize__rich/docs/source/highlighting.rst new file mode 100644 index 0000000000000000000000000000000000000000..260cfbeacdc30355758a33efb385200aadf65b0c --- /dev/null +++ b/testbed/Textualize__rich/docs/source/highlighting.rst @@ -0,0 +1,58 @@ +Highlighting +============ + +Rich can apply styles to patterns in text which you :meth:`~rich.console.Console.print` or :meth:`~rich.console.Console.log`. With the default settings, Rich will highlight things such as numbers, strings, collections, booleans, None, and a few more exotic patterns such as file paths, URLs and UUIDs. + +You can disable highlighting either by setting ``highlight=False`` on :meth:`~rich.console.Console.print` or :meth:`~rich.console.Console.log`, or by setting ``highlight=False`` on the :class:`~rich.console.Console` constructor which disables it everywhere. If you disable highlighting on the constructor, you can still selectively *enable* highlighting with ``highlight=True`` on print/log. + +Custom Highlighters +------------------- + +If the default highlighting doesn't fit your needs, you can define a custom highlighter. The easiest way to do this is to extend the :class:`~rich.highlighter.RegexHighlighter` class which applies a style to any text matching a list of regular expressions. + +Here's an example which highlights text that looks like an email address:: + + from rich.console import Console + from rich.highlighter import RegexHighlighter + from rich.theme import Theme + + class EmailHighlighter(RegexHighlighter): + """Apply style to anything that looks like an email.""" + + base_style = "example." + highlights = [r"(?P[\w-]+@([\w-]+\.)+[\w-]+)"] + + + theme = Theme({"example.email": "bold magenta"}) + console = Console(highlighter=EmailHighlighter(), theme=theme) + console.print("Send funds to money@example.org") + + +The ``highlights`` class variable should contain a list of regular expressions. The group names of any matching expressions are prefixed with the ``base_style`` attribute and used as styles for matching text. In the example above, any email addresses will have the style "example.email" applied, which we've defined in a custom :ref:`Theme `. + +Setting the highlighter on the Console will apply highlighting to all text you print (if enabled). You can also use a highlighter on a more granular level by using the instance as a callable and printing the result. For example, we could use the email highlighter class like this:: + + + console = Console(theme=theme) + highlight_emails = EmailHighlighter() + console.print(highlight_emails("Send funds to money@example.org")) + + +While :class:`~rich.highlighter.RegexHighlighter` is quite powerful, you can also extend its base class :class:`~rich.highlighter.Highlighter` to implement a custom scheme for highlighting. It contains a single method :class:`~rich.highlighter.Highlighter.highlight` which is passed the :class:`~rich.text.Text` to highlight. + +Here's a silly example that highlights every character with a different color:: + + from random import randint + + from rich import print + from rich.highlighter import Highlighter + + + class RainbowHighlighter(Highlighter): + def highlight(self, text): + for index in range(len(text)): + text.stylize(f"color({randint(16, 255)})", index, index + 1) + + + rainbow = RainbowHighlighter() + print(rainbow("I must not fear. Fear is the mind-killer.")) diff --git a/testbed/Textualize__rich/docs/source/index.rst b/testbed/Textualize__rich/docs/source/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..be116a241e3bb1eb3da695340d31a01532a0e36d --- /dev/null +++ b/testbed/Textualize__rich/docs/source/index.rst @@ -0,0 +1,44 @@ +.. Rich documentation master file, created by + sphinx-quickstart on Thu Dec 26 17:03:20 2019. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to Rich's documentation! +================================ + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + introduction.rst + console.rst + style.rst + markup.rst + text.rst + highlighting.rst + logging.rst + traceback.rst + prompt.rst + + columns.rst + group.rst + live.rst + markdown.rst + padding.rst + panel.rst + progress.rst + syntax.rst + tables.rst + tree.rst + + protocol.rst + + reference.rst + appendix.rst + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/testbed/Textualize__rich/docs/source/introduction.rst b/testbed/Textualize__rich/docs/source/introduction.rst new file mode 100644 index 0000000000000000000000000000000000000000..ace65bdbcb03f2d0be6fb81c7ff668bb2620e0cd --- /dev/null +++ b/testbed/Textualize__rich/docs/source/introduction.rst @@ -0,0 +1,97 @@ +Introduction +============ + +Rich is a Python library for writing *rich* text (with color and style) to the terminal, and for displaying advanced content such as tables, markdown, and syntax highlighted code. + +Use Rich to make your command line applications visually appealing and present data in a more readable way. Rich can also be a useful debugging aid by pretty printing and syntax highlighting data structures. + +Requirements +------------ + +Rich works with OSX, Linux and Windows. + +On Windows both the (ancient) cmd.exe terminal is supported and the new `Windows Terminal `_. The later has much improved support for color and style. + +Rich requires Python 3.6.1 and above. Note that Python 3.6.0 is *not* supported due to lack of support for methods on NamedTuples. + +.. note:: + PyCharm users will need to enable "emulate terminal" in output console option in run/debug configuration to see styled output. + +Installation +------------ + +You can install Rich with from PyPi with `pip` or your favorite package manager:: + + pip install rich + +Add the ``-U`` switch to update to the current version, if Rich is already installed. + +If you intend to use Rich with Jupyter then there are some additional dependencies which you can install with the following command:: + + pip install rich[jupyter] + + +Quick Start +----------- + +The quickest way to get up and running with Rich is to import the alternative ``print`` function which takes the same arguments as the built-in ``print`` and may be used as a drop-in replacement. Here's how you would do that:: + + from rich import print + +You can then print strings or objects to the terminal in the usual way. Rich will do some basic syntax highlighting and format data structures to make them easier to read. + +Strings may contain :ref:`console_markup` which can be used to insert color and styles in to the output. + +The following demonstrates both console markup and pretty formatting of Python objects:: + + >>> print("[italic red]Hello[/italic red] World!", locals()) + +This writes the following output to the terminal (including all the colors and styles): + +.. raw:: html + +
Hello World!                                                 
+    {
+        '__annotations__': {},
+        '__builtins__': <module 'builtins' (built-in)>,
+        '__doc__': None,
+        '__loader__': <class '_frozen_importlib.BuiltinImporter'>,
+        '__name__': '__main__',
+        '__package__': None,
+        '__spec__': None,
+        'print': <function print at 0x1027fd4c0>,
+    } 
+ + +If you would rather not shadow Python's builtin print, you can import ``rich.print`` as ``rprint`` (for example):: + + from rich import print as rprint + +Continue reading to learn about the more advanced features of Rich. + +Python in the REPL +------------------ + +Rich may be installed in the REPL so that Python data structures are automatically pretty printed with syntax highlighting. Here's how:: + + >>> from rich import pretty + >>> pretty.install() + >>> ["Rich and pretty", True] + +You can also use this feature to try out Rich *renderables*. Here's an example:: + + >>> from rich.panel import Panel + >>> Panel.fit("[bold yellow]Hi, I'm a Panel", border_style="red") + +Read on to learn more about Rich renderables. + + +Rich Inspector +-------------- + +Rich has an :meth:`~rich.inspect` function which can generate a report on any Python object. It is a fantastic debug aid, and a good example of the output that Rich can generate. Here is a simple example:: + + >>> from rich import inspect + >>> from rich.color import Color + >>> color = Color.parse("red") + >>> inspect(color, methods=True) \ No newline at end of file diff --git a/testbed/Textualize__rich/docs/source/live.rst b/testbed/Textualize__rich/docs/source/live.rst new file mode 100644 index 0000000000000000000000000000000000000000..3a802efd36e33a5ba4af244b24dfa8c93451d161 --- /dev/null +++ b/testbed/Textualize__rich/docs/source/live.rst @@ -0,0 +1,172 @@ +.. _live: + +Live Display +============ + +Rich can display continiuously updated information for any renderable. + +To see some live display examples, try this from the command line:: + + python -m rich.live + +.. note:: + + If you see ellipsis "...", this indicates that the terminal is not tall enough to show the full table. + +Basic Usage +----------- + +The basic usage can be split into two use cases. + +1. Same Renderable +~~~~~~~~~~~~~~~~~~ + +When keeping the same renderable, you simply pass the :class:`~rich.console.RenderableType` you would like to see updating and provide +a ``refresh_per_second`` parameter. The Live :class:`~rich.live.Live` will automatically update the console at the provided refresh rate. + + +**Example**:: + + import time + + from rich.live import Live + from rich.table import Table + + table = Table() + table.add_column("Row ID") + table.add_column("Description") + table.add_column("Level") + + with Live(table, refresh_per_second=4): # update 4 times a second to feel fluid + for row in range(12): + time.sleep(0.4) # arbitrary delay + # update the renderable internally + table.add_row(f"{row}", f"description {row}", "[red]ERROR") + + +2. New Renderable +~~~~~~~~~~~~~~~~~ + +You can also provide constant new renderable to :class:`~rich.live.Live` using the :meth:`~rich.live.Live.update` function. This allows you to +completely change what is rendered live. + +**Example**:: + + import random + import time + + from rich.live import Live + from rich.table import Table + + + def generate_table() -> Table: + + table = Table() + table.add_column("ID") + table.add_column("Value") + table.add_column("Status") + + for row in range(random.randint(2, 6)): + value = random.random() * 100 + table.add_row( + f"{row}", f"{value:3.2f}", "[red]ERROR" if value < 50 else "[green]SUCCESS" + ) + return table + + + with Live(refresh_per_second=4) as live: + for _ in range(40): + time.sleep(0.4) + live.update(generate_table()) + +Advanced Usage +-------------- + +Transient Display +~~~~~~~~~~~~~~~~~ + +Normally when you exit live context manager (or call :meth:`~rich.live.Live.stop`) the last refreshed item remains in the terminal with the cursor on the following line. +You can also make the live display disappear on exit by setting ``transient=True`` on the Live constructor. Here's an example:: + + with Live(transient=True) as live: + ... + +Auto refresh +~~~~~~~~~~~~ + +By default, the live display will refresh 4 times a second. You can set the refresh rate with the ``refresh_per_second`` argument on the :class:`~rich.live.Live` constructor. +You should set this to something lower than 4 if you know your updates will not be that frequent or higher for a smoother feeling. + +You might want to disable auto-refresh entirely if your updates are not very frequent, which you can do by setting ``auto_refresh=False`` on the constructor. +If you disable auto-refresh you will need to call :meth:`~rich.live.Live.refresh` manually or :meth:`~rich.live.Live.update` with ``refresh=True``. + +Vertical Overflow +~~~~~~~~~~~~~~~~~ + +By default, the live display will display ellipsis if the renderable is too large for the terminal. You can adjust this by setting the +``vertical_overflow`` argument on the :class:`~rich.live.Live` constructor. + +- crop: Show renderable up to the terminal height. The rest is hidden. +- ellipsis: Similar to crop except last line of the terminal is replaced with "...". This is the default behavior. +- visible: Will allow the whole renderable to be shown. Note that the display cannot be properly cleared in this mode. + +.. note:: + + Once the live display stops on a non-transient renderable, the last frame will render as **visible** since it doesn't have to be cleared. + +Complex Renders +~~~~~~~~~~~~~~~ + +Refer to the :ref:`Render Groups` about combining multiple :class:`RenderableType` together so that it may be passed into the :class:`~rich.live.Live` constructor +or :meth:`~rich.live.Live.update` method. + +For more powerful structuring it is also possible to use nested tables. + + +Print / log +~~~~~~~~~~~ + +The Live class will create an internal Console object which you can access via ``live.console``. If you print or log to this console, the output will be displayed *above* the live display. Here's an example:: + + import time + + from rich.live import Live + from rich.table import Table + + table = Table() + table.add_column("Row ID") + table.add_column("Description") + table.add_column("Level") + + with Live(table, refresh_per_second=4) as live: # update 4 times a second to feel fluid + for row in range(12): + live.console.print("Working on row #{row}") + time.sleep(0.4) + table.add_row(f"{row}", f"description {row}", "[red]ERROR") + + +If you have another Console object you want to use, pass it in to the :class:`~rich.live.Live` constructor. Here's an example:: + + from my_project import my_console + + with Live(console=my_console) as live: + my_console.print("[bold blue]Starting work!") + ... + +.. note:: + + If you are passing in a file console, the live display only show the last item once the live context is left. + +Redirecting stdout / stderr +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +To avoid breaking the live display visuals, Rich will redirect ``stdout`` and ``stderr`` so that you can use the builtin ``print`` statement. +This feature is enabled by default, but you can disable by setting ``redirect_stdout`` or ``redirect_stderr`` to ``False``. + + +Examples +-------- + +See `table_movie.py `_ and +`top_lite_simulator.py `_ +for deeper examples of live displaying. diff --git a/testbed/Textualize__rich/docs/source/logging.rst b/testbed/Textualize__rich/docs/source/logging.rst new file mode 100644 index 0000000000000000000000000000000000000000..c5579679f9926deefb0d755ecb944b7219e1a834 --- /dev/null +++ b/testbed/Textualize__rich/docs/source/logging.rst @@ -0,0 +1,47 @@ +Logging Handler +=============== + +Rich supplies a :ref:`logging handler` which will format and colorize text written by Python's logging module. + +Here's an example of how to set up a rich logger:: + + import logging + from rich.logging import RichHandler + + FORMAT = "%(message)s" + logging.basicConfig( + level="NOTSET", format=FORMAT, datefmt="[%X]", handlers=[RichHandler()] + ) + + log = logging.getLogger("rich") + log.info("Hello, World!") + +Rich logs won't render :ref:`console_markup` in logging by default as most libraries won't be aware of the need to escape literal square brackets, but you can enable it by setting ``markup=True`` on the handler. Alternatively you can enable it per log message by supplying the ``extra`` argument as follows:: + + log.error("[bold red blink]Server is shutting down![/]", extra={"markup": True}) + + +Handle exceptions +------------------- + +The :class:`~rich.logging.RichHandler` class may be configured to ues Rich's :class:`~rich.traceback.Traceback` class to format exceptions, which provides more context than a builtin exception. To get beautiful exceptions in your logs set ``rich_tracebacks=True`` on the handler constructor:: + + + import logging + from rich.logging import RichHandler + + logging.basicConfig( + level="NOTSET", + format="%(message)s", + datefmt="[%X]", + handlers=[RichHandler(rich_tracebacks=True)] + ) + + log = logging.getLogger("rich") + try: + print(1 / 0) + except Exception: + log.exception("unable print!") + + +There are a number of other options you can use to configure logging output, see the :class:`~rich.logging.RichHandler` reference for details. diff --git a/testbed/Textualize__rich/docs/source/markup.rst b/testbed/Textualize__rich/docs/source/markup.rst new file mode 100644 index 0000000000000000000000000000000000000000..997e1a7e5042e657ac49e682b2e76d3db2dcbe46 --- /dev/null +++ b/testbed/Textualize__rich/docs/source/markup.rst @@ -0,0 +1,88 @@ +.. _console_markup: + +Console Markup +============== + +Rich supports a simple markup which you can use to insert color and styles virtually everywhere Rich would accept a string (e.g. :meth:`~rich.console.Console.print` and :meth:`~rich.console.Console.log`). + + +Syntax +------ + +Console markup uses a syntax inspired by `bbcode `_. If you write the style (see :ref:`styles`) in square brackets, e.g. ``[bold red]``, that style will apply until it is *closed* with a corresponding ``[/bold red]``. + +Here's a simple example:: + + from rich import print + print("[bold red]alert![/bold red] Something happened") + +If you don't close a style, it will apply until the end of the string. Which is sometimes convenient if you want to style a single line. For example:: + + print("[bold italic yellow on red blink]This text is impossible to read") + +There is a shorthand for closing a style. If you omit the style name from the closing tag, Rich will close the last style. For example:: + + print("[bold red]Bold and red[/] not bold or red") + +These markup tags may be use in combination with each other and don't need to be strictly nested. The following examples demonstrates overlapping of markup tags:: + + print("[bold]Bold[italic] bold and italic [/bold]italic[/italic]") + +Errors +~~~~~~ + +Rich will raise :class:`~rich.errors.MarkupError` if the markup contains one of the following errors: + +- Mismatched tags, e.g. ``"[bold]Hello[/red]"`` +- No matching tag for implicit close, e.g. ``"no tags[/]"`` + + +Links +~~~~~ + +Console markup can output hyperlinks with the following syntax: ``[link=URL]text[/link]``. Here's an example:: + + print("Visit my [link=https://www.willmcgugan.com]blog[/link]!") + +If your terminal software supports hyperlinks, you will be able to click the word "blog" which will typically open a browser. If your terminal doesn't support hyperlinks, you will see the text but it won't be clickable. + + +Escaping +~~~~~~~~ + +Occasionally you may want to print something that Rich would interpret as markup. You can *escape* a tag by preceding it with a backslash. Here's an example:: + + >>> from rich import print + >>> print(r"foo\[bar]") + foo[bar] + +Without the backslash, Rich will assume that ``[bar]`` is a tag and remove it from the output if there is no "bar" style. + +.. note:: + If you want to prevent the backslash from escaping the tag and output a literal backslash before a tag you can enter two backslashes. + +The function :func:`~rich.markup.escape` will handle escaping of text for you. + +Escaping is important if you construct console markup dynamically, with ``str.format`` or f strings (for example). Without escaping it may be possible to inject tags where you don't want them. Consider the following function:: + + def greet(name): + console.print(f"Hello {name}!") + +Calling ``greet("Will")`` will print a greeting, but if you were to call ``greet("[blink]Gotcha![/blink]"])`` then you will also get blinking text, which may not be desirable. The solution is to escape the arguments:: + + from rich.markup import escape + def greet(name): + console.print(f"Hello {escape(name)}!") + +Rendering Markup +---------------- + +By default, Rich will render console markup when you explicitly pass a string to :meth:`~rich.console.Print.print` or implicitly when you embed a string in another renderable object such as :class:`~rich.table.Table` or :class:`~rich.panel.Panel`. + +Console markup is convenient, but you may wish to disable it if the syntax clashes with the string you want to print. You can do this by setting ``markup=False`` on the :meth:`~rich.console.Print.print` method or on the :class:`~rich.console.Console` constructor. + + +Markup API +---------- + +You can convert a string to styled text by calling :meth:`~rich.text.Text.from_markup`, which returns a :class:`~rich.text.Text` instance you can print or add more styles to. diff --git a/testbed/Textualize__rich/docs/source/padding.rst b/testbed/Textualize__rich/docs/source/padding.rst new file mode 100644 index 0000000000000000000000000000000000000000..a72dcbf9d5fc0f8dc4cd4a7836e2419b6f6c369b --- /dev/null +++ b/testbed/Textualize__rich/docs/source/padding.rst @@ -0,0 +1,27 @@ +Padding +======= + +The :class:`~rich.padding.Padding` class may be used to add whitespace around text or other renderable. The following example will print the word "Hello" with a padding of 1 character, so there will be a blank line above and below, and a space on the left and right edges:: + + from rich import print + from rich.padding import Padding + test = Padding("Hello", 1) + print(test) + +You can specify the padding on a more granular level by using a tuple of values rather than a single value. A tuple of 2 values sets the top/bottom and left/right padding, whereas a tuple of 4 values sets the padding for top, right, bottom, and left sides. You may recognize this scheme if you are familiar with CSS. + +For example, the following displays 2 blank lines above and below the text, and a padding of 4 spaces on the left and right sides:: + + from rich import print + from rich.padding import Padding + test = Padding("Hello", (2, 4)) + print(test) + +The Padding class can also accept a ``style`` argument which applies a style to the padding and contents, and an ``expand`` switch which can be set to False to prevent the padding from extending to the full with of the terminal. Here's an example which demonstrates both these arguments:: + + from rich import print + from rich.padding import Padding + test = Padding("Hello", (2, 4), style="on blue", expand=False) + print(test) + +Note that, as with all Rich renderables, you can use Padding any context. For instance, if you want to emphasize an item in a :class:`~rich.table.Table` you could add a Padding object to a row with a padding of 1 and a style of "on red". diff --git a/testbed/Textualize__rich/docs/source/progress.rst b/testbed/Textualize__rich/docs/source/progress.rst new file mode 100644 index 0000000000000000000000000000000000000000..41566649dfc97771d5d2d78a860f428f051aa8fd --- /dev/null +++ b/testbed/Textualize__rich/docs/source/progress.rst @@ -0,0 +1,168 @@ +.. _progress: + +Progress Display +================ + +Rich can display continuously updated information regarding the progress of long running tasks / file copies etc. The information displayed is configurable, the default will display a description of the 'task', a progress bar, percentage complete, and estimated time remaining. + +Rich progress display supports multiple tasks, each with a bar and progress information. You can use this to track concurrent tasks where the work is happening in threads or processes. + +To see how the progress display looks, try this from the command line:: + + python -m rich.progress + + +.. note:: + + Progress works with Jupyter notebooks, with the caveat that auto-refresh is disabled. You will need to explicitly call :meth:`~rich.progress.Progress.refresh` or set ``refresh=True`` when calling :meth:`~rich.progress.Progress.update`. Or use the :func:`~rich.progress.track` function which does a refresh automatically on each loop. + +Basic Usage +----------- + +For basic usage call the :func:`~rich.progress.track` function, which accepts a sequence (such as a list or range object) and an optional description of the job you are working on. The track method will yield values from the sequence and update the progress information on each iteration. Here's an example:: + + from rich.progress import track + + for n in track(range(n), description="Processing..."): + do_work(n) + +Advanced usage +-------------- + +If you require multiple tasks in the display, or wish to configure the columns in the progress display, you can work directly with the :class:`~rich.progress.Progress` class. Once you have constructed a Progress object, add task(s) with (:meth:`~rich.progress.Progress.add_task`) and update progress with :meth:`~rich.progress.Progress.update`. + +The Progress class is designed to be used as a *context manager* which will start and stop the progress display automatically. + +Here's a simple example:: + + import time + + from rich.progress import Progress + + with Progress() as progress: + + task1 = progress.add_task("[red]Downloading...", total=1000) + task2 = progress.add_task("[green]Processing...", total=1000) + task3 = progress.add_task("[cyan]Cooking...", total=1000) + + while not progress.finished: + progress.update(task1, advance=0.5) + progress.update(task2, advance=0.3) + progress.update(task3, advance=0.9) + time.sleep(0.02) + +The ``total`` value associated with a task is the number of steps that must be completed for the progress to reach 100%. A *step* in this context is whatever makes sense for your application; it could be number of bytes of a file read, or number of images processed, etc. + + +Updating tasks +~~~~~~~~~~~~~~ + +When you call :meth:`~rich.progress.Progress.add_task` you get back a `Task ID`. Use this ID to call :meth:`~rich.progress.Progress.update` whenever you have completed some work, or any information has changed. Typically you will need to update ``completed`` every time you have completed a step. You can do this by updated ``completed`` directly or by setting ``advance`` which will add to the current ``completed`` value. + +The :meth:`~rich.progress.Progress.update` method collects keyword arguments which are also associated with the task. Use this to supply any additional information you would like to render in the progress display. The additional arguments are stored in ``task.fields`` and may be referenced in :ref:`Column classes`. + +Hiding tasks +~~~~~~~~~~~~ + +You can show or hide tasks by updating the tasks ``visible`` value. Tasks are visible by default, but you can also add a invisible task by calling :meth:`~rich.progress.Progress.add_task` with ``visible=False``. + + +Transient progress +~~~~~~~~~~~~~~~~~~ + +Normally when you exit the progress context manager (or call :meth:`~rich.progress.Progress.stop`) the last refreshed display remains in the terminal with the cursor on the following line. You can also make the progress display disappear on exit by setting ``transient=True`` on the Progress constructor. Here's an example:: + + with Progress(transient=True) as progress: + task = progress.add_task("Working", total=100) + do_work(task) + +Transient progress displays are useful if you want more minimal output in the terminal when tasks are complete. + +Indeterminate progress +~~~~~~~~~~~~~~~~~~~~~~ + +When you add a task it is automatically *started*, which means it will show a progress bar at 0% and the time remaining will be calculated from the current time. This may not work well if there is a long delay before you can start updating progress; you may need to wait for a response from a server or count files in a directory (for example). In these cases you can call :meth:`~rich.progress.Progress.add_task` with ``start=False`` which will display a pulsing animation that lets the user know something is working. This is know as an *indeterminate* progress bar. When you have the number of steps you can call :meth:`~rich.progress.Progress.start_task` which will display the progress bar at 0%, then :meth:`~rich.progress.Progress.update` as normal. + + +Auto refresh +~~~~~~~~~~~~ + +By default, the progress information will refresh 10 times a second. You can set the refresh rate with the ``refresh_per_second`` argument on the :class:`~rich.progress.Progress` constructor. You should set this to something lower than 10 if you know your updates will not be that frequent. + +You might want to disable auto-refresh entirely if your updates are not very frequent, which you can do by setting ``auto_refresh=False`` on the constructor. If you disable auto-refresh you will need to call :meth:`~rich.progress.Progress.refresh` manually after updating your task(s). + +Columns +~~~~~~~ + +You may customize the columns in the progress display with the positional arguments to the :class:`~rich.progress.Progress` constructor. The columns are specified as either a format string or a :class:`~rich.progress.ProgressColumn` object. + +Format strings will be rendered with a single value `"task"` which will be a :class:`~rich.progress.Task` instance. For example ``"{task.description}"`` would display the task description in the column, and ``"{task.completed} of {task.total}"`` would display how many of the total steps have been completed. + +The defaults are roughly equivalent to the following:: + + progress = Progress( + "[progress.description]{task.description}", + BarColumn(), + "[progress.percentage]{task.percentage:>3.0f}%", + TimeRemainingColumn(), + ) + +The following column objects are available: + +- :class:`~rich.progress.BarColumn` Displays the bar. +- :class:`~rich.progress.TextColumn` Displays text. +- :class:`~rich.progress.TimeElapsedColumn` Displays the time elapsed. +- :class:`~rich.progress.TimeRemainingColumn` Displays the estimated time remaining. +- :class:`~rich.progress.FileSizeColumn` Displays progress as file size (assumes the steps are bytes). +- :class:`~rich.progress.TotalFileSizeColumn` Displays total file size (assumes the steps are bytes). +- :class:`~rich.progress.DownloadColumn` Displays download progress (assumes the steps are bytes). +- :class:`~rich.progress.TransferSpeedColumn` Displays transfer speed (assumes the steps are bytes. +- :class:`~rich.progress.SpinnerColumn` Displays a "spinner" animation. +- :class:`~rich.progress.RenderableColumn` Displays an arbitrary Rich renderable in the column. + +To implement your own columns, extend the :class:`~rich.progress.Progress` and use it as you would the other columns. + + +Print / log +~~~~~~~~~~~ + +The Progress class will create an internal Console object which you can access via ``progress.console``. If you print or log to this console, the output will be displayed *above* the progress display. Here's an example:: + + with Progress() as progress: + task = progress.add_task("twiddling thumbs", total=10) + for job in range(10): + progress.console.print(f"Working on job #{job}") + run_job(job) + progress.advance(task) + +If you have another Console object you want to use, pass it in to the :class:`~rich.progress.Progress` constructor. Here's an example:: + + from my_project import my_console + + with Progress(console=my_console) as progress: + my_console.print("[bold blue]Starting work!") + do_work(progress) + + +Redirecting stdout / stderr +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +To avoid breaking the progress display visuals, Rich will redirect ``stdout`` and ``stderr`` so that you can use the builtin ``print`` statement. This feature is enabled by default, but you can disable by setting ``redirect_stdout`` or ``redirect_stderr`` to ``False`` + + +Customizing +~~~~~~~~~~~ + +If the :class:`~rich.progress.Progress` class doesn't offer exactly what you need in terms of a progress display, you can override the :class:`~rich.progress.Progress.get_renderables` method. For example, the following class will render a :class:`~rich.panel.Panel` around the progress display:: + + from rich.panel import Panel + from rich.progress import Progress + + class MyProgress(Progress): + def get_renderables(self): + yield Panel(self.make_tasks_table(self.tasks)) + +Example +------- + +See `downloader.py `_ for a realistic application of a progress display. This script can download multiple concurrent files with a progress bar, transfer speed and file size. diff --git a/testbed/Textualize__rich/docs/source/protocol.rst b/testbed/Textualize__rich/docs/source/protocol.rst new file mode 100644 index 0000000000000000000000000000000000000000..e37450e7f6a8cfaac1379863b1d374ec13962e9a --- /dev/null +++ b/testbed/Textualize__rich/docs/source/protocol.rst @@ -0,0 +1,73 @@ + +.. _protocol: + +Console Protocol +================ + +Rich supports a simple protocol to add rich formatting capabilities to custom objects, so you can :meth:`~rich.console.Console.print` your object with color, styles and formatting. + +Use this for presentation or to display additional debugging information that might be hard to parse from a typical ``__repr__`` string. + + +Console Customization +--------------------- + +The easiest way to customize console output for your object is to implement a ``__rich__`` method. This method accepts no arguments, and should return an object that Rich knows how to render, such as a :class:`~rich.text.Text` or :class:`~rich.table.Table`. If you return a plain string it will be rendered as :ref:`console_markup`. Here's an example:: + + class MyObject: + def __rich__(self) -> str: + return "[bold cyan]MyObject()" + +If you were to print or log an instance of ``MyObject`` it would render as ``MyObject()`` in bold cyan. Naturally, you would want to put this to better use, perhaps by adding specialized syntax highlighting. + + +Console Render +-------------- + +The ``__rich__`` method is limited to a single renderable object. For more advanced rendering, add a ``__rich_console__`` method to your class. + +The ``__rich_console__`` method should accept a :class:`~rich.console.Console` and a :class:`~rich.console.ConsoleOptions` instance. It should return an iterable of other renderable objects. Although that means it *could* return a container such as a list, it generally easier implemented by using the ``yield`` statement (making the method a generator). + +Here's an example of a ``__rich_console__`` method:: + + from dataclasses import dataclass + from rich.console import Console, ConsoleOptions, RenderResult + from rich.table import Table + + @dataclass + class Student: + id: int + name: str + age: int + def __rich_console__(self, console: Console, options: ConsoleOptions) -> RenderResult: + yield f"[b]Student:[/b] #{self.id}" + my_table = Table("Attribute", "Value") + my_table.add_row("name", self.name) + my_table.add_row("age", str(self.age)) + yield my_table + +If you were to print a ``Student`` instance, it would render a simple table to the terminal. + + +Low Level Render +~~~~~~~~~~~~~~~~ + +For complete control over how a custom object is rendered to the terminal, you can yield :class:`~rich.segment.Segment` objects. A Segment consists of a piece of text and an optional Style. The following example writes multi-colored text when rendering a ``MyObject`` instance:: + + class MyObject: + def __rich_console__(self, console: Console, options: ConsoleOptions) -> RenderResult: + yield Segment("My", Style(color="magenta")) + yield Segment("Object", Style(color="green")) + yield Segment("()", Style(color="cyan")) + + +Measuring Renderables +~~~~~~~~~~~~~~~~~~~~~ + +Sometimes Rich needs to know how many characters an object will take up when rendering. The :class:`~rich.table.Table` class, for instance, will use this information to calculate the optimal dimensions for the columns. If you aren't using one of the renderable objects in the Rich module, you will need to supply a ``__rich_measure__`` method which accepts a :class:`~rich.console.Console` and the maximum width and returns a :class:`~rich.measure.Measurement` object. The Measurement object should contain the *minimum* and *maximum* number of characters required to render. + +For example, if we are rendering a chess board, it would require a minimum of 8 characters to render. The maximum can be left as the maximum available width (assuming a centered board):: + + class ChessBoard: + def __rich_measure__(self, console: Console, max_width: int) -> Measurement: + return Measurement(8, max_width) diff --git a/testbed/Textualize__rich/docs/source/reference.rst b/testbed/Textualize__rich/docs/source/reference.rst new file mode 100644 index 0000000000000000000000000000000000000000..d16047a6d3ed59d18f3e511d9e7937b3524e7940 --- /dev/null +++ b/testbed/Textualize__rich/docs/source/reference.rst @@ -0,0 +1,39 @@ +Reference +========= + +.. toctree:: + :maxdepth: 3 + + reference/align.rst + reference/bar.rst + reference/color.rst + reference/columns.rst + reference/console.rst + reference/emoji.rst + reference/highlighter.rst + reference/init.rst + reference/live.rst + reference/logging.rst + reference/markdown.rst + reference/markup.rst + reference/measure.rst + reference/padding.rst + reference/panel.rst + reference/pretty.rst + reference/progress_bar.rst + reference/progress.rst + reference/prompt.rst + reference/protocol.rst + reference/rule.rst + reference/segment.rst + reference/spinner.rst + reference/status.rst + reference/style.rst + reference/styled.rst + reference/syntax.rst + reference/table.rst + reference/text.rst + reference/theme.rst + reference/traceback.rst + reference/tree.rst + reference/abc.rst diff --git a/testbed/Textualize__rich/docs/source/reference/abc.rst b/testbed/Textualize__rich/docs/source/reference/abc.rst new file mode 100644 index 0000000000000000000000000000000000000000..c4e37587b319d1553b666e1142a9e355ba16ea81 --- /dev/null +++ b/testbed/Textualize__rich/docs/source/reference/abc.rst @@ -0,0 +1,7 @@ +rich.abc +======== + +.. automodule:: rich.abc + :members: + + diff --git a/testbed/Textualize__rich/docs/source/reference/align.rst b/testbed/Textualize__rich/docs/source/reference/align.rst new file mode 100644 index 0000000000000000000000000000000000000000..54b052551369519329717a6fbae28c2d613d6a9e --- /dev/null +++ b/testbed/Textualize__rich/docs/source/reference/align.rst @@ -0,0 +1,7 @@ +rich.align +========== + +.. automodule:: rich.align + :members: + + diff --git a/testbed/Textualize__rich/docs/source/reference/bar.rst b/testbed/Textualize__rich/docs/source/reference/bar.rst new file mode 100644 index 0000000000000000000000000000000000000000..6a247d793cff5e082e4bef8ec17e2486f9c777f8 --- /dev/null +++ b/testbed/Textualize__rich/docs/source/reference/bar.rst @@ -0,0 +1,7 @@ +rich.bar +======== + +.. automodule:: rich.bar + :members: + + diff --git a/testbed/Textualize__rich/docs/source/reference/color.rst b/testbed/Textualize__rich/docs/source/reference/color.rst new file mode 100644 index 0000000000000000000000000000000000000000..87b0e18ea86200f895b9654a03b3e29722ce8f1e --- /dev/null +++ b/testbed/Textualize__rich/docs/source/reference/color.rst @@ -0,0 +1,7 @@ +rich.color +========== + +.. automodule:: rich.color + :members: + + diff --git a/testbed/Textualize__rich/docs/source/reference/columns.rst b/testbed/Textualize__rich/docs/source/reference/columns.rst new file mode 100644 index 0000000000000000000000000000000000000000..14bcd02481f899753747e03855abf1e33ec1fa09 --- /dev/null +++ b/testbed/Textualize__rich/docs/source/reference/columns.rst @@ -0,0 +1,7 @@ +rich.columns +============ + +.. automodule:: rich.columns + :members: + + diff --git a/testbed/Textualize__rich/docs/source/reference/console.rst b/testbed/Textualize__rich/docs/source/reference/console.rst new file mode 100644 index 0000000000000000000000000000000000000000..26ec6fffecb21e2c81b7cea3064480aa9d694b0d --- /dev/null +++ b/testbed/Textualize__rich/docs/source/reference/console.rst @@ -0,0 +1,5 @@ +rich.console +============ + +.. automodule:: rich.console + :members: diff --git a/testbed/Textualize__rich/docs/source/reference/emoji.rst b/testbed/Textualize__rich/docs/source/reference/emoji.rst new file mode 100644 index 0000000000000000000000000000000000000000..59ca4da6e95d00bb649986fa13cbb877a54506f7 --- /dev/null +++ b/testbed/Textualize__rich/docs/source/reference/emoji.rst @@ -0,0 +1,6 @@ +rich.emoji +========== + +.. automodule:: rich.emoji + :members: Emoji + diff --git a/testbed/Textualize__rich/docs/source/reference/highlighter.rst b/testbed/Textualize__rich/docs/source/reference/highlighter.rst new file mode 100644 index 0000000000000000000000000000000000000000..7f5a11ffe698cbe2d94d1e7b3fa790cc11701479 --- /dev/null +++ b/testbed/Textualize__rich/docs/source/reference/highlighter.rst @@ -0,0 +1,7 @@ +rich.highlighter +================ + +.. automodule:: rich.highlighter + :members: + :special-members: __call__ + diff --git a/testbed/Textualize__rich/docs/source/reference/init.rst b/testbed/Textualize__rich/docs/source/reference/init.rst new file mode 100644 index 0000000000000000000000000000000000000000..3ac3fda23ea092fc5819ec9a003e2203a5ee108e --- /dev/null +++ b/testbed/Textualize__rich/docs/source/reference/init.rst @@ -0,0 +1,7 @@ +rich +==== + +.. automodule:: rich + :members: + + diff --git a/testbed/Textualize__rich/docs/source/reference/live.rst b/testbed/Textualize__rich/docs/source/reference/live.rst new file mode 100644 index 0000000000000000000000000000000000000000..516ed8f24e6364dbe612f5956eb07d14f40a6e35 --- /dev/null +++ b/testbed/Textualize__rich/docs/source/reference/live.rst @@ -0,0 +1,5 @@ +rich.live +========= + +.. automodule:: rich.live + :members: \ No newline at end of file diff --git a/testbed/Textualize__rich/docs/source/reference/logging.rst b/testbed/Textualize__rich/docs/source/reference/logging.rst new file mode 100644 index 0000000000000000000000000000000000000000..a7caafcde4929edc4531b7ed3bc680d37488147e --- /dev/null +++ b/testbed/Textualize__rich/docs/source/reference/logging.rst @@ -0,0 +1,8 @@ +.. _logging: + +rich.logging +============ + +.. automodule:: rich.logging + :members: RichHandler + diff --git a/testbed/Textualize__rich/docs/source/reference/markdown.rst b/testbed/Textualize__rich/docs/source/reference/markdown.rst new file mode 100644 index 0000000000000000000000000000000000000000..b98f558cd6993c9aac92d934a04f43cf7cdb6218 --- /dev/null +++ b/testbed/Textualize__rich/docs/source/reference/markdown.rst @@ -0,0 +1,7 @@ +rich.markdown +============= + +.. automodule:: rich.markdown + :members: + + diff --git a/testbed/Textualize__rich/docs/source/reference/markup.rst b/testbed/Textualize__rich/docs/source/reference/markup.rst new file mode 100644 index 0000000000000000000000000000000000000000..ff786f2b0ca198022987761e844cf6c380149122 --- /dev/null +++ b/testbed/Textualize__rich/docs/source/reference/markup.rst @@ -0,0 +1,5 @@ +rich.markup +=========== + +.. automodule:: rich.markup + :members: diff --git a/testbed/Textualize__rich/docs/source/reference/measure.rst b/testbed/Textualize__rich/docs/source/reference/measure.rst new file mode 100644 index 0000000000000000000000000000000000000000..c048eb17a972ed9c36b94476b2d6b3b7b6b7ba2f --- /dev/null +++ b/testbed/Textualize__rich/docs/source/reference/measure.rst @@ -0,0 +1,5 @@ +rich.measure +============ + +.. automodule:: rich.measure + :members: diff --git a/testbed/Textualize__rich/docs/source/reference/padding.rst b/testbed/Textualize__rich/docs/source/reference/padding.rst new file mode 100644 index 0000000000000000000000000000000000000000..e047ca9e38d3341cefb9fa2bb4f82caa4973065b --- /dev/null +++ b/testbed/Textualize__rich/docs/source/reference/padding.rst @@ -0,0 +1,5 @@ +rich.padding +============ + +.. automodule:: rich.padding + :members: diff --git a/testbed/Textualize__rich/docs/source/reference/panel.rst b/testbed/Textualize__rich/docs/source/reference/panel.rst new file mode 100644 index 0000000000000000000000000000000000000000..998f2903f1493ba42cd42a3a194fe1f6e0b0faff --- /dev/null +++ b/testbed/Textualize__rich/docs/source/reference/panel.rst @@ -0,0 +1,6 @@ +rich.panel +========== + +.. automodule:: rich.panel + :members: Panel + diff --git a/testbed/Textualize__rich/docs/source/reference/pretty.rst b/testbed/Textualize__rich/docs/source/reference/pretty.rst new file mode 100644 index 0000000000000000000000000000000000000000..4290dbd73bc30d9476afa60a0b1dc704c97a0ced --- /dev/null +++ b/testbed/Textualize__rich/docs/source/reference/pretty.rst @@ -0,0 +1,6 @@ +rich.pretty +=========== + +.. automodule:: rich.pretty + :members: + diff --git a/testbed/Textualize__rich/docs/source/reference/progress.rst b/testbed/Textualize__rich/docs/source/reference/progress.rst new file mode 100644 index 0000000000000000000000000000000000000000..69551b25d68259585d312094e46cfc25b9126559 --- /dev/null +++ b/testbed/Textualize__rich/docs/source/reference/progress.rst @@ -0,0 +1,5 @@ +rich.progress +============= + +.. automodule:: rich.progress + :members: diff --git a/testbed/Textualize__rich/docs/source/reference/progress_bar.rst b/testbed/Textualize__rich/docs/source/reference/progress_bar.rst new file mode 100644 index 0000000000000000000000000000000000000000..6e5a201f4a3406bba430965910bd836da6b3a26b --- /dev/null +++ b/testbed/Textualize__rich/docs/source/reference/progress_bar.rst @@ -0,0 +1,7 @@ +rich.progress_bar +================= + +.. automodule:: rich.progress_bar + :members: + + diff --git a/testbed/Textualize__rich/docs/source/reference/prompt.rst b/testbed/Textualize__rich/docs/source/reference/prompt.rst new file mode 100644 index 0000000000000000000000000000000000000000..d5adef4eec17ee652a5df20a4e5640ba276f5673 --- /dev/null +++ b/testbed/Textualize__rich/docs/source/reference/prompt.rst @@ -0,0 +1,5 @@ +rich.prompt +=========== + +.. automodule:: rich.prompt + :members: diff --git a/testbed/Textualize__rich/docs/source/reference/protocol.rst b/testbed/Textualize__rich/docs/source/reference/protocol.rst new file mode 100644 index 0000000000000000000000000000000000000000..4febcee86ba3a659a6a4871795949ad48203183b --- /dev/null +++ b/testbed/Textualize__rich/docs/source/reference/protocol.rst @@ -0,0 +1,5 @@ +rich.protocol +============= + +.. automodule:: rich.protocol + :members: diff --git a/testbed/Textualize__rich/docs/source/reference/rule.rst b/testbed/Textualize__rich/docs/source/reference/rule.rst new file mode 100644 index 0000000000000000000000000000000000000000..f06eb3a19d32e3521e1dc003b2dc34ea37fa6ad0 --- /dev/null +++ b/testbed/Textualize__rich/docs/source/reference/rule.rst @@ -0,0 +1,5 @@ +rich.rule +========= + +.. automodule:: rich.rule + :members: diff --git a/testbed/Textualize__rich/docs/source/reference/segment.rst b/testbed/Textualize__rich/docs/source/reference/segment.rst new file mode 100644 index 0000000000000000000000000000000000000000..fce383cca44809dfe459945164e1e9543a65263b --- /dev/null +++ b/testbed/Textualize__rich/docs/source/reference/segment.rst @@ -0,0 +1,5 @@ +rich.segment +============ + +.. automodule:: rich.segment + :members: diff --git a/testbed/Textualize__rich/docs/source/reference/spinner.rst b/testbed/Textualize__rich/docs/source/reference/spinner.rst new file mode 100644 index 0000000000000000000000000000000000000000..53315dc7372278a8634378c1593713c853803ff0 --- /dev/null +++ b/testbed/Textualize__rich/docs/source/reference/spinner.rst @@ -0,0 +1,5 @@ +rich.spinner +============ + +.. automodule:: rich.spinner + :members: diff --git a/testbed/Textualize__rich/docs/source/reference/style.rst b/testbed/Textualize__rich/docs/source/reference/style.rst new file mode 100644 index 0000000000000000000000000000000000000000..3d431ac5e9e3bc3bd0ebcaf750f8997990444c3f --- /dev/null +++ b/testbed/Textualize__rich/docs/source/reference/style.rst @@ -0,0 +1,7 @@ +rich.style +========== + +.. automodule:: rich.style + :members: + :special-members: __call__ + diff --git a/testbed/Textualize__rich/docs/source/reference/styled.rst b/testbed/Textualize__rich/docs/source/reference/styled.rst new file mode 100644 index 0000000000000000000000000000000000000000..67207262ca7684fc9cfcca436faff4f40d5eb9f4 --- /dev/null +++ b/testbed/Textualize__rich/docs/source/reference/styled.rst @@ -0,0 +1,7 @@ +rich.styled +=========== + +.. automodule:: rich.styled + :members: + + diff --git a/testbed/Textualize__rich/docs/source/reference/syntax.rst b/testbed/Textualize__rich/docs/source/reference/syntax.rst new file mode 100644 index 0000000000000000000000000000000000000000..c8e491806fc392a1b137361280cec9f5bcb7066c --- /dev/null +++ b/testbed/Textualize__rich/docs/source/reference/syntax.rst @@ -0,0 +1,5 @@ +rich.syntax +=========== + +.. automodule:: rich.syntax + :members: Syntax diff --git a/testbed/Textualize__rich/docs/source/reference/table.rst b/testbed/Textualize__rich/docs/source/reference/table.rst new file mode 100644 index 0000000000000000000000000000000000000000..40562b07fc2f2ad7a364d27b3aaed650c1b250cc --- /dev/null +++ b/testbed/Textualize__rich/docs/source/reference/table.rst @@ -0,0 +1,5 @@ +rich.table +========== + +.. automodule:: rich.table + :members: diff --git a/testbed/Textualize__rich/docs/source/reference/text.rst b/testbed/Textualize__rich/docs/source/reference/text.rst new file mode 100644 index 0000000000000000000000000000000000000000..76b41f4bb7808195caa44095e46ec57bbadf1ad0 --- /dev/null +++ b/testbed/Textualize__rich/docs/source/reference/text.rst @@ -0,0 +1,6 @@ +rich.text +========= + +.. automodule:: rich.text + :members: Text + diff --git a/testbed/Textualize__rich/docs/source/reference/theme.rst b/testbed/Textualize__rich/docs/source/reference/theme.rst new file mode 100644 index 0000000000000000000000000000000000000000..14fb919ff5120db8314ec12c3354b269913f9512 --- /dev/null +++ b/testbed/Textualize__rich/docs/source/reference/theme.rst @@ -0,0 +1,6 @@ +rich.theme +========== + +.. automodule:: rich.theme + :members: Theme + diff --git a/testbed/Textualize__rich/docs/source/reference/traceback.rst b/testbed/Textualize__rich/docs/source/reference/traceback.rst new file mode 100644 index 0000000000000000000000000000000000000000..cdd09fba7f7c1698f210f3cd9e2bd21385c5e1bd --- /dev/null +++ b/testbed/Textualize__rich/docs/source/reference/traceback.rst @@ -0,0 +1,6 @@ +rich.traceback +============== + +.. automodule:: rich.traceback + :members: Traceback, install + diff --git a/testbed/Textualize__rich/docs/source/style.rst b/testbed/Textualize__rich/docs/source/style.rst new file mode 100644 index 0000000000000000000000000000000000000000..db8f4cf15676b4959874c07590165d148c296c4b --- /dev/null +++ b/testbed/Textualize__rich/docs/source/style.rst @@ -0,0 +1,159 @@ +.. _styles: + + +Styles +====== + +In various places in the Rich API you can set a "style" which defines the color of the text and various attributes such as bold, italic etc. A style may be given as a string containing a *style definition* or as in instance of a :class:`~rich.style.Style` class. + + +Defining Styles +--------------- + +A style definition is a string containing one or more words to set colors and attributes. + +To specify a foreground color use one of the 256 :ref:`appendix-colors`. For example, to print "Hello" in magenta:: + + console.print("Hello", style="magenta") + +You may also use the color's number (an integer between 0 and 255) with the syntax ``"color()"``. The following will give the equivalent output:: + + console.print("Hello", style="color(5)") + +Alteratively you can use a CSS-like syntax to specify a color with a "#" followed by three pairs of hex characters, or in RGB form with three decimal integers. The following two lines both print "Hello" in the same color (purple):: + + console.print("Hello", style="#af00ff") + console.print("Hello", style="rgb(175,0,255)") + +The hex and rgb forms allow you to select from the full *truecolor* set of 16.7 million colors. + +.. note:: + Some terminals only support 256 colors. Rich will attempt to pick the closest color it can if your color isn't available. + +By itself, a color will change the *foreground* color. To specify a *background* color, precede the color with the word "on". For example, the following prints text in red on a white background:: + + console.print("DANGER!", style="red on white") + +You can also set a color with the word ``"default"`` which will reset the color to a default managed by your terminal software. This works for backgrounds as well, so the style of ``"default on default"`` is what your terminal starts with. + +You can set a style attribute by adding one or more of the following words: + +* ``"bold"`` or ``"b"`` for bold text. +* ``"blink"`` for text that flashes (use this one sparingly). +* ``"blink2"`` for text that flashes rapidly (not supported by most terminals). +* ``"conceal"`` for *concealed* text (not supported by most terminals). +* ``"italic"`` or ``"i"`` for italic text (not supported on Windows). +* ``"reverse"`` or ``"r"`` for text with foreground and background colors reversed. +* ``"strike"`` or ``"s"`` for text with a line through it. +* ``"underline"`` or ``"u"`` for underlined text. + +Rich also supports the following styles, which are not well supported and may not display in your terminal: + +* ``"underline2"`` or ``"uu"`` for doubly underlined text. +* ``"frame"`` for framed text. +* ``"encircle"`` for encircled text. +* ``"overline"`` or ``"o"`` for overlined text. + +Style attributes and colors may be used in combination with each other. For example:: + + console.print("Danger, Will Robinson!", style="blink bold red underline on white") + +Styles may be negated by prefixing the attribute with the word "not". This can be used to turn off styles if they overlap. For example:: + + console.print("foo [not bold]bar[/not bold] baz", style="bold") + +This will print "foo" and "baz" in bold, but "bar" will be in normal text. + +Styles may also have a ``"link"`` attribute, which will turn any styled text in to a *hyperlink* (if supported by your terminal software). + +To add a link to a style, the definition should contain the word ``"link"`` followed by a URL. The following example will make a clickable link:: + + console.print("Google", style="link https://google.com") + +.. note:: + If you are familiar with HTML you may find applying links in this way a little odd, but the terminal considers a link to be another attribute just like bold, italic etc. + + + +Style Class +----------- + +Ultimately the style definition is parsed and an instance of a :class:`~rich.style.Style` class is created. If you prefer, you can use the Style class in place of the style definition. Here's an example:: + + from rich.style import Style + danger_style = Style(color="red", blink=True, bold=True) + console.print("Danger, Will Robinson!", style=danger_style) + +It is slightly quicker to construct a Style class like this, since a style definition takes a little time to parse -- but only on the first call, as Rich will cache parsed style definitions. + +Styles may be combined by adding them together, which is useful if you want to modify attributes of an existing style. Here's an example:: + + from rich.console import Console + from rich.style import Style + console = Console() + + base_style = Style.parse("cyan") + console.print("Hello, World", style = base_style + Style(underline=True)) + +You can parse a style definition explicitly with the :meth:`~rich.style.Style.parse` method, which accepts the style definition and returns a Style instance. For example, the following two lines are equivalent:: + + style = Style(color="magenta", bgcolor="yellow", italic=True) + style = Style.parse("italic magenta on yellow") + +.. _themes: + + +Style Themes +------------ + +If you re-use styles it can be a maintenance headache if you ever want to modify an attribute or color -- you would have to change every line where the style is used. Rich provides a :class:`~rich.theme.Theme` class which you can use to define custom styles that you can refer to by name. That way you only need update your styles in one place. + +Style themes can make your code more semantic, for instance a style called ``"warning"`` better expresses intent that ``"italic magenta underline"``. + +To use a style theme, construct a :class:`~rich.theme.Theme` instance and pass it to the :class:`~rich.console.Console` constructor. Here's an example:: + + from rich.console import Console + from rich.theme import Theme + custom_theme = Theme({ + "info" : "dim cyan", + "warning": "magenta", + "danger": "bold red" + }) + console = Console(theme=custom_theme) + console.print("This is information", style="info") + console.print("[warning]The pod bay doors are locked[/warning]") + console.print("Something terrible happened!", style="danger") + + +.. note:: + style names must be lower case, start with a letter, and only contain letters or the characters ``"."``, ``"-"``, ``"_"``. + + +Customizing Defaults +~~~~~~~~~~~~~~~~~~~~ + +The Theme class will inherit the default styles builtin to Rich. If your custom theme contains the name of an existing style, it will replace it. This allows you to customize the defaults as easily as you can create your own styles. For instance, here's how you can change how Rich highlights numbers:: + + from rich.console import Console + from rich.theme import Theme + console = Console(theme=Theme({"repr.number": "bold green blink"})) + console.print("The total is 128") + +You can disable inheriting the default theme by setting ``inherit=False`` on the :class:`rich.theme.Theme` constructor. + +To see the default theme, run the following command:: + + python -m rich.theme + + +Loading Themes +~~~~~~~~~~~~~~ + +If you prefer, you can write your styles in an external config file rather than in Python. Here's an example of the format:: + + [styles] + info = dim cyan + warning = magenta + danger = bold red + +You can read these files with the :meth:`~rich.theme.Theme.read` method. diff --git a/testbed/Textualize__rich/examples/README.md b/testbed/Textualize__rich/examples/README.md new file mode 100644 index 0000000000000000000000000000000000000000..c7024becb1c51be51629c973c97c894b51e20078 --- /dev/null +++ b/testbed/Textualize__rich/examples/README.md @@ -0,0 +1,5 @@ +# Examples + +This directory contains various demonstrations various Rich features. To run them, make sure Rich is installed, then enter `python example.py` on the command line. + +Be sure to check the source! diff --git a/testbed/Textualize__rich/examples/downloader.py b/testbed/Textualize__rich/examples/downloader.py new file mode 100644 index 0000000000000000000000000000000000000000..5120ed598400e948131eba3a5d152680d1f2f2e1 --- /dev/null +++ b/testbed/Textualize__rich/examples/downloader.py @@ -0,0 +1,64 @@ +""" +A rudimentary URL downloader (like wget or curl) to demonstrate Rich progress bars. +""" + +from concurrent.futures import ThreadPoolExecutor +from functools import partial +import os.path +import sys +from typing import Iterable +from urllib.request import urlopen + +from rich.progress import ( + BarColumn, + DownloadColumn, + TextColumn, + TransferSpeedColumn, + TimeRemainingColumn, + Progress, + TaskID, +) + + +progress = Progress( + TextColumn("[bold blue]{task.fields[filename]}", justify="right"), + BarColumn(bar_width=None), + "[progress.percentage]{task.percentage:>3.1f}%", + "•", + DownloadColumn(), + "•", + TransferSpeedColumn(), + "•", + TimeRemainingColumn(), +) + + +def copy_url(task_id: TaskID, url: str, path: str) -> None: + """Copy data from a url to a local file.""" + response = urlopen(url) + # This will break if the response doesn't contain content length + progress.update(task_id, total=int(response.info()["Content-length"])) + with open(path, "wb") as dest_file: + progress.start_task(task_id) + for data in iter(partial(response.read, 32768), b""): + dest_file.write(data) + progress.update(task_id, advance=len(data)) + + +def download(urls: Iterable[str], dest_dir: str): + """Download multuple files to the given directory.""" + with progress: + with ThreadPoolExecutor(max_workers=4) as pool: + for url in urls: + filename = url.split("/")[-1] + dest_path = os.path.join(dest_dir, filename) + task_id = progress.add_task("download", filename=filename, start=False) + pool.submit(copy_url, task_id, url, dest_path) + + +if __name__ == "__main__": + # Try with https://releases.ubuntu.com/20.04/ubuntu-20.04.1-desktop-amd64.iso + if sys.argv[1:]: + download(sys.argv[1:], "./") + else: + print("Usage:\n\tpython downloader.py URL1 URL2 URL3 (etc)") diff --git a/testbed/Textualize__rich/examples/group2.py b/testbed/Textualize__rich/examples/group2.py new file mode 100644 index 0000000000000000000000000000000000000000..13be0704fcee3e1510570f636ba45ebe09a7565b --- /dev/null +++ b/testbed/Textualize__rich/examples/group2.py @@ -0,0 +1,12 @@ +from rich import print +from rich.console import render_group +from rich.panel import Panel + + +@render_group() +def get_panels(): + yield Panel("Hello", style="on blue") + yield Panel("World", style="on red") + + +print(Panel(get_panels())) diff --git a/testbed/Textualize__rich/examples/justify.py b/testbed/Textualize__rich/examples/justify.py new file mode 100644 index 0000000000000000000000000000000000000000..670988206de985adfc46daef2e924b48073161cd --- /dev/null +++ b/testbed/Textualize__rich/examples/justify.py @@ -0,0 +1,13 @@ +""" +This example demonstrates the justify argument to print. +""" + +from rich.console import Console + +console = Console(width=20) + +style = "bold white on blue" +console.print("Rich", style=style) +console.print("Rich", style=style, justify="left") +console.print("Rich", style=style, justify="center") +console.print("Rich", style=style, justify="right") diff --git a/testbed/Textualize__rich/examples/status.py b/testbed/Textualize__rich/examples/status.py new file mode 100644 index 0000000000000000000000000000000000000000..88d1679edbd2a581e23312540e72d2ccffa4a174 --- /dev/null +++ b/testbed/Textualize__rich/examples/status.py @@ -0,0 +1,13 @@ +from time import sleep +from rich.console import Console + +console = Console() +console.print() + +tasks = [f"task {n}" for n in range(1, 11)] + +with console.status("[bold green]Working on tasks...") as status: + while tasks: + task = tasks.pop(0) + sleep(1) + console.log(f"{task} complete") diff --git a/testbed/Textualize__rich/examples/tree.py b/testbed/Textualize__rich/examples/tree.py new file mode 100644 index 0000000000000000000000000000000000000000..8868e5da6b362dffac061b7066baeb0782097701 --- /dev/null +++ b/testbed/Textualize__rich/examples/tree.py @@ -0,0 +1,51 @@ +import os +import pathlib +import sys + +from rich import print +from rich.filesize import decimal +from rich.markup import escape +from rich.text import Text +from rich.tree import Tree + + +def walk_directory(directory: pathlib.Path, tree: Tree) -> None: + """Recursively build a Tree with directory contents.""" + # Sort dirs first then by filename + paths = sorted( + pathlib.Path(directory).iterdir(), + key=lambda path: (path.is_file(), path.name.lower()), + ) + for path in paths: + # Remove hidden files + if path.name.startswith("."): + continue + if path.is_dir(): + style = "dim" if path.name.startswith("__") else "" + branch = tree.add( + f"[bold magenta]:open_file_folder: [link file://{path}]{escape(path.name)}", + style=style, + guide_style=style, + ) + walk_directory(path, branch) + else: + text_filename = Text(path.name, "green") + text_filename.highlight_regex(r"\..*$", "bold red") + text_filename.stylize(f"link file://{path}") + file_size = path.stat().st_size + text_filename.append(f" ({decimal(file_size)})", "blue") + icon = "🐍 " if path.suffix == ".py" else "📄 " + tree.add(Text(icon) + text_filename) + + +try: + directory = os.path.abspath(sys.argv[1]) +except IndexError: + print("[b]Usage:[/] python tree.py ") +else: + tree = Tree( + f":open_file_folder: [link file://{directory}]{directory}", + guide_style="bold bright_blue", + ) + walk_directory(pathlib.Path(directory), tree) + print(tree) diff --git a/testbed/Textualize__rich/make.bat b/testbed/Textualize__rich/make.bat new file mode 100644 index 0000000000000000000000000000000000000000..6247f7e231716482115f34084ac61030743e0715 --- /dev/null +++ b/testbed/Textualize__rich/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=source +set BUILDDIR=build + +if "%1" == "" goto help + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/testbed/Textualize__rich/poetry.lock b/testbed/Textualize__rich/poetry.lock new file mode 100644 index 0000000000000000000000000000000000000000..9660024601210c05522c6bbbf4579b5fb26cd7e9 --- /dev/null +++ b/testbed/Textualize__rich/poetry.lock @@ -0,0 +1,1263 @@ +[[package]] +name = "appdirs" +version = "1.4.4" +description = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." +category = "dev" +optional = false +python-versions = "*" + +[[package]] +name = "appnope" +version = "0.1.0" +description = "Disable App Nap on OS X 10.9" +category = "main" +optional = true +python-versions = "*" + +[[package]] +name = "atomicwrites" +version = "1.4.0" +description = "Atomic file writes." +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" + +[[package]] +name = "attrs" +version = "19.3.0" +description = "Classes Without Boilerplate" +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" + +[package.extras] +azure-pipelines = ["coverage", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface", "pytest-azurepipelines"] +dev = ["coverage", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface", "sphinx", "pre-commit"] +docs = ["sphinx", "zope.interface"] +tests = ["coverage", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface"] + +[[package]] +name = "backcall" +version = "0.2.0" +description = "Specifications for callback functions passed in to an API" +category = "main" +optional = true +python-versions = "*" + +[[package]] +name = "black" +version = "20.8b1" +description = "The uncompromising code formatter." +category = "dev" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +appdirs = "*" +click = ">=7.1.2" +dataclasses = {version = ">=0.6", markers = "python_version < \"3.7\""} +mypy-extensions = ">=0.4.3" +pathspec = ">=0.6,<1" +regex = ">=2020.1.8" +toml = ">=0.10.1" +typed-ast = ">=1.4.0" +typing-extensions = ">=3.7.4" + +[package.extras] +colorama = ["colorama (>=0.4.3)"] +d = ["aiohttp (>=3.3.2)", "aiohttp-cors"] + +[[package]] +name = "bleach" +version = "3.1.5" +description = "An easy safelist-based HTML-sanitizing tool." +category = "main" +optional = true +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" + +[package.dependencies] +packaging = "*" +six = ">=1.9.0" +webencodings = "*" + +[[package]] +name = "click" +version = "7.1.2" +description = "Composable command line interface toolkit" +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" + +[[package]] +name = "colorama" +version = "0.4.4" +description = "Cross-platform colored terminal text." +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" + +[[package]] +name = "commonmark" +version = "0.9.1" +description = "Python parser for the CommonMark Markdown spec" +category = "main" +optional = false +python-versions = "*" + +[package.extras] +test = ["flake8 (==3.7.8)", "hypothesis (==3.55.3)"] + +[[package]] +name = "coverage" +version = "5.3" +description = "Code coverage measurement for Python" +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4" + +[package.extras] +toml = ["toml"] + +[[package]] +name = "dataclasses" +version = "0.8" +description = "A backport of the dataclasses module for Python 3.6" +category = "main" +optional = false +python-versions = ">=3.6, <3.7" + +[[package]] +name = "decorator" +version = "4.4.2" +description = "Decorators for Humans" +category = "main" +optional = true +python-versions = ">=2.6, !=3.0.*, !=3.1.*" + +[[package]] +name = "defusedxml" +version = "0.6.0" +description = "XML bomb protection for Python stdlib modules" +category = "main" +optional = true +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" + +[[package]] +name = "entrypoints" +version = "0.3" +description = "Discover and load entry points from installed packages." +category = "main" +optional = true +python-versions = ">=2.7" + +[[package]] +name = "importlib-metadata" +version = "1.7.0" +description = "Read metadata from Python packages" +category = "main" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" + +[package.dependencies] +zipp = ">=0.5" + +[package.extras] +docs = ["sphinx", "rst.linker"] +testing = ["packaging", "pep517", "importlib-resources (>=1.3)"] + +[[package]] +name = "iniconfig" +version = "1.1.1" +description = "iniconfig: brain-dead simple config-ini parsing" +category = "dev" +optional = false +python-versions = "*" + +[[package]] +name = "ipykernel" +version = "5.3.2" +description = "IPython Kernel for Jupyter" +category = "main" +optional = true +python-versions = ">=3.5" + +[package.dependencies] +appnope = {version = "*", markers = "platform_system == \"Darwin\""} +ipython = ">=5.0.0" +jupyter-client = "*" +tornado = ">=4.2" +traitlets = ">=4.1.0" + +[package.extras] +test = ["pytest (!=5.3.4)", "pytest-cov", "flaky", "nose"] + +[[package]] +name = "ipython" +version = "7.16.1" +description = "IPython: Productive Interactive Computing" +category = "main" +optional = true +python-versions = ">=3.6" + +[package.dependencies] +appnope = {version = "*", markers = "sys_platform == \"darwin\""} +backcall = "*" +colorama = {version = "*", markers = "sys_platform == \"win32\""} +decorator = "*" +jedi = ">=0.10" +pexpect = {version = "*", markers = "sys_platform != \"win32\""} +pickleshare = "*" +prompt-toolkit = ">=2.0.0,<3.0.0 || >3.0.0,<3.0.1 || >3.0.1,<3.1.0" +pygments = "*" +traitlets = ">=4.2" + +[package.extras] +all = ["Sphinx (>=1.3)", "ipykernel", "ipyparallel", "ipywidgets", "nbconvert", "nbformat", "nose (>=0.10.1)", "notebook", "numpy (>=1.14)", "pygments", "qtconsole", "requests", "testpath"] +doc = ["Sphinx (>=1.3)"] +kernel = ["ipykernel"] +nbconvert = ["nbconvert"] +nbformat = ["nbformat"] +notebook = ["notebook", "ipywidgets"] +parallel = ["ipyparallel"] +qtconsole = ["qtconsole"] +test = ["nose (>=0.10.1)", "requests", "testpath", "pygments", "nbformat", "ipykernel", "numpy (>=1.14)"] + +[[package]] +name = "ipython-genutils" +version = "0.2.0" +description = "Vestigial utilities from IPython" +category = "main" +optional = true +python-versions = "*" + +[[package]] +name = "ipywidgets" +version = "7.6.3" +description = "IPython HTML widgets for Jupyter" +category = "main" +optional = true +python-versions = "*" + +[package.dependencies] +ipykernel = ">=4.5.1" +ipython = {version = ">=4.0.0", markers = "python_version >= \"3.3\""} +jupyterlab-widgets = {version = ">=1.0.0", markers = "python_version >= \"3.6\""} +nbformat = ">=4.2.0" +traitlets = ">=4.3.1" +widgetsnbextension = ">=3.5.0,<3.6.0" + +[package.extras] +test = ["pytest (>=3.6.0)", "pytest-cov", "mock"] + +[[package]] +name = "jedi" +version = "0.17.1" +description = "An autocompletion tool for Python that can be used for text editors." +category = "main" +optional = true +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" + +[package.dependencies] +parso = ">=0.7.0,<0.8.0" + +[package.extras] +qa = ["flake8 (==3.7.9)"] +testing = ["Django (<3.1)", "colorama", "docopt", "pytest (>=3.9.0,<5.0.0)"] + +[[package]] +name = "jinja2" +version = "2.11.2" +description = "A very fast and expressive template engine." +category = "main" +optional = true +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" + +[package.dependencies] +MarkupSafe = ">=0.23" + +[package.extras] +i18n = ["Babel (>=0.8)"] + +[[package]] +name = "jsonschema" +version = "3.2.0" +description = "An implementation of JSON Schema validation for Python" +category = "main" +optional = true +python-versions = "*" + +[package.dependencies] +attrs = ">=17.4.0" +importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} +pyrsistent = ">=0.14.0" +six = ">=1.11.0" + +[package.extras] +format = ["idna", "jsonpointer (>1.13)", "rfc3987", "strict-rfc3339", "webcolors"] +format_nongpl = ["idna", "jsonpointer (>1.13)", "webcolors", "rfc3986-validator (>0.1.0)", "rfc3339-validator"] + +[[package]] +name = "jupyter-client" +version = "6.1.5" +description = "Jupyter protocol implementation and client libraries" +category = "main" +optional = true +python-versions = ">=3.5" + +[package.dependencies] +jupyter-core = ">=4.6.0" +python-dateutil = ">=2.1" +pyzmq = ">=13" +tornado = ">=4.1" +traitlets = "*" + +[package.extras] +test = ["ipykernel", "ipython", "mock", "pytest"] + +[[package]] +name = "jupyter-core" +version = "4.6.3" +description = "Jupyter core package. A base package on which Jupyter projects rely." +category = "main" +optional = true +python-versions = "!=3.0,!=3.1,!=3.2,!=3.3,!=3.4,>=2.7" + +[package.dependencies] +pywin32 = {version = ">=1.0", markers = "sys_platform == \"win32\""} +traitlets = "*" + +[[package]] +name = "jupyterlab-widgets" +version = "1.0.0" +description = "A JupyterLab extension." +category = "main" +optional = true +python-versions = ">=3.6" + +[[package]] +name = "markupsafe" +version = "1.1.1" +description = "Safely add untrusted strings to HTML/XML markup." +category = "main" +optional = true +python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*" + +[[package]] +name = "mistune" +version = "0.8.4" +description = "The fastest markdown parser in pure Python" +category = "main" +optional = true +python-versions = "*" + +[[package]] +name = "mypy" +version = "0.790" +description = "Optional static typing for Python" +category = "dev" +optional = false +python-versions = ">=3.5" + +[package.dependencies] +mypy-extensions = ">=0.4.3,<0.5.0" +typed-ast = ">=1.4.0,<1.5.0" +typing-extensions = ">=3.7.4" + +[package.extras] +dmypy = ["psutil (>=4.0)"] + +[[package]] +name = "mypy-extensions" +version = "0.4.3" +description = "Experimental type system extensions for programs checked with the mypy typechecker." +category = "dev" +optional = false +python-versions = "*" + +[[package]] +name = "nbconvert" +version = "5.6.1" +description = "Converting Jupyter Notebooks" +category = "main" +optional = true +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" + +[package.dependencies] +bleach = "*" +defusedxml = "*" +entrypoints = ">=0.2.2" +jinja2 = ">=2.4" +jupyter-core = "*" +mistune = ">=0.8.1,<2" +nbformat = ">=4.4" +pandocfilters = ">=1.4.1" +pygments = "*" +testpath = "*" +traitlets = ">=4.2" + +[package.extras] +all = ["pytest", "pytest-cov", "ipykernel", "jupyter-client (>=5.3.1)", "ipywidgets (>=7)", "pebble", "tornado (>=4.0)", "sphinx (>=1.5.1)", "sphinx-rtd-theme", "nbsphinx (>=0.2.12)", "sphinxcontrib-github-alt", "ipython", "mock"] +docs = ["sphinx (>=1.5.1)", "sphinx-rtd-theme", "nbsphinx (>=0.2.12)", "sphinxcontrib-github-alt", "ipython", "jupyter-client (>=5.3.1)"] +execute = ["jupyter-client (>=5.3.1)"] +serve = ["tornado (>=4.0)"] +test = ["pytest", "pytest-cov", "ipykernel", "jupyter-client (>=5.3.1)", "ipywidgets (>=7)", "pebble", "mock"] + +[[package]] +name = "nbformat" +version = "5.0.7" +description = "The Jupyter Notebook format" +category = "main" +optional = true +python-versions = ">=3.5" + +[package.dependencies] +ipython-genutils = "*" +jsonschema = ">=2.4,<2.5.0 || >2.5.0" +jupyter-core = "*" +traitlets = ">=4.1" + +[package.extras] +test = ["pytest", "pytest-cov", "testpath"] + +[[package]] +name = "notebook" +version = "6.0.3" +description = "A web-based notebook environment for interactive computing" +category = "main" +optional = true +python-versions = ">=3.5" + +[package.dependencies] +ipykernel = "*" +ipython-genutils = "*" +jinja2 = "*" +jupyter-client = ">=5.3.4" +jupyter-core = ">=4.6.1" +nbconvert = "*" +nbformat = "*" +prometheus-client = "*" +pyzmq = ">=17" +Send2Trash = "*" +terminado = ">=0.8.1" +tornado = ">=5.0" +traitlets = ">=4.2.1" + +[package.extras] +test = ["nose", "coverage", "requests", "nose-warnings-filters", "nbval", "nose-exclude", "selenium", "pytest", "pytest-cov", "nose-exclude"] + +[[package]] +name = "packaging" +version = "20.4" +description = "Core utilities for Python packages" +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" + +[package.dependencies] +pyparsing = ">=2.0.2" +six = "*" + +[[package]] +name = "pandocfilters" +version = "1.4.2" +description = "Utilities for writing pandoc filters in python" +category = "main" +optional = true +python-versions = "*" + +[[package]] +name = "parso" +version = "0.7.0" +description = "A Python Parser" +category = "main" +optional = true +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" + +[package.extras] +testing = ["docopt", "pytest (>=3.0.7)"] + +[[package]] +name = "pathspec" +version = "0.8.1" +description = "Utility library for gitignore style pattern matching of file paths." +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" + +[[package]] +name = "pexpect" +version = "4.8.0" +description = "Pexpect allows easy control of interactive console applications." +category = "main" +optional = true +python-versions = "*" + +[package.dependencies] +ptyprocess = ">=0.5" + +[[package]] +name = "pickleshare" +version = "0.7.5" +description = "Tiny 'shelve'-like database with concurrency support" +category = "main" +optional = true +python-versions = "*" + +[[package]] +name = "pluggy" +version = "0.13.1" +description = "plugin and hook calling mechanisms for python" +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" + +[package.dependencies] +importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} + +[package.extras] +dev = ["pre-commit", "tox"] + +[[package]] +name = "prometheus-client" +version = "0.8.0" +description = "Python client for the Prometheus monitoring system." +category = "main" +optional = true +python-versions = "*" + +[package.extras] +twisted = ["twisted"] + +[[package]] +name = "prompt-toolkit" +version = "3.0.3" +description = "Library for building powerful interactive command lines in Python" +category = "main" +optional = true +python-versions = ">=3.6" + +[package.dependencies] +wcwidth = "*" + +[[package]] +name = "ptyprocess" +version = "0.6.0" +description = "Run a subprocess in a pseudo terminal" +category = "main" +optional = true +python-versions = "*" + +[[package]] +name = "py" +version = "1.9.0" +description = "library with cross-python path, ini-parsing, io, code, log facilities" +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" + +[[package]] +name = "pygments" +version = "2.7.3" +description = "Pygments is a syntax highlighting package written in Python." +category = "main" +optional = false +python-versions = ">=3.5" + +[[package]] +name = "pyparsing" +version = "2.4.7" +description = "Python parsing module" +category = "main" +optional = false +python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" + +[[package]] +name = "pyrsistent" +version = "0.16.0" +description = "Persistent/Functional/Immutable data structures" +category = "main" +optional = true +python-versions = "*" + +[package.dependencies] +six = "*" + +[[package]] +name = "pytest" +version = "6.2.1" +description = "pytest: simple powerful testing with Python" +category = "dev" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +atomicwrites = {version = ">=1.0", markers = "sys_platform == \"win32\""} +attrs = ">=19.2.0" +colorama = {version = "*", markers = "sys_platform == \"win32\""} +importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} +iniconfig = "*" +packaging = "*" +pluggy = ">=0.12,<1.0.0a1" +py = ">=1.8.2" +toml = "*" + +[package.extras] +testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "requests", "xmlschema"] + +[[package]] +name = "pytest-cov" +version = "2.10.1" +description = "Pytest plugin for measuring coverage." +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" + +[package.dependencies] +coverage = ">=4.4" +pytest = ">=4.6" + +[package.extras] +testing = ["fields", "hunter", "process-tests (==2.0.2)", "six", "pytest-xdist", "virtualenv"] + +[[package]] +name = "python-dateutil" +version = "2.8.1" +description = "Extensions to the standard Python datetime module" +category = "main" +optional = true +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" + +[package.dependencies] +six = ">=1.5" + +[[package]] +name = "pywin32" +version = "228" +description = "Python for Window Extensions" +category = "main" +optional = true +python-versions = "*" + +[[package]] +name = "pywinpty" +version = "0.5.7" +description = "Python bindings for the winpty library" +category = "main" +optional = true +python-versions = "*" + +[[package]] +name = "pyzmq" +version = "19.0.1" +description = "Python bindings for 0MQ" +category = "main" +optional = true +python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*" + +[[package]] +name = "regex" +version = "2020.11.13" +description = "Alternative regular expression module, to replace re." +category = "dev" +optional = false +python-versions = "*" + +[[package]] +name = "send2trash" +version = "1.5.0" +description = "Send file to trash natively under Mac OS X, Windows and Linux." +category = "main" +optional = true +python-versions = "*" + +[[package]] +name = "six" +version = "1.15.0" +description = "Python 2 and 3 compatibility utilities" +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" + +[[package]] +name = "terminado" +version = "0.8.3" +description = "Terminals served to xterm.js using Tornado websockets" +category = "main" +optional = true +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" + +[package.dependencies] +ptyprocess = {version = "*", markers = "os_name != \"nt\""} +pywinpty = {version = ">=0.5", markers = "os_name == \"nt\""} +tornado = ">=4" + +[[package]] +name = "testpath" +version = "0.4.4" +description = "Test utilities for code working with files and commands" +category = "main" +optional = true +python-versions = "*" + +[package.extras] +test = ["pathlib2"] + +[[package]] +name = "toml" +version = "0.10.2" +description = "Python Library for Tom's Obvious, Minimal Language" +category = "dev" +optional = false +python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" + +[[package]] +name = "tornado" +version = "6.0.4" +description = "Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed." +category = "main" +optional = true +python-versions = ">= 3.5" + +[[package]] +name = "traitlets" +version = "4.3.3" +description = "Traitlets Python config system" +category = "main" +optional = true +python-versions = "*" + +[package.dependencies] +decorator = "*" +ipython-genutils = "*" +six = "*" + +[package.extras] +test = ["pytest", "mock"] + +[[package]] +name = "typed-ast" +version = "1.4.1" +description = "a fork of Python 2 and 3 ast modules with type comment support" +category = "dev" +optional = false +python-versions = "*" + +[[package]] +name = "typing-extensions" +version = "3.7.4.3" +description = "Backported and Experimental Type Hints for Python 3.5+" +category = "main" +optional = false +python-versions = "*" + +[[package]] +name = "wcwidth" +version = "0.2.5" +description = "Measures the displayed width of unicode strings in a terminal" +category = "main" +optional = true +python-versions = "*" + +[[package]] +name = "webencodings" +version = "0.5.1" +description = "Character encoding aliases for legacy web content" +category = "main" +optional = true +python-versions = "*" + +[[package]] +name = "widgetsnbextension" +version = "3.5.1" +description = "IPython HTML widgets for Jupyter" +category = "main" +optional = true +python-versions = "*" + +[package.dependencies] +notebook = ">=4.4.1" + +[[package]] +name = "zipp" +version = "3.1.0" +description = "Backport of pathlib-compatible object wrapper for zip files" +category = "main" +optional = false +python-versions = ">=3.6" + +[package.extras] +docs = ["sphinx", "jaraco.packaging (>=3.2)", "rst.linker (>=1.9)"] +testing = ["jaraco.itertools", "func-timeout"] + +[extras] +jupyter = ["ipywidgets"] + +[metadata] +lock-version = "1.1" +python-versions = "^3.6" +content-hash = "bfbfaf39cebfae1163b7dca1e7cd1c9f79f145d4cc96790fee9a85aeb15d3a79" + +[metadata.files] +appdirs = [ + {file = "appdirs-1.4.4-py2.py3-none-any.whl", hash = "sha256:a841dacd6b99318a741b166adb07e19ee71a274450e68237b4650ca1055ab128"}, + {file = "appdirs-1.4.4.tar.gz", hash = "sha256:7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41"}, +] +appnope = [ + {file = "appnope-0.1.0-py2.py3-none-any.whl", hash = "sha256:5b26757dc6f79a3b7dc9fab95359328d5747fcb2409d331ea66d0272b90ab2a0"}, + {file = "appnope-0.1.0.tar.gz", hash = "sha256:8b995ffe925347a2138d7ac0fe77155e4311a0ea6d6da4f5128fe4b3cbe5ed71"}, +] +atomicwrites = [ + {file = "atomicwrites-1.4.0-py2.py3-none-any.whl", hash = "sha256:6d1784dea7c0c8d4a5172b6c620f40b6e4cbfdf96d783691f2e1302a7b88e197"}, + {file = "atomicwrites-1.4.0.tar.gz", hash = "sha256:ae70396ad1a434f9c7046fd2dd196fc04b12f9e91ffb859164193be8b6168a7a"}, +] +attrs = [ + {file = "attrs-19.3.0-py2.py3-none-any.whl", hash = "sha256:08a96c641c3a74e44eb59afb61a24f2cb9f4d7188748e76ba4bb5edfa3cb7d1c"}, + {file = "attrs-19.3.0.tar.gz", hash = "sha256:f7b7ce16570fe9965acd6d30101a28f62fb4a7f9e926b3bbc9b61f8b04247e72"}, +] +backcall = [ + {file = "backcall-0.2.0-py2.py3-none-any.whl", hash = "sha256:fbbce6a29f263178a1f7915c1940bde0ec2b2a967566fe1c65c1dfb7422bd255"}, + {file = "backcall-0.2.0.tar.gz", hash = "sha256:5cbdbf27be5e7cfadb448baf0aa95508f91f2bbc6c6437cd9cd06e2a4c215e1e"}, +] +black = [ + {file = "black-20.8b1.tar.gz", hash = "sha256:1c02557aa099101b9d21496f8a914e9ed2222ef70336404eeeac8edba836fbea"}, +] +bleach = [ + {file = "bleach-3.1.5-py2.py3-none-any.whl", hash = "sha256:2bce3d8fab545a6528c8fa5d9f9ae8ebc85a56da365c7f85180bfe96a35ef22f"}, + {file = "bleach-3.1.5.tar.gz", hash = "sha256:3c4c520fdb9db59ef139915a5db79f8b51bc2a7257ea0389f30c846883430a4b"}, +] +click = [ + {file = "click-7.1.2-py2.py3-none-any.whl", hash = "sha256:dacca89f4bfadd5de3d7489b7c8a566eee0d3676333fbb50030263894c38c0dc"}, + {file = "click-7.1.2.tar.gz", hash = "sha256:d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a"}, +] +colorama = [ + {file = "colorama-0.4.4-py2.py3-none-any.whl", hash = "sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2"}, + {file = "colorama-0.4.4.tar.gz", hash = "sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"}, +] +commonmark = [ + {file = "commonmark-0.9.1-py2.py3-none-any.whl", hash = "sha256:da2f38c92590f83de410ba1a3cbceafbc74fee9def35f9251ba9a971d6d66fd9"}, + {file = "commonmark-0.9.1.tar.gz", hash = "sha256:452f9dc859be7f06631ddcb328b6919c67984aca654e5fefb3914d54691aed60"}, +] +coverage = [ + {file = "coverage-5.3-cp27-cp27m-macosx_10_13_intel.whl", hash = "sha256:bd3166bb3b111e76a4f8e2980fa1addf2920a4ca9b2b8ca36a3bc3dedc618270"}, + {file = "coverage-5.3-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:9342dd70a1e151684727c9c91ea003b2fb33523bf19385d4554f7897ca0141d4"}, + {file = "coverage-5.3-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:63808c30b41f3bbf65e29f7280bf793c79f54fb807057de7e5238ffc7cc4d7b9"}, + {file = "coverage-5.3-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:4d6a42744139a7fa5b46a264874a781e8694bb32f1d76d8137b68138686f1729"}, + {file = "coverage-5.3-cp27-cp27m-win32.whl", hash = "sha256:86e9f8cd4b0cdd57b4ae71a9c186717daa4c5a99f3238a8723f416256e0b064d"}, + {file = "coverage-5.3-cp27-cp27m-win_amd64.whl", hash = "sha256:7858847f2d84bf6e64c7f66498e851c54de8ea06a6f96a32a1d192d846734418"}, + {file = "coverage-5.3-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:530cc8aaf11cc2ac7430f3614b04645662ef20c348dce4167c22d99bec3480e9"}, + {file = "coverage-5.3-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:381ead10b9b9af5f64646cd27107fb27b614ee7040bb1226f9c07ba96625cbb5"}, + {file = "coverage-5.3-cp35-cp35m-macosx_10_13_x86_64.whl", hash = "sha256:71b69bd716698fa62cd97137d6f2fdf49f534decb23a2c6fc80813e8b7be6822"}, + {file = "coverage-5.3-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:1d44bb3a652fed01f1f2c10d5477956116e9b391320c94d36c6bf13b088a1097"}, + {file = "coverage-5.3-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:1c6703094c81fa55b816f5ae542c6ffc625fec769f22b053adb42ad712d086c9"}, + {file = "coverage-5.3-cp35-cp35m-win32.whl", hash = "sha256:cedb2f9e1f990918ea061f28a0f0077a07702e3819602d3507e2ff98c8d20636"}, + {file = "coverage-5.3-cp35-cp35m-win_amd64.whl", hash = "sha256:7f43286f13d91a34fadf61ae252a51a130223c52bfefb50310d5b2deb062cf0f"}, + {file = "coverage-5.3-cp36-cp36m-macosx_10_13_x86_64.whl", hash = "sha256:c851b35fc078389bc16b915a0a7c1d5923e12e2c5aeec58c52f4aa8085ac8237"}, + {file = "coverage-5.3-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:aac1ba0a253e17889550ddb1b60a2063f7474155465577caa2a3b131224cfd54"}, + {file = "coverage-5.3-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:2b31f46bf7b31e6aa690d4c7a3d51bb262438c6dcb0d528adde446531d0d3bb7"}, + {file = "coverage-5.3-cp36-cp36m-win32.whl", hash = "sha256:c5f17ad25d2c1286436761b462e22b5020d83316f8e8fcb5deb2b3151f8f1d3a"}, + {file = "coverage-5.3-cp36-cp36m-win_amd64.whl", hash = "sha256:aef72eae10b5e3116bac6957de1df4d75909fc76d1499a53fb6387434b6bcd8d"}, + {file = "coverage-5.3-cp37-cp37m-macosx_10_13_x86_64.whl", hash = "sha256:e8caf961e1b1a945db76f1b5fa9c91498d15f545ac0ababbe575cfab185d3bd8"}, + {file = "coverage-5.3-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:29a6272fec10623fcbe158fdf9abc7a5fa032048ac1d8631f14b50fbfc10d17f"}, + {file = "coverage-5.3-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:2d43af2be93ffbad25dd959899b5b809618a496926146ce98ee0b23683f8c51c"}, + {file = "coverage-5.3-cp37-cp37m-win32.whl", hash = "sha256:c3888a051226e676e383de03bf49eb633cd39fc829516e5334e69b8d81aae751"}, + {file = "coverage-5.3-cp37-cp37m-win_amd64.whl", hash = "sha256:9669179786254a2e7e57f0ecf224e978471491d660aaca833f845b72a2df3709"}, + {file = "coverage-5.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:0203acd33d2298e19b57451ebb0bed0ab0c602e5cf5a818591b4918b1f97d516"}, + {file = "coverage-5.3-cp38-cp38-manylinux1_i686.whl", hash = "sha256:582ddfbe712025448206a5bc45855d16c2e491c2dd102ee9a2841418ac1c629f"}, + {file = "coverage-5.3-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:0f313707cdecd5cd3e217fc68c78a960b616604b559e9ea60cc16795c4304259"}, + {file = "coverage-5.3-cp38-cp38-win32.whl", hash = "sha256:78e93cc3571fd928a39c0b26767c986188a4118edc67bc0695bc7a284da22e82"}, + {file = "coverage-5.3-cp38-cp38-win_amd64.whl", hash = "sha256:8f264ba2701b8c9f815b272ad568d555ef98dfe1576802ab3149c3629a9f2221"}, + {file = "coverage-5.3-cp39-cp39-macosx_10_13_x86_64.whl", hash = "sha256:50691e744714856f03a86df3e2bff847c2acede4c191f9a1da38f088df342978"}, + {file = "coverage-5.3-cp39-cp39-manylinux1_i686.whl", hash = "sha256:9361de40701666b034c59ad9e317bae95c973b9ff92513dd0eced11c6adf2e21"}, + {file = "coverage-5.3-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:c1b78fb9700fc961f53386ad2fd86d87091e06ede5d118b8a50dea285a071c24"}, + {file = "coverage-5.3-cp39-cp39-win32.whl", hash = "sha256:cb7df71de0af56000115eafd000b867d1261f786b5eebd88a0ca6360cccfaca7"}, + {file = "coverage-5.3-cp39-cp39-win_amd64.whl", hash = "sha256:47a11bdbd8ada9b7ee628596f9d97fbd3851bd9999d398e9436bd67376dbece7"}, + {file = "coverage-5.3.tar.gz", hash = "sha256:280baa8ec489c4f542f8940f9c4c2181f0306a8ee1a54eceba071a449fb870a0"}, +] +dataclasses = [ + {file = "dataclasses-0.8-py3-none-any.whl", hash = "sha256:0201d89fa866f68c8ebd9d08ee6ff50c0b255f8ec63a71c16fda7af82bb887bf"}, + {file = "dataclasses-0.8.tar.gz", hash = "sha256:8479067f342acf957dc82ec415d355ab5edb7e7646b90dc6e2fd1d96ad084c97"}, +] +decorator = [ + {file = "decorator-4.4.2-py2.py3-none-any.whl", hash = "sha256:41fa54c2a0cc4ba648be4fd43cff00aedf5b9465c9bf18d64325bc225f08f760"}, + {file = "decorator-4.4.2.tar.gz", hash = "sha256:e3a62f0520172440ca0dcc823749319382e377f37f140a0b99ef45fecb84bfe7"}, +] +defusedxml = [ + {file = "defusedxml-0.6.0-py2.py3-none-any.whl", hash = "sha256:6687150770438374ab581bb7a1b327a847dd9c5749e396102de3fad4e8a3ef93"}, + {file = "defusedxml-0.6.0.tar.gz", hash = "sha256:f684034d135af4c6cbb949b8a4d2ed61634515257a67299e5f940fbaa34377f5"}, +] +entrypoints = [ + {file = "entrypoints-0.3-py2.py3-none-any.whl", hash = "sha256:589f874b313739ad35be6e0cd7efde2a4e9b6fea91edcc34e58ecbb8dbe56d19"}, + {file = "entrypoints-0.3.tar.gz", hash = "sha256:c70dd71abe5a8c85e55e12c19bd91ccfeec11a6e99044204511f9ed547d48451"}, +] +importlib-metadata = [ + {file = "importlib_metadata-1.7.0-py2.py3-none-any.whl", hash = "sha256:dc15b2969b4ce36305c51eebe62d418ac7791e9a157911d58bfb1f9ccd8e2070"}, + {file = "importlib_metadata-1.7.0.tar.gz", hash = "sha256:90bb658cdbbf6d1735b6341ce708fc7024a3e14e99ffdc5783edea9f9b077f83"}, +] +iniconfig = [ + {file = "iniconfig-1.1.1-py2.py3-none-any.whl", hash = "sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3"}, + {file = "iniconfig-1.1.1.tar.gz", hash = "sha256:bc3af051d7d14b2ee5ef9969666def0cd1a000e121eaea580d4a313df4b37f32"}, +] +ipykernel = [ + {file = "ipykernel-5.3.2-py3-none-any.whl", hash = "sha256:0a5f1fc6f63241b9710b5960d314ffe44d8a18bf6674e3f28d2542b192fa318c"}, + {file = "ipykernel-5.3.2.tar.gz", hash = "sha256:89dc4bd19c7781f6d7eef0e666c59ce57beac56bb39b511544a71397b7b31cbb"}, +] +ipython = [ + {file = "ipython-7.16.1-py3-none-any.whl", hash = "sha256:2dbcc8c27ca7d3cfe4fcdff7f45b27f9a8d3edfa70ff8024a71c7a8eb5f09d64"}, + {file = "ipython-7.16.1.tar.gz", hash = "sha256:9f4fcb31d3b2c533333893b9172264e4821c1ac91839500f31bd43f2c59b3ccf"}, +] +ipython-genutils = [ + {file = "ipython_genutils-0.2.0-py2.py3-none-any.whl", hash = "sha256:72dd37233799e619666c9f639a9da83c34013a73e8bbc79a7a6348d93c61fab8"}, + {file = "ipython_genutils-0.2.0.tar.gz", hash = "sha256:eb2e116e75ecef9d4d228fdc66af54269afa26ab4463042e33785b887c628ba8"}, +] +ipywidgets = [ + {file = "ipywidgets-7.6.3-py2.py3-none-any.whl", hash = "sha256:e6513cfdaf5878de30f32d57f6dc2474da395a2a2991b94d487406c0ab7f55ca"}, + {file = "ipywidgets-7.6.3.tar.gz", hash = "sha256:9f1a43e620530f9e570e4a493677d25f08310118d315b00e25a18f12913c41f0"}, +] +jedi = [ + {file = "jedi-0.17.1-py2.py3-none-any.whl", hash = "sha256:1ddb0ec78059e8e27ec9eb5098360b4ea0a3dd840bedf21415ea820c21b40a22"}, + {file = "jedi-0.17.1.tar.gz", hash = "sha256:807d5d4f96711a2bcfdd5dfa3b1ae6d09aa53832b182090b222b5efb81f52f63"}, +] +jinja2 = [ + {file = "Jinja2-2.11.2-py2.py3-none-any.whl", hash = "sha256:f0a4641d3cf955324a89c04f3d94663aa4d638abe8f733ecd3582848e1c37035"}, + {file = "Jinja2-2.11.2.tar.gz", hash = "sha256:89aab215427ef59c34ad58735269eb58b1a5808103067f7bb9d5836c651b3bb0"}, +] +jsonschema = [ + {file = "jsonschema-3.2.0-py2.py3-none-any.whl", hash = "sha256:4e5b3cf8216f577bee9ce139cbe72eca3ea4f292ec60928ff24758ce626cd163"}, + {file = "jsonschema-3.2.0.tar.gz", hash = "sha256:c8a85b28d377cc7737e46e2d9f2b4f44ee3c0e1deac6bf46ddefc7187d30797a"}, +] +jupyter-client = [ + {file = "jupyter_client-6.1.5-py3-none-any.whl", hash = "sha256:9f0092a0951d878e7521924899e1fba6f689c7a99d43735a4c0bc05c6f311452"}, + {file = "jupyter_client-6.1.5.tar.gz", hash = "sha256:5099cda1ac86b27b655a715c51e15bdc8bd9595b2b17adb41a2bd446bbbafc4a"}, +] +jupyter-core = [ + {file = "jupyter_core-4.6.3-py2.py3-none-any.whl", hash = "sha256:a4ee613c060fe5697d913416fc9d553599c05e4492d58fac1192c9a6844abb21"}, + {file = "jupyter_core-4.6.3.tar.gz", hash = "sha256:394fd5dd787e7c8861741880bdf8a00ce39f95de5d18e579c74b882522219e7e"}, +] +jupyterlab-widgets = [ + {file = "jupyterlab_widgets-1.0.0-py3-none-any.whl", hash = "sha256:caeaf3e6103180e654e7d8d2b81b7d645e59e432487c1d35a41d6d3ee56b3fef"}, + {file = "jupyterlab_widgets-1.0.0.tar.gz", hash = "sha256:5c1a29a84d3069208cb506b10609175b249b6486d6b1cbae8fcde2a11584fb78"}, +] +markupsafe = [ + {file = "MarkupSafe-1.1.1-cp27-cp27m-macosx_10_6_intel.whl", hash = "sha256:09027a7803a62ca78792ad89403b1b7a73a01c8cb65909cd876f7fcebd79b161"}, + {file = "MarkupSafe-1.1.1-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:e249096428b3ae81b08327a63a485ad0878de3fb939049038579ac0ef61e17e7"}, + {file = "MarkupSafe-1.1.1-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:500d4957e52ddc3351cabf489e79c91c17f6e0899158447047588650b5e69183"}, + {file = "MarkupSafe-1.1.1-cp27-cp27m-win32.whl", hash = "sha256:b2051432115498d3562c084a49bba65d97cf251f5a331c64a12ee7e04dacc51b"}, + {file = "MarkupSafe-1.1.1-cp27-cp27m-win_amd64.whl", hash = "sha256:98c7086708b163d425c67c7a91bad6e466bb99d797aa64f965e9d25c12111a5e"}, + {file = "MarkupSafe-1.1.1-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:cd5df75523866410809ca100dc9681e301e3c27567cf498077e8551b6d20e42f"}, + {file = "MarkupSafe-1.1.1-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:43a55c2930bbc139570ac2452adf3d70cdbb3cfe5912c71cdce1c2c6bbd9c5d1"}, + {file = "MarkupSafe-1.1.1-cp34-cp34m-macosx_10_6_intel.whl", hash = "sha256:1027c282dad077d0bae18be6794e6b6b8c91d58ed8a8d89a89d59693b9131db5"}, + {file = "MarkupSafe-1.1.1-cp34-cp34m-manylinux1_i686.whl", hash = "sha256:62fe6c95e3ec8a7fad637b7f3d372c15ec1caa01ab47926cfdf7a75b40e0eac1"}, + {file = "MarkupSafe-1.1.1-cp34-cp34m-manylinux1_x86_64.whl", hash = "sha256:88e5fcfb52ee7b911e8bb6d6aa2fd21fbecc674eadd44118a9cc3863f938e735"}, + {file = "MarkupSafe-1.1.1-cp34-cp34m-win32.whl", hash = "sha256:ade5e387d2ad0d7ebf59146cc00c8044acbd863725f887353a10df825fc8ae21"}, + {file = "MarkupSafe-1.1.1-cp34-cp34m-win_amd64.whl", hash = "sha256:09c4b7f37d6c648cb13f9230d847adf22f8171b1ccc4d5682398e77f40309235"}, + {file = "MarkupSafe-1.1.1-cp35-cp35m-macosx_10_6_intel.whl", hash = "sha256:79855e1c5b8da654cf486b830bd42c06e8780cea587384cf6545b7d9ac013a0b"}, + {file = "MarkupSafe-1.1.1-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:c8716a48d94b06bb3b2524c2b77e055fb313aeb4ea620c8dd03a105574ba704f"}, + {file = "MarkupSafe-1.1.1-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:7c1699dfe0cf8ff607dbdcc1e9b9af1755371f92a68f706051cc8c37d447c905"}, + {file = "MarkupSafe-1.1.1-cp35-cp35m-win32.whl", hash = "sha256:6dd73240d2af64df90aa7c4e7481e23825ea70af4b4922f8ede5b9e35f78a3b1"}, + {file = "MarkupSafe-1.1.1-cp35-cp35m-win_amd64.whl", hash = "sha256:9add70b36c5666a2ed02b43b335fe19002ee5235efd4b8a89bfcf9005bebac0d"}, + {file = "MarkupSafe-1.1.1-cp36-cp36m-macosx_10_6_intel.whl", hash = "sha256:24982cc2533820871eba85ba648cd53d8623687ff11cbb805be4ff7b4c971aff"}, + {file = "MarkupSafe-1.1.1-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:00bc623926325b26bb9605ae9eae8a215691f33cae5df11ca5424f06f2d1f473"}, + {file = "MarkupSafe-1.1.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:717ba8fe3ae9cc0006d7c451f0bb265ee07739daf76355d06366154ee68d221e"}, + {file = "MarkupSafe-1.1.1-cp36-cp36m-win32.whl", hash = "sha256:535f6fc4d397c1563d08b88e485c3496cf5784e927af890fb3c3aac7f933ec66"}, + {file = "MarkupSafe-1.1.1-cp36-cp36m-win_amd64.whl", hash = "sha256:b1282f8c00509d99fef04d8ba936b156d419be841854fe901d8ae224c59f0be5"}, + {file = "MarkupSafe-1.1.1-cp37-cp37m-macosx_10_6_intel.whl", hash = "sha256:8defac2f2ccd6805ebf65f5eeb132adcf2ab57aa11fdf4c0dd5169a004710e7d"}, + {file = "MarkupSafe-1.1.1-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:46c99d2de99945ec5cb54f23c8cd5689f6d7177305ebff350a58ce5f8de1669e"}, + {file = "MarkupSafe-1.1.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:ba59edeaa2fc6114428f1637ffff42da1e311e29382d81b339c1817d37ec93c6"}, + {file = "MarkupSafe-1.1.1-cp37-cp37m-win32.whl", hash = "sha256:b00c1de48212e4cc9603895652c5c410df699856a2853135b3967591e4beebc2"}, + {file = "MarkupSafe-1.1.1-cp37-cp37m-win_amd64.whl", hash = "sha256:9bf40443012702a1d2070043cb6291650a0841ece432556f784f004937f0f32c"}, + {file = "MarkupSafe-1.1.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:6788b695d50a51edb699cb55e35487e430fa21f1ed838122d722e0ff0ac5ba15"}, + {file = "MarkupSafe-1.1.1-cp38-cp38-manylinux1_i686.whl", hash = "sha256:cdb132fc825c38e1aeec2c8aa9338310d29d337bebbd7baa06889d09a60a1fa2"}, + {file = "MarkupSafe-1.1.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:13d3144e1e340870b25e7b10b98d779608c02016d5184cfb9927a9f10c689f42"}, + {file = "MarkupSafe-1.1.1-cp38-cp38-win32.whl", hash = "sha256:596510de112c685489095da617b5bcbbac7dd6384aeebeda4df6025d0256a81b"}, + {file = "MarkupSafe-1.1.1-cp38-cp38-win_amd64.whl", hash = "sha256:e8313f01ba26fbbe36c7be1966a7b7424942f670f38e666995b88d012765b9be"}, + {file = "MarkupSafe-1.1.1.tar.gz", hash = "sha256:29872e92839765e546828bb7754a68c418d927cd064fd4708fab9fe9c8bb116b"}, +] +mistune = [ + {file = "mistune-0.8.4-py2.py3-none-any.whl", hash = "sha256:88a1051873018da288eee8538d476dffe1262495144b33ecb586c4ab266bb8d4"}, + {file = "mistune-0.8.4.tar.gz", hash = "sha256:59a3429db53c50b5c6bcc8a07f8848cb00d7dc8bdb431a4ab41920d201d4756e"}, +] +mypy = [ + {file = "mypy-0.790-cp35-cp35m-macosx_10_6_x86_64.whl", hash = "sha256:bd03b3cf666bff8d710d633d1c56ab7facbdc204d567715cb3b9f85c6e94f669"}, + {file = "mypy-0.790-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:2170492030f6faa537647d29945786d297e4862765f0b4ac5930ff62e300d802"}, + {file = "mypy-0.790-cp35-cp35m-win_amd64.whl", hash = "sha256:e86bdace26c5fe9cf8cb735e7cedfe7850ad92b327ac5d797c656717d2ca66de"}, + {file = "mypy-0.790-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:e97e9c13d67fbe524be17e4d8025d51a7dca38f90de2e462243ab8ed8a9178d1"}, + {file = "mypy-0.790-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:0d34d6b122597d48a36d6c59e35341f410d4abfa771d96d04ae2c468dd201abc"}, + {file = "mypy-0.790-cp36-cp36m-win_amd64.whl", hash = "sha256:72060bf64f290fb629bd4a67c707a66fd88ca26e413a91384b18db3876e57ed7"}, + {file = "mypy-0.790-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:eea260feb1830a627fb526d22fbb426b750d9f5a47b624e8d5e7e004359b219c"}, + {file = "mypy-0.790-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:c614194e01c85bb2e551c421397e49afb2872c88b5830e3554f0519f9fb1c178"}, + {file = "mypy-0.790-cp37-cp37m-win_amd64.whl", hash = "sha256:0a0d102247c16ce93c97066443d11e2d36e6cc2a32d8ccc1f705268970479324"}, + {file = "mypy-0.790-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:cf4e7bf7f1214826cf7333627cb2547c0db7e3078723227820d0a2490f117a01"}, + {file = "mypy-0.790-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:af4e9ff1834e565f1baa74ccf7ae2564ae38c8df2a85b057af1dbbc958eb6666"}, + {file = "mypy-0.790-cp38-cp38-win_amd64.whl", hash = "sha256:da56dedcd7cd502ccd3c5dddc656cb36113dd793ad466e894574125945653cea"}, + {file = "mypy-0.790-py3-none-any.whl", hash = "sha256:2842d4fbd1b12ab422346376aad03ff5d0805b706102e475e962370f874a5122"}, + {file = "mypy-0.790.tar.gz", hash = "sha256:2b21ba45ad9ef2e2eb88ce4aeadd0112d0f5026418324176fd494a6824b74975"}, +] +mypy-extensions = [ + {file = "mypy_extensions-0.4.3-py2.py3-none-any.whl", hash = "sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d"}, + {file = "mypy_extensions-0.4.3.tar.gz", hash = "sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8"}, +] +nbconvert = [ + {file = "nbconvert-5.6.1-py2.py3-none-any.whl", hash = "sha256:f0d6ec03875f96df45aa13e21fd9b8450c42d7e1830418cccc008c0df725fcee"}, + {file = "nbconvert-5.6.1.tar.gz", hash = "sha256:21fb48e700b43e82ba0e3142421a659d7739b65568cc832a13976a77be16b523"}, +] +nbformat = [ + {file = "nbformat-5.0.7-py3-none-any.whl", hash = "sha256:ea55c9b817855e2dfcd3f66d74857342612a60b1f09653440f4a5845e6e3523f"}, + {file = "nbformat-5.0.7.tar.gz", hash = "sha256:54d4d6354835a936bad7e8182dcd003ca3dc0cedfee5a306090e04854343b340"}, +] +notebook = [ + {file = "notebook-6.0.3-py3-none-any.whl", hash = "sha256:3edc616c684214292994a3af05eaea4cc043f6b4247d830f3a2f209fa7639a80"}, + {file = "notebook-6.0.3.tar.gz", hash = "sha256:47a9092975c9e7965ada00b9a20f0cf637d001db60d241d479f53c0be117ad48"}, +] +packaging = [ + {file = "packaging-20.4-py2.py3-none-any.whl", hash = "sha256:998416ba6962ae7fbd6596850b80e17859a5753ba17c32284f67bfff33784181"}, + {file = "packaging-20.4.tar.gz", hash = "sha256:4357f74f47b9c12db93624a82154e9b120fa8293699949152b22065d556079f8"}, +] +pandocfilters = [ + {file = "pandocfilters-1.4.2.tar.gz", hash = "sha256:b3dd70e169bb5449e6bc6ff96aea89c5eea8c5f6ab5e207fc2f521a2cf4a0da9"}, +] +parso = [ + {file = "parso-0.7.0-py2.py3-none-any.whl", hash = "sha256:158c140fc04112dc45bca311633ae5033c2c2a7b732fa33d0955bad8152a8dd0"}, + {file = "parso-0.7.0.tar.gz", hash = "sha256:908e9fae2144a076d72ae4e25539143d40b8e3eafbaeae03c1bfe226f4cdf12c"}, +] +pathspec = [ + {file = "pathspec-0.8.1-py2.py3-none-any.whl", hash = "sha256:aa0cb481c4041bf52ffa7b0d8fa6cd3e88a2ca4879c533c9153882ee2556790d"}, + {file = "pathspec-0.8.1.tar.gz", hash = "sha256:86379d6b86d75816baba717e64b1a3a3469deb93bb76d613c9ce79edc5cb68fd"}, +] +pexpect = [ + {file = "pexpect-4.8.0-py2.py3-none-any.whl", hash = "sha256:0b48a55dcb3c05f3329815901ea4fc1537514d6ba867a152b581d69ae3710937"}, + {file = "pexpect-4.8.0.tar.gz", hash = "sha256:fc65a43959d153d0114afe13997d439c22823a27cefceb5ff35c2178c6784c0c"}, +] +pickleshare = [ + {file = "pickleshare-0.7.5-py2.py3-none-any.whl", hash = "sha256:9649af414d74d4df115d5d718f82acb59c9d418196b7b4290ed47a12ce62df56"}, + {file = "pickleshare-0.7.5.tar.gz", hash = "sha256:87683d47965c1da65cdacaf31c8441d12b8044cdec9aca500cd78fc2c683afca"}, +] +pluggy = [ + {file = "pluggy-0.13.1-py2.py3-none-any.whl", hash = "sha256:966c145cd83c96502c3c3868f50408687b38434af77734af1e9ca461a4081d2d"}, + {file = "pluggy-0.13.1.tar.gz", hash = "sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0"}, +] +prometheus-client = [ + {file = "prometheus_client-0.8.0-py2.py3-none-any.whl", hash = "sha256:983c7ac4b47478720db338f1491ef67a100b474e3bc7dafcbaefb7d0b8f9b01c"}, + {file = "prometheus_client-0.8.0.tar.gz", hash = "sha256:c6e6b706833a6bd1fd51711299edee907857be10ece535126a158f911ee80915"}, +] +prompt-toolkit = [ + {file = "prompt_toolkit-3.0.3-py3-none-any.whl", hash = "sha256:c93e53af97f630f12f5f62a3274e79527936ed466f038953dfa379d4941f651a"}, + {file = "prompt_toolkit-3.0.3.tar.gz", hash = "sha256:a402e9bf468b63314e37460b68ba68243d55b2f8c4d0192f85a019af3945050e"}, +] +ptyprocess = [ + {file = "ptyprocess-0.6.0-py2.py3-none-any.whl", hash = "sha256:d7cc528d76e76342423ca640335bd3633420dc1366f258cb31d05e865ef5ca1f"}, + {file = "ptyprocess-0.6.0.tar.gz", hash = "sha256:923f299cc5ad920c68f2bc0bc98b75b9f838b93b599941a6b63ddbc2476394c0"}, +] +py = [ + {file = "py-1.9.0-py2.py3-none-any.whl", hash = "sha256:366389d1db726cd2fcfc79732e75410e5fe4d31db13692115529d34069a043c2"}, + {file = "py-1.9.0.tar.gz", hash = "sha256:9ca6883ce56b4e8da7e79ac18787889fa5206c79dcc67fb065376cd2fe03f342"}, +] +pygments = [ + {file = "Pygments-2.7.3-py3-none-any.whl", hash = "sha256:f275b6c0909e5dafd2d6269a656aa90fa58ebf4a74f8fcf9053195d226b24a08"}, + {file = "Pygments-2.7.3.tar.gz", hash = "sha256:ccf3acacf3782cbed4a989426012f1c535c9a90d3a7fc3f16d231b9372d2b716"}, +] +pyparsing = [ + {file = "pyparsing-2.4.7-py2.py3-none-any.whl", hash = "sha256:ef9d7589ef3c200abe66653d3f1ab1033c3c419ae9b9bdb1240a85b024efc88b"}, + {file = "pyparsing-2.4.7.tar.gz", hash = "sha256:c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1"}, +] +pyrsistent = [ + {file = "pyrsistent-0.16.0.tar.gz", hash = "sha256:28669905fe725965daa16184933676547c5bb40a5153055a8dee2a4bd7933ad3"}, +] +pytest = [ + {file = "pytest-6.2.1-py3-none-any.whl", hash = "sha256:1969f797a1a0dbd8ccf0fecc80262312729afea9c17f1d70ebf85c5e76c6f7c8"}, + {file = "pytest-6.2.1.tar.gz", hash = "sha256:66e419b1899bc27346cb2c993e12c5e5e8daba9073c1fbce33b9807abc95c306"}, +] +pytest-cov = [ + {file = "pytest-cov-2.10.1.tar.gz", hash = "sha256:47bd0ce14056fdd79f93e1713f88fad7bdcc583dcd7783da86ef2f085a0bb88e"}, + {file = "pytest_cov-2.10.1-py2.py3-none-any.whl", hash = "sha256:45ec2d5182f89a81fc3eb29e3d1ed3113b9e9a873bcddb2a71faaab066110191"}, +] +python-dateutil = [ + {file = "python-dateutil-2.8.1.tar.gz", hash = "sha256:73ebfe9dbf22e832286dafa60473e4cd239f8592f699aa5adaf10050e6e1823c"}, + {file = "python_dateutil-2.8.1-py2.py3-none-any.whl", hash = "sha256:75bb3f31ea686f1197762692a9ee6a7550b59fc6ca3a1f4b5d7e32fb98e2da2a"}, +] +pywin32 = [ + {file = "pywin32-228-cp27-cp27m-win32.whl", hash = "sha256:37dc9935f6a383cc744315ae0c2882ba1768d9b06700a70f35dc1ce73cd4ba9c"}, + {file = "pywin32-228-cp27-cp27m-win_amd64.whl", hash = "sha256:11cb6610efc2f078c9e6d8f5d0f957620c333f4b23466931a247fb945ed35e89"}, + {file = "pywin32-228-cp35-cp35m-win32.whl", hash = "sha256:1f45db18af5d36195447b2cffacd182fe2d296849ba0aecdab24d3852fbf3f80"}, + {file = "pywin32-228-cp35-cp35m-win_amd64.whl", hash = "sha256:6e38c44097a834a4707c1b63efa9c2435f5a42afabff634a17f563bc478dfcc8"}, + {file = "pywin32-228-cp36-cp36m-win32.whl", hash = "sha256:ec16d44b49b5f34e99eb97cf270806fdc560dff6f84d281eb2fcb89a014a56a9"}, + {file = "pywin32-228-cp36-cp36m-win_amd64.whl", hash = "sha256:a60d795c6590a5b6baeacd16c583d91cce8038f959bd80c53bd9a68f40130f2d"}, + {file = "pywin32-228-cp37-cp37m-win32.whl", hash = "sha256:af40887b6fc200eafe4d7742c48417529a8702dcc1a60bf89eee152d1d11209f"}, + {file = "pywin32-228-cp37-cp37m-win_amd64.whl", hash = "sha256:00eaf43dbd05ba6a9b0080c77e161e0b7a601f9a3f660727a952e40140537de7"}, + {file = "pywin32-228-cp38-cp38-win32.whl", hash = "sha256:fa6ba028909cfc64ce9e24bcf22f588b14871980d9787f1e2002c99af8f1850c"}, + {file = "pywin32-228-cp38-cp38-win_amd64.whl", hash = "sha256:9b3466083f8271e1a5eb0329f4e0d61925d46b40b195a33413e0905dccb285e8"}, + {file = "pywin32-228-cp39-cp39-win32.whl", hash = "sha256:ed74b72d8059a6606f64842e7917aeee99159ebd6b8d6261c518d002837be298"}, + {file = "pywin32-228-cp39-cp39-win_amd64.whl", hash = "sha256:8319bafdcd90b7202c50d6014efdfe4fde9311b3ff15fd6f893a45c0868de203"}, +] +pywinpty = [ + {file = "pywinpty-0.5.7-cp27-cp27m-win32.whl", hash = "sha256:b358cb552c0f6baf790de375fab96524a0498c9df83489b8c23f7f08795e966b"}, + {file = "pywinpty-0.5.7-cp27-cp27m-win_amd64.whl", hash = "sha256:1e525a4de05e72016a7af27836d512db67d06a015aeaf2fa0180f8e6a039b3c2"}, + {file = "pywinpty-0.5.7-cp35-cp35m-win32.whl", hash = "sha256:2740eeeb59297593a0d3f762269b01d0285c1b829d6827445fcd348fb47f7e70"}, + {file = "pywinpty-0.5.7-cp35-cp35m-win_amd64.whl", hash = "sha256:33df97f79843b2b8b8bc5c7aaf54adec08cc1bae94ee99dfb1a93c7a67704d95"}, + {file = "pywinpty-0.5.7-cp36-cp36m-win32.whl", hash = "sha256:e854211df55d107f0edfda8a80b39dfc87015bef52a8fe6594eb379240d81df2"}, + {file = "pywinpty-0.5.7-cp36-cp36m-win_amd64.whl", hash = "sha256:dbd838de92de1d4ebf0dce9d4d5e4fc38d0b7b1de837947a18b57a882f219139"}, + {file = "pywinpty-0.5.7-cp37-cp37m-win32.whl", hash = "sha256:5fb2c6c6819491b216f78acc2c521b9df21e0f53b9a399d58a5c151a3c4e2a2d"}, + {file = "pywinpty-0.5.7-cp37-cp37m-win_amd64.whl", hash = "sha256:dd22c8efacf600730abe4a46c1388355ce0d4ab75dc79b15d23a7bd87bf05b48"}, + {file = "pywinpty-0.5.7-cp38-cp38-win_amd64.whl", hash = "sha256:8fc5019ff3efb4f13708bd3b5ad327589c1a554cb516d792527361525a7cb78c"}, + {file = "pywinpty-0.5.7.tar.gz", hash = "sha256:2d7e9c881638a72ffdca3f5417dd1563b60f603e1b43e5895674c2a1b01f95a0"}, +] +pyzmq = [ + {file = "pyzmq-19.0.1-cp27-cp27m-macosx_10_9_intel.whl", hash = "sha256:58688a2dfa044fad608a8e70ba8d019d0b872ec2acd75b7b5e37da8905605891"}, + {file = "pyzmq-19.0.1-cp27-cp27m-win32.whl", hash = "sha256:87c78f6936e2654397ca2979c1d323ee4a889eef536cc77a938c6b5be33351a7"}, + {file = "pyzmq-19.0.1-cp27-cp27m-win_amd64.whl", hash = "sha256:97b6255ae77328d0e80593681826a0479cb7bac0ba8251b4dd882f5145a2293a"}, + {file = "pyzmq-19.0.1-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:15b4cb21118f4589c4db8be4ac12b21c8b4d0d42b3ee435d47f686c32fe2e91f"}, + {file = "pyzmq-19.0.1-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:931339ac2000d12fe212e64f98ce291e81a7ec6c73b125f17cf08415b753c087"}, + {file = "pyzmq-19.0.1-cp35-cp35m-macosx_10_9_intel.whl", hash = "sha256:2a88b8fabd9cc35bd59194a7723f3122166811ece8b74018147a4ed8489e6421"}, + {file = "pyzmq-19.0.1-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:bafd651b557dd81d89bd5f9c678872f3e7b7255c1c751b78d520df2caac80230"}, + {file = "pyzmq-19.0.1-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:8952f6ba6ae598e792703f3134af5a01af8f5c7cf07e9a148f05a12b02412cea"}, + {file = "pyzmq-19.0.1-cp35-cp35m-win32.whl", hash = "sha256:54aa24fd60c4262286fc64ca632f9e747c7cc3a3a1144827490e1dc9b8a3a960"}, + {file = "pyzmq-19.0.1-cp35-cp35m-win_amd64.whl", hash = "sha256:dcbc3f30c11c60d709c30a213dc56e88ac016fe76ac6768e64717bd976072566"}, + {file = "pyzmq-19.0.1-cp36-cp36m-macosx_10_9_intel.whl", hash = "sha256:6ca519309703e95d55965735a667809bbb65f52beda2fdb6312385d3e7a6d234"}, + {file = "pyzmq-19.0.1-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:4ee0bfd82077a3ff11c985369529b12853a4064320523f8e5079b630f9551448"}, + {file = "pyzmq-19.0.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:ba6f24431b569aec674ede49cad197cad59571c12deed6ad8e3c596da8288217"}, + {file = "pyzmq-19.0.1-cp36-cp36m-win32.whl", hash = "sha256:956775444d01331c7eb412c5fb9bb62130dfaac77e09f32764ea1865234e2ca9"}, + {file = "pyzmq-19.0.1-cp36-cp36m-win_amd64.whl", hash = "sha256:b08780e3a55215873b3b8e6e7ca8987f14c902a24b6ac081b344fd430d6ca7cd"}, + {file = "pyzmq-19.0.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:21f7d91f3536f480cb2c10d0756bfa717927090b7fb863e6323f766e5461ee1c"}, + {file = "pyzmq-19.0.1-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:bfff5ffff051f5aa47ba3b379d87bd051c3196b0c8a603e8b7ed68a6b4f217ec"}, + {file = "pyzmq-19.0.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:07fb8fe6826a229dada876956590135871de60dbc7de5a18c3bcce2ed1f03c98"}, + {file = "pyzmq-19.0.1-cp37-cp37m-win32.whl", hash = "sha256:342fb8a1dddc569bc361387782e8088071593e7eaf3e3ecf7d6bd4976edff112"}, + {file = "pyzmq-19.0.1-cp37-cp37m-win_amd64.whl", hash = "sha256:faee2604f279d31312bc455f3d024f160b6168b9c1dde22bf62d8c88a4deca8e"}, + {file = "pyzmq-19.0.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:5b9d21fc56c8aacd2e6d14738021a9d64f3f69b30578a99325a728e38a349f85"}, + {file = "pyzmq-19.0.1-cp38-cp38-manylinux1_i686.whl", hash = "sha256:af0c02cf49f4f9eedf38edb4f3b6bb621d83026e7e5d76eb5526cc5333782fd6"}, + {file = "pyzmq-19.0.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:5f1f2eb22aab606f808163eb1d537ac9a0ba4283fbeb7a62eb48d9103cf015c2"}, + {file = "pyzmq-19.0.1-cp38-cp38-win32.whl", hash = "sha256:f9d7e742fb0196992477415bb34366c12e9bb9a0699b8b3f221ff93b213d7bec"}, + {file = "pyzmq-19.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:5b99c2ae8089ef50223c28bac57510c163bfdff158c9e90764f812b94e69a0e6"}, + {file = "pyzmq-19.0.1-pp27-pypy_73-macosx_10_9_x86_64.whl", hash = "sha256:cf5d689ba9513b9753959164cf500079383bc18859f58bf8ce06d8d4bef2b054"}, + {file = "pyzmq-19.0.1-pp36-pypy36_pp73-macosx_10_9_x86_64.whl", hash = "sha256:aaa8b40b676576fd7806839a5de8e6d5d1b74981e6376d862af6c117af2a3c10"}, + {file = "pyzmq-19.0.1.tar.gz", hash = "sha256:13a5638ab24d628a6ade8f794195e1a1acd573496c3b85af2f1183603b7bf5e0"}, +] +regex = [ + {file = "regex-2020.11.13-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:8b882a78c320478b12ff024e81dc7d43c1462aa4a3341c754ee65d857a521f85"}, + {file = "regex-2020.11.13-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:a63f1a07932c9686d2d416fb295ec2c01ab246e89b4d58e5fa468089cab44b70"}, + {file = "regex-2020.11.13-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:6e4b08c6f8daca7d8f07c8d24e4331ae7953333dbd09c648ed6ebd24db5a10ee"}, + {file = "regex-2020.11.13-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:bba349276b126947b014e50ab3316c027cac1495992f10e5682dc677b3dfa0c5"}, + {file = "regex-2020.11.13-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:56e01daca75eae420bce184edd8bb341c8eebb19dd3bce7266332258f9fb9dd7"}, + {file = "regex-2020.11.13-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:6a8ce43923c518c24a2579fda49f093f1397dad5d18346211e46f134fc624e31"}, + {file = "regex-2020.11.13-cp36-cp36m-manylinux2014_i686.whl", hash = "sha256:1ab79fcb02b930de09c76d024d279686ec5d532eb814fd0ed1e0051eb8bd2daa"}, + {file = "regex-2020.11.13-cp36-cp36m-manylinux2014_x86_64.whl", hash = "sha256:9801c4c1d9ae6a70aeb2128e5b4b68c45d4f0af0d1535500884d644fa9b768c6"}, + {file = "regex-2020.11.13-cp36-cp36m-win32.whl", hash = "sha256:49cae022fa13f09be91b2c880e58e14b6da5d10639ed45ca69b85faf039f7a4e"}, + {file = "regex-2020.11.13-cp36-cp36m-win_amd64.whl", hash = "sha256:749078d1eb89484db5f34b4012092ad14b327944ee7f1c4f74d6279a6e4d1884"}, + {file = "regex-2020.11.13-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b2f4007bff007c96a173e24dcda236e5e83bde4358a557f9ccf5e014439eae4b"}, + {file = "regex-2020.11.13-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:38c8fd190db64f513fe4e1baa59fed086ae71fa45083b6936b52d34df8f86a88"}, + {file = "regex-2020.11.13-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:5862975b45d451b6db51c2e654990c1820523a5b07100fc6903e9c86575202a0"}, + {file = "regex-2020.11.13-cp37-cp37m-manylinux2010_i686.whl", hash = "sha256:262c6825b309e6485ec2493ffc7e62a13cf13fb2a8b6d212f72bd53ad34118f1"}, + {file = "regex-2020.11.13-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:bafb01b4688833e099d79e7efd23f99172f501a15c44f21ea2118681473fdba0"}, + {file = "regex-2020.11.13-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:e32f5f3d1b1c663af7f9c4c1e72e6ffe9a78c03a31e149259f531e0fed826512"}, + {file = "regex-2020.11.13-cp37-cp37m-manylinux2014_i686.whl", hash = "sha256:3bddc701bdd1efa0d5264d2649588cbfda549b2899dc8d50417e47a82e1387ba"}, + {file = "regex-2020.11.13-cp37-cp37m-manylinux2014_x86_64.whl", hash = "sha256:02951b7dacb123d8ea6da44fe45ddd084aa6777d4b2454fa0da61d569c6fa538"}, + {file = "regex-2020.11.13-cp37-cp37m-win32.whl", hash = "sha256:0d08e71e70c0237883d0bef12cad5145b84c3705e9c6a588b2a9c7080e5af2a4"}, + {file = "regex-2020.11.13-cp37-cp37m-win_amd64.whl", hash = "sha256:1fa7ee9c2a0e30405e21031d07d7ba8617bc590d391adfc2b7f1e8b99f46f444"}, + {file = "regex-2020.11.13-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:baf378ba6151f6e272824b86a774326f692bc2ef4cc5ce8d5bc76e38c813a55f"}, + {file = "regex-2020.11.13-cp38-cp38-manylinux1_i686.whl", hash = "sha256:e3faaf10a0d1e8e23a9b51d1900b72e1635c2d5b0e1bea1c18022486a8e2e52d"}, + {file = "regex-2020.11.13-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:2a11a3e90bd9901d70a5b31d7dd85114755a581a5da3fc996abfefa48aee78af"}, + {file = "regex-2020.11.13-cp38-cp38-manylinux2010_i686.whl", hash = "sha256:d1ebb090a426db66dd80df8ca85adc4abfcbad8a7c2e9a5ec7513ede522e0a8f"}, + {file = "regex-2020.11.13-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:b2b1a5ddae3677d89b686e5c625fc5547c6e492bd755b520de5332773a8af06b"}, + {file = "regex-2020.11.13-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:2c99e97d388cd0a8d30f7c514d67887d8021541b875baf09791a3baad48bb4f8"}, + {file = "regex-2020.11.13-cp38-cp38-manylinux2014_i686.whl", hash = "sha256:c084582d4215593f2f1d28b65d2a2f3aceff8342aa85afd7be23a9cad74a0de5"}, + {file = "regex-2020.11.13-cp38-cp38-manylinux2014_x86_64.whl", hash = "sha256:a3d748383762e56337c39ab35c6ed4deb88df5326f97a38946ddd19028ecce6b"}, + {file = "regex-2020.11.13-cp38-cp38-win32.whl", hash = "sha256:7913bd25f4ab274ba37bc97ad0e21c31004224ccb02765ad984eef43e04acc6c"}, + {file = "regex-2020.11.13-cp38-cp38-win_amd64.whl", hash = "sha256:6c54ce4b5d61a7129bad5c5dc279e222afd00e721bf92f9ef09e4fae28755683"}, + {file = "regex-2020.11.13-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:1862a9d9194fae76a7aaf0150d5f2a8ec1da89e8b55890b1786b8f88a0f619dc"}, + {file = "regex-2020.11.13-cp39-cp39-manylinux1_i686.whl", hash = "sha256:4902e6aa086cbb224241adbc2f06235927d5cdacffb2425c73e6570e8d862364"}, + {file = "regex-2020.11.13-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:7a25fcbeae08f96a754b45bdc050e1fb94b95cab046bf56b016c25e9ab127b3e"}, + {file = "regex-2020.11.13-cp39-cp39-manylinux2010_i686.whl", hash = "sha256:d2d8ce12b7c12c87e41123997ebaf1a5767a5be3ec545f64675388970f415e2e"}, + {file = "regex-2020.11.13-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:f7d29a6fc4760300f86ae329e3b6ca28ea9c20823df123a2ea8693e967b29917"}, + {file = "regex-2020.11.13-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:717881211f46de3ab130b58ec0908267961fadc06e44f974466d1887f865bd5b"}, + {file = "regex-2020.11.13-cp39-cp39-manylinux2014_i686.whl", hash = "sha256:3128e30d83f2e70b0bed9b2a34e92707d0877e460b402faca908c6667092ada9"}, + {file = "regex-2020.11.13-cp39-cp39-manylinux2014_x86_64.whl", hash = "sha256:8f6a2229e8ad946e36815f2a03386bb8353d4bde368fdf8ca5f0cb97264d3b5c"}, + {file = "regex-2020.11.13-cp39-cp39-win32.whl", hash = "sha256:f8f295db00ef5f8bae530fc39af0b40486ca6068733fb860b42115052206466f"}, + {file = "regex-2020.11.13-cp39-cp39-win_amd64.whl", hash = "sha256:a15f64ae3a027b64496a71ab1f722355e570c3fac5ba2801cafce846bf5af01d"}, + {file = "regex-2020.11.13.tar.gz", hash = "sha256:83d6b356e116ca119db8e7c6fc2983289d87b27b3fac238cfe5dca529d884562"}, +] +send2trash = [ + {file = "Send2Trash-1.5.0-py3-none-any.whl", hash = "sha256:f1691922577b6fa12821234aeb57599d887c4900b9ca537948d2dac34aea888b"}, + {file = "Send2Trash-1.5.0.tar.gz", hash = "sha256:60001cc07d707fe247c94f74ca6ac0d3255aabcb930529690897ca2a39db28b2"}, +] +six = [ + {file = "six-1.15.0-py2.py3-none-any.whl", hash = "sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced"}, + {file = "six-1.15.0.tar.gz", hash = "sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259"}, +] +terminado = [ + {file = "terminado-0.8.3-py2.py3-none-any.whl", hash = "sha256:a43dcb3e353bc680dd0783b1d9c3fc28d529f190bc54ba9a229f72fe6e7a54d7"}, + {file = "terminado-0.8.3.tar.gz", hash = "sha256:4804a774f802306a7d9af7322193c5390f1da0abb429e082a10ef1d46e6fb2c2"}, +] +testpath = [ + {file = "testpath-0.4.4-py2.py3-none-any.whl", hash = "sha256:bfcf9411ef4bf3db7579063e0546938b1edda3d69f4e1fb8756991f5951f85d4"}, + {file = "testpath-0.4.4.tar.gz", hash = "sha256:60e0a3261c149755f4399a1fff7d37523179a70fdc3abdf78de9fc2604aeec7e"}, +] +toml = [ + {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"}, + {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, +] +tornado = [ + {file = "tornado-6.0.4-cp35-cp35m-win32.whl", hash = "sha256:5217e601700f24e966ddab689f90b7ea4bd91ff3357c3600fa1045e26d68e55d"}, + {file = "tornado-6.0.4-cp35-cp35m-win_amd64.whl", hash = "sha256:c98232a3ac391f5faea6821b53db8db461157baa788f5d6222a193e9456e1740"}, + {file = "tornado-6.0.4-cp36-cp36m-win32.whl", hash = "sha256:5f6a07e62e799be5d2330e68d808c8ac41d4a259b9cea61da4101b83cb5dc673"}, + {file = "tornado-6.0.4-cp36-cp36m-win_amd64.whl", hash = "sha256:c952975c8ba74f546ae6de2e226ab3cc3cc11ae47baf607459a6728585bb542a"}, + {file = "tornado-6.0.4-cp37-cp37m-win32.whl", hash = "sha256:2c027eb2a393d964b22b5c154d1a23a5f8727db6fda837118a776b29e2b8ebc6"}, + {file = "tornado-6.0.4-cp37-cp37m-win_amd64.whl", hash = "sha256:5618f72e947533832cbc3dec54e1dffc1747a5cb17d1fd91577ed14fa0dc081b"}, + {file = "tornado-6.0.4-cp38-cp38-win32.whl", hash = "sha256:22aed82c2ea340c3771e3babc5ef220272f6fd06b5108a53b4976d0d722bcd52"}, + {file = "tornado-6.0.4-cp38-cp38-win_amd64.whl", hash = "sha256:c58d56003daf1b616336781b26d184023ea4af13ae143d9dda65e31e534940b9"}, + {file = "tornado-6.0.4.tar.gz", hash = "sha256:0fe2d45ba43b00a41cd73f8be321a44936dc1aba233dee979f17a042b83eb6dc"}, +] +traitlets = [ + {file = "traitlets-4.3.3-py2.py3-none-any.whl", hash = "sha256:70b4c6a1d9019d7b4f6846832288f86998aa3b9207c6821f3578a6a6a467fe44"}, + {file = "traitlets-4.3.3.tar.gz", hash = "sha256:d023ee369ddd2763310e4c3eae1ff649689440d4ae59d7485eb4cfbbe3e359f7"}, +] +typed-ast = [ + {file = "typed_ast-1.4.1-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:73d785a950fc82dd2a25897d525d003f6378d1cb23ab305578394694202a58c3"}, + {file = "typed_ast-1.4.1-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:aaee9905aee35ba5905cfb3c62f3e83b3bec7b39413f0a7f19be4e547ea01ebb"}, + {file = "typed_ast-1.4.1-cp35-cp35m-win32.whl", hash = "sha256:0c2c07682d61a629b68433afb159376e24e5b2fd4641d35424e462169c0a7919"}, + {file = "typed_ast-1.4.1-cp35-cp35m-win_amd64.whl", hash = "sha256:4083861b0aa07990b619bd7ddc365eb7fa4b817e99cf5f8d9cf21a42780f6e01"}, + {file = "typed_ast-1.4.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:269151951236b0f9a6f04015a9004084a5ab0d5f19b57de779f908621e7d8b75"}, + {file = "typed_ast-1.4.1-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:24995c843eb0ad11a4527b026b4dde3da70e1f2d8806c99b7b4a7cf491612652"}, + {file = "typed_ast-1.4.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:fe460b922ec15dd205595c9b5b99e2f056fd98ae8f9f56b888e7a17dc2b757e7"}, + {file = "typed_ast-1.4.1-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:fcf135e17cc74dbfbc05894ebca928ffeb23d9790b3167a674921db19082401f"}, + {file = "typed_ast-1.4.1-cp36-cp36m-win32.whl", hash = "sha256:4e3e5da80ccbebfff202a67bf900d081906c358ccc3d5e3c8aea42fdfdfd51c1"}, + {file = "typed_ast-1.4.1-cp36-cp36m-win_amd64.whl", hash = "sha256:249862707802d40f7f29f6e1aad8d84b5aa9e44552d2cc17384b209f091276aa"}, + {file = "typed_ast-1.4.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:8ce678dbaf790dbdb3eba24056d5364fb45944f33553dd5869b7580cdbb83614"}, + {file = "typed_ast-1.4.1-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:c9e348e02e4d2b4a8b2eedb48210430658df6951fa484e59de33ff773fbd4b41"}, + {file = "typed_ast-1.4.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:bcd3b13b56ea479b3650b82cabd6b5343a625b0ced5429e4ccad28a8973f301b"}, + {file = "typed_ast-1.4.1-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:f208eb7aff048f6bea9586e61af041ddf7f9ade7caed625742af423f6bae3298"}, + {file = "typed_ast-1.4.1-cp37-cp37m-win32.whl", hash = "sha256:d5d33e9e7af3b34a40dc05f498939f0ebf187f07c385fd58d591c533ad8562fe"}, + {file = "typed_ast-1.4.1-cp37-cp37m-win_amd64.whl", hash = "sha256:0666aa36131496aed8f7be0410ff974562ab7eeac11ef351def9ea6fa28f6355"}, + {file = "typed_ast-1.4.1-cp38-cp38-macosx_10_15_x86_64.whl", hash = "sha256:d205b1b46085271b4e15f670058ce182bd1199e56b317bf2ec004b6a44f911f6"}, + {file = "typed_ast-1.4.1-cp38-cp38-manylinux1_i686.whl", hash = "sha256:6daac9731f172c2a22ade6ed0c00197ee7cc1221aa84cfdf9c31defeb059a907"}, + {file = "typed_ast-1.4.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:498b0f36cc7054c1fead3d7fc59d2150f4d5c6c56ba7fb150c013fbc683a8d2d"}, + {file = "typed_ast-1.4.1-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:7e4c9d7658aaa1fc80018593abdf8598bf91325af6af5cce4ce7c73bc45ea53d"}, + {file = "typed_ast-1.4.1-cp38-cp38-win32.whl", hash = "sha256:715ff2f2df46121071622063fc7543d9b1fd19ebfc4f5c8895af64a77a8c852c"}, + {file = "typed_ast-1.4.1-cp38-cp38-win_amd64.whl", hash = "sha256:fc0fea399acb12edbf8a628ba8d2312f583bdbdb3335635db062fa98cf71fca4"}, + {file = "typed_ast-1.4.1-cp39-cp39-macosx_10_15_x86_64.whl", hash = "sha256:d43943ef777f9a1c42bf4e552ba23ac77a6351de620aa9acf64ad54933ad4d34"}, + {file = "typed_ast-1.4.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:92c325624e304ebf0e025d1224b77dd4e6393f18aab8d829b5b7e04afe9b7a2c"}, + {file = "typed_ast-1.4.1-cp39-cp39-manylinux1_i686.whl", hash = "sha256:d648b8e3bf2fe648745c8ffcee3db3ff903d0817a01a12dd6a6ea7a8f4889072"}, + {file = "typed_ast-1.4.1-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:fac11badff8313e23717f3dada86a15389d0708275bddf766cca67a84ead3e91"}, + {file = "typed_ast-1.4.1-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:0d8110d78a5736e16e26213114a38ca35cb15b6515d535413b090bd50951556d"}, + {file = "typed_ast-1.4.1-cp39-cp39-win32.whl", hash = "sha256:b52ccf7cfe4ce2a1064b18594381bccf4179c2ecf7f513134ec2f993dd4ab395"}, + {file = "typed_ast-1.4.1-cp39-cp39-win_amd64.whl", hash = "sha256:3742b32cf1c6ef124d57f95be609c473d7ec4c14d0090e5a5e05a15269fb4d0c"}, + {file = "typed_ast-1.4.1.tar.gz", hash = "sha256:8c8aaad94455178e3187ab22c8b01a3837f8ee50e09cf31f1ba129eb293ec30b"}, +] +typing-extensions = [ + {file = "typing_extensions-3.7.4.3-py2-none-any.whl", hash = "sha256:dafc7639cde7f1b6e1acc0f457842a83e722ccca8eef5270af2d74792619a89f"}, + {file = "typing_extensions-3.7.4.3-py3-none-any.whl", hash = "sha256:7cb407020f00f7bfc3cb3e7881628838e69d8f3fcab2f64742a5e76b2f841918"}, + {file = "typing_extensions-3.7.4.3.tar.gz", hash = "sha256:99d4073b617d30288f569d3f13d2bd7548c3a7e4c8de87db09a9d29bb3a4a60c"}, +] +wcwidth = [ + {file = "wcwidth-0.2.5-py2.py3-none-any.whl", hash = "sha256:beb4802a9cebb9144e99086eff703a642a13d6a0052920003a230f3294bbe784"}, + {file = "wcwidth-0.2.5.tar.gz", hash = "sha256:c4d647b99872929fdb7bdcaa4fbe7f01413ed3d98077df798530e5b04f116c83"}, +] +webencodings = [ + {file = "webencodings-0.5.1-py2.py3-none-any.whl", hash = "sha256:a0af1213f3c2226497a97e2b3aa01a7e4bee4f403f95be16fc9acd2947514a78"}, + {file = "webencodings-0.5.1.tar.gz", hash = "sha256:b36a1c245f2d304965eb4e0a82848379241dc04b865afcc4aab16748587e1923"}, +] +widgetsnbextension = [ + {file = "widgetsnbextension-3.5.1-py2.py3-none-any.whl", hash = "sha256:bd314f8ceb488571a5ffea6cc5b9fc6cba0adaf88a9d2386b93a489751938bcd"}, + {file = "widgetsnbextension-3.5.1.tar.gz", hash = "sha256:079f87d87270bce047512400efd70238820751a11d2d8cb137a5a5bdbaf255c7"}, +] +zipp = [ + {file = "zipp-3.1.0-py3-none-any.whl", hash = "sha256:aa36550ff0c0b7ef7fa639055d797116ee891440eac1a56f378e2d3179e0320b"}, + {file = "zipp-3.1.0.tar.gz", hash = "sha256:c599e4d75c98f6798c509911d08a22e6c021d074469042177c8c86fb92eefd96"}, +] diff --git a/testbed/Textualize__rich/pyproject.toml b/testbed/Textualize__rich/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..f5ede46fb6d122fd033a3ee87aa7434c8cdfffea --- /dev/null +++ b/testbed/Textualize__rich/pyproject.toml @@ -0,0 +1,46 @@ +[tool.poetry] +name = "rich" +homepage = "https://github.com/willmcgugan/rich" +documentation = "https://rich.readthedocs.io/en/latest/" +version = "9.7.0" +description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal" +authors = ["Will McGugan "] +license = "MIT" +readme = "README.md" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Console", + "Intended Audience :: Developers", + "Operating System :: Microsoft :: Windows", + "Operating System :: MacOS", + "Operating System :: POSIX :: Linux", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", +] +include = ["rich/py.typed"] + + +[tool.poetry.dependencies] +python = "^3.6" +typing-extensions = "^3.7.4" +dataclasses = {version=">=0.7,<0.9", python = "~3.6"} +pygments = "^2.6.0" +commonmark = "^0.9.0" +colorama = "^0.4.0" +ipywidgets = {version = "^7.5.1", optional = true} + + +[tool.poetry.extras] +jupyter = ["ipywidgets"] + +[tool.poetry.dev-dependencies] +pytest = "^6.2.1" +black = "^20.8b1" +mypy = "^0.790" +pytest-cov = "^2.10.1" + +[build-system] +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api" diff --git a/testbed/Textualize__rich/rich/__init__.py b/testbed/Textualize__rich/rich/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..98e3b3d594d3c3c1c77e4b8b4d60dc4b3d6e609e --- /dev/null +++ b/testbed/Textualize__rich/rich/__init__.py @@ -0,0 +1,117 @@ +"""Rich text and beautiful formatting in the terminal.""" + +from typing import Any, IO, Optional, TYPE_CHECKING + +__all__ = ["get_console", "reconfigure", "print", "inspect"] + +if TYPE_CHECKING: + from .console import Console + +# Global console used by alternative print +_console: Optional["Console"] = None + + +def get_console() -> "Console": + """Get a global :class:`~rich.console.Console` instance. This function is used when Rich requires a Console, + and hasn't been explicitly given one. + + Returns: + Console: A console instance. + """ + global _console + if _console is None: + from .console import Console + + _console = Console() + + return _console + + +def reconfigure(*args, **kwargs) -> None: + """Reconfigures the global console bu replacing it with another. + + Args: + console (Console): Replacement console instance. + """ + from rich.console import Console + + new_console = Console(*args, **kwargs) + _console.__dict__ = new_console.__dict__ + + +def print(*objects: Any, sep=" ", end="\n", file: IO[str] = None, flush: bool = False): + r"""Print object(s) supplied via positional arguments. + This function has an identical signature to the built-in print. + For more advanced features, see the :class:`~rich.console.Console` class. + + Args: + sep (str, optional): Separator between printed objects. Defaults to " ". + end (str, optional): Character to write at end of output. Defaults to "\\n". + file (IO[str], optional): File to write to, or None for stdout. Defaults to None. + flush (bool, optional): Has no effect as Rich always flushes output. Defaults to False. + + """ + from .console import Console + + write_console = get_console() if file is None else Console(file=file) + return write_console.print(*objects, sep=sep, end=end) + + +def inspect( + obj: Any, + *, + console: "Console" = None, + title: str = None, + help: bool = False, + methods: bool = False, + docs: bool = True, + private: bool = False, + dunder: bool = False, + sort: bool = True, + all: bool = False, + value: bool = True +): + """Inspect any Python object. + + * inspect() to see summarized info. + * inspect(, methods=True) to see methods. + * inspect(, help=True) to see full (non-abbreviated) help. + * inspect(, private=True) to see private attributes (single underscore). + * inspect(, dunder=True) to see attributes beginning with double underscore. + * inspect(, all=True) to see all attributes. + + Args: + obj (Any): An object to inspect. + title (str, optional): Title to display over inspect result, or None use type. Defaults to None. + help (bool, optional): Show full help text rather than just first paragraph. Defaults to False. + methods (bool, optional): Enable inspection of callables. Defaults to False. + docs (bool, optional): Also render doc strings. Defaults to True. + private (bool, optional): Show private attributes (beginning with underscore). Defaults to False. + dunder (bool, optional): Show attributes starting with double underscore. Defaults to False. + sort (bool, optional): Sort attributes alphabetically. Defaults to True. + all (bool, optional): Show all attributes. Defaults to False. + value (bool, optional): Pretty print value. Defaults to True. + """ + _console = console or get_console() + from rich._inspect import Inspect + + # Special case for inspect(inspect) + is_inspect = obj is inspect + + _inspect = Inspect( + obj, + title=title, + help=is_inspect or help, + methods=is_inspect or methods, + docs=is_inspect or docs, + private=private, + dunder=dunder, + sort=sort, + all=all, + value=value, + ) + _console.print(_inspect) + + +if __name__ == "__main__": # pragma: no cover + print("Hello, **World**") diff --git a/testbed/Textualize__rich/rich/__main__.py b/testbed/Textualize__rich/rich/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..6313b1955504d81669dd421880d35040742c8f1e --- /dev/null +++ b/testbed/Textualize__rich/rich/__main__.py @@ -0,0 +1,229 @@ +import colorsys +import io +from time import process_time + +from rich import box +from rich.color import Color +from rich.console import Console, ConsoleOptions, RenderGroup, RenderResult +from rich.markdown import Markdown +from rich.measure import Measurement +from rich.pretty import Pretty +from rich.segment import Segment +from rich.style import Style +from rich.syntax import Syntax +from rich.table import Table +from rich.text import Text + + +class ColorBox: + def __rich_console__( + self, console: Console, options: ConsoleOptions + ) -> RenderResult: + for y in range(0, 5): + for x in range(options.max_width): + h = x / options.max_width + l = 0.1 + ((y / 5) * 0.7) + r1, g1, b1 = colorsys.hls_to_rgb(h, l, 1.0) + r2, g2, b2 = colorsys.hls_to_rgb(h, l + 0.7 / 10, 1.0) + bgcolor = Color.from_rgb(r1 * 255, g1 * 255, b1 * 255) + color = Color.from_rgb(r2 * 255, g2 * 255, b2 * 255) + yield Segment("▄", Style(color=color, bgcolor=bgcolor)) + yield Segment.line() + + def __rich_measure__(self, console: "Console", max_width: int) -> Measurement: + return Measurement(1, max_width) + + +def make_test_card() -> Table: + """Get a renderable that demonstrates a number of features.""" + table = Table.grid(padding=1, pad_edge=True) + table.title = "Rich features" + table.add_column("Feature", no_wrap=True, justify="center", style="bold red") + table.add_column("Demonstration") + + color_table = Table( + box=None, + expand=False, + show_header=False, + show_edge=False, + pad_edge=False, + ) + color_table.add_row( + # "[bold yellow]256[/] colors or [bold green]16.7 million[/] colors [blue](if supported by your terminal)[/].", + ( + "✓ [bold green]4-bit color[/]\n" + "✓ [bold blue]8-bit color[/]\n" + "✓ [bold magenta]Truecolor (16.7 million)[/]\n" + "✓ [bold yellow]Dumb terminals[/]\n" + "✓ [bold cyan]Automatic color conversion" + ), + ColorBox(), + ) + + table.add_row("Colors", color_table) + + table.add_row( + "Styles", + "All ansi styles: [bold]bold[/], [dim]dim[/], [italic]italic[/italic], [underline]underline[/], [strike]strikethrough[/], [reverse]reverse[/], and even [blink]blink[/].", + ) + + lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque in metus sed sapien ultricies pretium a at justo. Maecenas luctus velit et auctor maximus." + lorem_table = Table.grid(padding=1, collapse_padding=True) + lorem_table.pad_edge = False + lorem_table.add_row( + Text(lorem, justify="left", style="green"), + Text(lorem, justify="center", style="yellow"), + Text(lorem, justify="right", style="blue"), + Text(lorem, justify="full", style="red"), + ) + table.add_row( + "Text", + RenderGroup( + Text.from_markup( + """Word wrap text. Justify [green]left[/], [yellow]center[/], [blue]right[/] or [red]full[/].\n""" + ), + lorem_table, + ), + ) + + def comparison(renderable1, renderable2) -> Table: + table = Table(show_header=False, pad_edge=False, box=None, expand=True) + table.add_column("1", ratio=1) + table.add_column("2", ratio=1) + table.add_row(renderable1, renderable2) + return table + + table.add_row( + "Asian\nlanguage\nsupport", + ":flag_for_china: 该库支持中文,日文和韩文文本!\n:flag_for_japan: ライブラリは中国語、日本語、韓国語のテキストをサポートしています\n:flag_for_south_korea: 이 라이브러리는 중국어, 일본어 및 한국어 텍스트를 지원합니다", + ) + + markup_example = ( + "[bold magenta]Rich[/] supports a simple [i]bbcode[/i] like [b]markup[/b] for [yellow]color[/], [underline]style[/], and emoji! " + ":+1: :apple: :ant: :bear: :baguette_bread: :bus: " + ) + table.add_row("Markup", markup_example) + + example_table = Table( + show_edge=False, + show_header=True, + expand=False, + row_styles=["none", "dim"], + box=box.SIMPLE, + ) + example_table.add_column("[green]Date", style="green", no_wrap=True) + example_table.add_column("[blue]Title", style="blue") + example_table.add_column( + "[cyan]Production Budget", + style="cyan", + justify="right", + no_wrap=True, + ) + example_table.add_column( + "[magenta]Box Office", + style="magenta", + justify="right", + no_wrap=True, + ) + example_table.add_row( + "Dec 20, 2019", + "Star Wars: The Rise of Skywalker", + "$275,000,000", + "$375,126,118", + ) + example_table.add_row( + "May 25, 2018", + "[b]Solo[/]: A Star Wars Story", + "$275,000,000", + "$393,151,347", + ) + example_table.add_row( + "Dec 15, 2017", + "Star Wars Ep. VIII: The Last Jedi", + "$262,000,000", + "[bold]$1,332,539,889[/bold]", + ) + example_table.add_row( + "May 19, 1999", + "Star Wars Ep. [b]I[/b]: [i]The phantom Menace", + "$115,000,000", + "$1,027,044,677", + ) + + table.add_row("Tables", example_table) + + code = '''\ +def iter_last(values: Iterable[T]) -> Iterable[Tuple[bool, T]]: + """Iterate and generate a tuple with a flag for last value.""" + iter_values = iter(values) + try: + previous_value = next(iter_values) + except StopIteration: + return + for value in iter_values: + yield False, previous_value + previous_value = value + yield True, previous_value''' + + pretty_data = { + "foo": [ + 3.1427, + ( + "Paul Atriedies", + "Vladimir Harkonnen", + "Thufir Haway", + ), + ], + "atomic": (False, True, None), + } + table.add_row( + "Syntax\nhighlighting\n&\npretty\nprinting", + comparison( + Syntax(code, "python3", line_numbers=True, indent_guides=True), + Pretty(pretty_data, indent_guides=True), + ), + ) + + markdown_example = """\ +# Markdown + +Supports much of the *markdown*, __syntax__! + +- Headers +- Basic formatting: **bold**, *italic*, `code` +- Block quotes +- Lists, and more... + """ + table.add_row( + "Markdown", comparison("[cyan]" + markdown_example, Markdown(markdown_example)) + ) + + table.add_row( + "+more!", + """Progress bars, columns, styled logging handler, tracebacks, etc...""", + ) + return table + + +if __name__ == "__main__": # pragma: no cover + + console = Console( + file=io.StringIO(), + force_terminal=True, + ) + test_card = make_test_card() + + # Print once to warm cache + console.print(test_card) + console.file = io.StringIO() + + start = process_time() + console.print(test_card) + taken = round((process_time() - start) * 1000.0, 1) + + text = console.file.getvalue() + # https://bugs.python.org/issue37871 + for line in text.splitlines(): + print(line) + + print(f"rendered in {taken}ms") diff --git a/testbed/Textualize__rich/rich/_cell_widths.py b/testbed/Textualize__rich/rich/_cell_widths.py new file mode 100644 index 0000000000000000000000000000000000000000..36286df379e28ea997bea3ee1fd62cadebebbba9 --- /dev/null +++ b/testbed/Textualize__rich/rich/_cell_widths.py @@ -0,0 +1,451 @@ +# Auto generated by make_terminal_widths.py + +CELL_WIDTHS = [ + (0, 0, 0), + (1, 31, -1), + (127, 159, -1), + (768, 879, 0), + (1155, 1161, 0), + (1425, 1469, 0), + (1471, 1471, 0), + (1473, 1474, 0), + (1476, 1477, 0), + (1479, 1479, 0), + (1552, 1562, 0), + (1611, 1631, 0), + (1648, 1648, 0), + (1750, 1756, 0), + (1759, 1764, 0), + (1767, 1768, 0), + (1770, 1773, 0), + (1809, 1809, 0), + (1840, 1866, 0), + (1958, 1968, 0), + (2027, 2035, 0), + (2045, 2045, 0), + (2070, 2073, 0), + (2075, 2083, 0), + (2085, 2087, 0), + (2089, 2093, 0), + (2137, 2139, 0), + (2259, 2273, 0), + (2275, 2306, 0), + (2362, 2362, 0), + (2364, 2364, 0), + (2369, 2376, 0), + (2381, 2381, 0), + (2385, 2391, 0), + (2402, 2403, 0), + (2433, 2433, 0), + (2492, 2492, 0), + (2497, 2500, 0), + (2509, 2509, 0), + (2530, 2531, 0), + (2558, 2558, 0), + (2561, 2562, 0), + (2620, 2620, 0), + (2625, 2626, 0), + (2631, 2632, 0), + (2635, 2637, 0), + (2641, 2641, 0), + (2672, 2673, 0), + (2677, 2677, 0), + (2689, 2690, 0), + (2748, 2748, 0), + (2753, 2757, 0), + (2759, 2760, 0), + (2765, 2765, 0), + (2786, 2787, 0), + (2810, 2815, 0), + (2817, 2817, 0), + (2876, 2876, 0), + (2879, 2879, 0), + (2881, 2884, 0), + (2893, 2893, 0), + (2901, 2902, 0), + (2914, 2915, 0), + (2946, 2946, 0), + (3008, 3008, 0), + (3021, 3021, 0), + (3072, 3072, 0), + (3076, 3076, 0), + (3134, 3136, 0), + (3142, 3144, 0), + (3146, 3149, 0), + (3157, 3158, 0), + (3170, 3171, 0), + (3201, 3201, 0), + (3260, 3260, 0), + (3263, 3263, 0), + (3270, 3270, 0), + (3276, 3277, 0), + (3298, 3299, 0), + (3328, 3329, 0), + (3387, 3388, 0), + (3393, 3396, 0), + (3405, 3405, 0), + (3426, 3427, 0), + (3457, 3457, 0), + (3530, 3530, 0), + (3538, 3540, 0), + (3542, 3542, 0), + (3633, 3633, 0), + (3636, 3642, 0), + (3655, 3662, 0), + (3761, 3761, 0), + (3764, 3772, 0), + (3784, 3789, 0), + (3864, 3865, 0), + (3893, 3893, 0), + (3895, 3895, 0), + (3897, 3897, 0), + (3953, 3966, 0), + (3968, 3972, 0), + (3974, 3975, 0), + (3981, 3991, 0), + (3993, 4028, 0), + (4038, 4038, 0), + (4141, 4144, 0), + (4146, 4151, 0), + (4153, 4154, 0), + (4157, 4158, 0), + (4184, 4185, 0), + (4190, 4192, 0), + (4209, 4212, 0), + (4226, 4226, 0), + (4229, 4230, 0), + (4237, 4237, 0), + (4253, 4253, 0), + (4352, 4447, 2), + (4957, 4959, 0), + (5906, 5908, 0), + (5938, 5940, 0), + (5970, 5971, 0), + (6002, 6003, 0), + (6068, 6069, 0), + (6071, 6077, 0), + (6086, 6086, 0), + (6089, 6099, 0), + (6109, 6109, 0), + (6155, 6157, 0), + (6277, 6278, 0), + (6313, 6313, 0), + (6432, 6434, 0), + (6439, 6440, 0), + (6450, 6450, 0), + (6457, 6459, 0), + (6679, 6680, 0), + (6683, 6683, 0), + (6742, 6742, 0), + (6744, 6750, 0), + (6752, 6752, 0), + (6754, 6754, 0), + (6757, 6764, 0), + (6771, 6780, 0), + (6783, 6783, 0), + (6832, 6848, 0), + (6912, 6915, 0), + (6964, 6964, 0), + (6966, 6970, 0), + (6972, 6972, 0), + (6978, 6978, 0), + (7019, 7027, 0), + (7040, 7041, 0), + (7074, 7077, 0), + (7080, 7081, 0), + (7083, 7085, 0), + (7142, 7142, 0), + (7144, 7145, 0), + (7149, 7149, 0), + (7151, 7153, 0), + (7212, 7219, 0), + (7222, 7223, 0), + (7376, 7378, 0), + (7380, 7392, 0), + (7394, 7400, 0), + (7405, 7405, 0), + (7412, 7412, 0), + (7416, 7417, 0), + (7616, 7673, 0), + (7675, 7679, 0), + (8203, 8207, 0), + (8232, 8238, 0), + (8288, 8291, 0), + (8400, 8432, 0), + (8986, 8987, 2), + (9001, 9002, 2), + (9193, 9196, 2), + (9200, 9200, 2), + (9203, 9203, 2), + (9725, 9726, 2), + (9748, 9749, 2), + (9800, 9811, 2), + (9855, 9855, 2), + (9875, 9875, 2), + (9889, 9889, 2), + (9898, 9899, 2), + (9917, 9918, 2), + (9924, 9925, 2), + (9934, 9934, 2), + (9940, 9940, 2), + (9962, 9962, 2), + (9970, 9971, 2), + (9973, 9973, 2), + (9978, 9978, 2), + (9981, 9981, 2), + (9989, 9989, 2), + (9994, 9995, 2), + (10024, 10024, 2), + (10060, 10060, 2), + (10062, 10062, 2), + (10067, 10069, 2), + (10071, 10071, 2), + (10133, 10135, 2), + (10160, 10160, 2), + (10175, 10175, 2), + (11035, 11036, 2), + (11088, 11088, 2), + (11093, 11093, 2), + (11503, 11505, 0), + (11647, 11647, 0), + (11744, 11775, 0), + (11904, 11929, 2), + (11931, 12019, 2), + (12032, 12245, 2), + (12272, 12283, 2), + (12288, 12329, 2), + (12330, 12333, 0), + (12334, 12350, 2), + (12353, 12438, 2), + (12441, 12442, 0), + (12443, 12543, 2), + (12549, 12591, 2), + (12593, 12686, 2), + (12688, 12771, 2), + (12784, 12830, 2), + (12832, 12871, 2), + (12880, 19903, 2), + (19968, 42124, 2), + (42128, 42182, 2), + (42607, 42610, 0), + (42612, 42621, 0), + (42654, 42655, 0), + (42736, 42737, 0), + (43010, 43010, 0), + (43014, 43014, 0), + (43019, 43019, 0), + (43045, 43046, 0), + (43052, 43052, 0), + (43204, 43205, 0), + (43232, 43249, 0), + (43263, 43263, 0), + (43302, 43309, 0), + (43335, 43345, 0), + (43360, 43388, 2), + (43392, 43394, 0), + (43443, 43443, 0), + (43446, 43449, 0), + (43452, 43453, 0), + (43493, 43493, 0), + (43561, 43566, 0), + (43569, 43570, 0), + (43573, 43574, 0), + (43587, 43587, 0), + (43596, 43596, 0), + (43644, 43644, 0), + (43696, 43696, 0), + (43698, 43700, 0), + (43703, 43704, 0), + (43710, 43711, 0), + (43713, 43713, 0), + (43756, 43757, 0), + (43766, 43766, 0), + (44005, 44005, 0), + (44008, 44008, 0), + (44013, 44013, 0), + (44032, 55203, 2), + (63744, 64255, 2), + (64286, 64286, 0), + (65024, 65039, 0), + (65040, 65049, 2), + (65056, 65071, 0), + (65072, 65106, 2), + (65108, 65126, 2), + (65128, 65131, 2), + (65281, 65376, 2), + (65504, 65510, 2), + (66045, 66045, 0), + (66272, 66272, 0), + (66422, 66426, 0), + (68097, 68099, 0), + (68101, 68102, 0), + (68108, 68111, 0), + (68152, 68154, 0), + (68159, 68159, 0), + (68325, 68326, 0), + (68900, 68903, 0), + (69291, 69292, 0), + (69446, 69456, 0), + (69633, 69633, 0), + (69688, 69702, 0), + (69759, 69761, 0), + (69811, 69814, 0), + (69817, 69818, 0), + (69888, 69890, 0), + (69927, 69931, 0), + (69933, 69940, 0), + (70003, 70003, 0), + (70016, 70017, 0), + (70070, 70078, 0), + (70089, 70092, 0), + (70095, 70095, 0), + (70191, 70193, 0), + (70196, 70196, 0), + (70198, 70199, 0), + (70206, 70206, 0), + (70367, 70367, 0), + (70371, 70378, 0), + (70400, 70401, 0), + (70459, 70460, 0), + (70464, 70464, 0), + (70502, 70508, 0), + (70512, 70516, 0), + (70712, 70719, 0), + (70722, 70724, 0), + (70726, 70726, 0), + (70750, 70750, 0), + (70835, 70840, 0), + (70842, 70842, 0), + (70847, 70848, 0), + (70850, 70851, 0), + (71090, 71093, 0), + (71100, 71101, 0), + (71103, 71104, 0), + (71132, 71133, 0), + (71219, 71226, 0), + (71229, 71229, 0), + (71231, 71232, 0), + (71339, 71339, 0), + (71341, 71341, 0), + (71344, 71349, 0), + (71351, 71351, 0), + (71453, 71455, 0), + (71458, 71461, 0), + (71463, 71467, 0), + (71727, 71735, 0), + (71737, 71738, 0), + (71995, 71996, 0), + (71998, 71998, 0), + (72003, 72003, 0), + (72148, 72151, 0), + (72154, 72155, 0), + (72160, 72160, 0), + (72193, 72202, 0), + (72243, 72248, 0), + (72251, 72254, 0), + (72263, 72263, 0), + (72273, 72278, 0), + (72281, 72283, 0), + (72330, 72342, 0), + (72344, 72345, 0), + (72752, 72758, 0), + (72760, 72765, 0), + (72767, 72767, 0), + (72850, 72871, 0), + (72874, 72880, 0), + (72882, 72883, 0), + (72885, 72886, 0), + (73009, 73014, 0), + (73018, 73018, 0), + (73020, 73021, 0), + (73023, 73029, 0), + (73031, 73031, 0), + (73104, 73105, 0), + (73109, 73109, 0), + (73111, 73111, 0), + (73459, 73460, 0), + (92912, 92916, 0), + (92976, 92982, 0), + (94031, 94031, 0), + (94095, 94098, 0), + (94176, 94179, 2), + (94180, 94180, 0), + (94192, 94193, 2), + (94208, 100343, 2), + (100352, 101589, 2), + (101632, 101640, 2), + (110592, 110878, 2), + (110928, 110930, 2), + (110948, 110951, 2), + (110960, 111355, 2), + (113821, 113822, 0), + (119143, 119145, 0), + (119163, 119170, 0), + (119173, 119179, 0), + (119210, 119213, 0), + (119362, 119364, 0), + (121344, 121398, 0), + (121403, 121452, 0), + (121461, 121461, 0), + (121476, 121476, 0), + (121499, 121503, 0), + (121505, 121519, 0), + (122880, 122886, 0), + (122888, 122904, 0), + (122907, 122913, 0), + (122915, 122916, 0), + (122918, 122922, 0), + (123184, 123190, 0), + (123628, 123631, 0), + (125136, 125142, 0), + (125252, 125258, 0), + (126980, 126980, 2), + (127183, 127183, 2), + (127374, 127374, 2), + (127377, 127386, 2), + (127488, 127490, 2), + (127504, 127547, 2), + (127552, 127560, 2), + (127568, 127569, 2), + (127584, 127589, 2), + (127744, 127776, 2), + (127789, 127797, 2), + (127799, 127868, 2), + (127870, 127891, 2), + (127904, 127946, 2), + (127951, 127955, 2), + (127968, 127984, 2), + (127988, 127988, 2), + (127992, 128062, 2), + (128064, 128064, 2), + (128066, 128252, 2), + (128255, 128317, 2), + (128331, 128334, 2), + (128336, 128359, 2), + (128378, 128378, 2), + (128405, 128406, 2), + (128420, 128420, 2), + (128507, 128591, 2), + (128640, 128709, 2), + (128716, 128716, 2), + (128720, 128722, 2), + (128725, 128727, 2), + (128747, 128748, 2), + (128756, 128764, 2), + (128992, 129003, 2), + (129292, 129338, 2), + (129340, 129349, 2), + (129351, 129400, 2), + (129402, 129483, 2), + (129485, 129535, 2), + (129648, 129652, 2), + (129656, 129658, 2), + (129664, 129670, 2), + (129680, 129704, 2), + (129712, 129718, 2), + (129728, 129730, 2), + (129744, 129750, 2), + (131072, 196605, 2), + (196608, 262141, 2), + (917760, 917999, 0), +] diff --git a/testbed/Textualize__rich/rich/_emoji_codes.py b/testbed/Textualize__rich/rich/_emoji_codes.py new file mode 100644 index 0000000000000000000000000000000000000000..1f2877bb2bd520253502b1c05bb811bb0d7ef64c --- /dev/null +++ b/testbed/Textualize__rich/rich/_emoji_codes.py @@ -0,0 +1,3610 @@ +EMOJI = { + "1st_place_medal": "🥇", + "2nd_place_medal": "🥈", + "3rd_place_medal": "🥉", + "ab_button_(blood_type)": "🆎", + "atm_sign": "🏧", + "a_button_(blood_type)": "🅰", + "afghanistan": "🇦🇫", + "albania": "🇦🇱", + "algeria": "🇩🇿", + "american_samoa": "🇦🇸", + "andorra": "🇦🇩", + "angola": "🇦🇴", + "anguilla": "🇦🇮", + "antarctica": "🇦🇶", + "antigua_&_barbuda": "🇦🇬", + "aquarius": "♒", + "argentina": "🇦🇷", + "aries": "♈", + "armenia": "🇦🇲", + "aruba": "🇦🇼", + "ascension_island": "🇦🇨", + "australia": "🇦🇺", + "austria": "🇦🇹", + "azerbaijan": "🇦🇿", + "back_arrow": "🔙", + "b_button_(blood_type)": "🅱", + "bahamas": "🇧🇸", + "bahrain": "🇧🇭", + "bangladesh": "🇧🇩", + "barbados": "🇧🇧", + "belarus": "🇧🇾", + "belgium": "🇧🇪", + "belize": "🇧🇿", + "benin": "🇧🇯", + "bermuda": "🇧🇲", + "bhutan": "🇧🇹", + "bolivia": "🇧🇴", + "bosnia_&_herzegovina": "🇧🇦", + "botswana": "🇧🇼", + "bouvet_island": "🇧🇻", + "brazil": "🇧🇷", + "british_indian_ocean_territory": "🇮🇴", + "british_virgin_islands": "🇻🇬", + "brunei": "🇧🇳", + "bulgaria": "🇧🇬", + "burkina_faso": "🇧🇫", + "burundi": "🇧🇮", + "cl_button": "🆑", + "cool_button": "🆒", + "cambodia": "🇰🇭", + "cameroon": "🇨🇲", + "canada": "🇨🇦", + "canary_islands": "🇮🇨", + "cancer": "♋", + "cape_verde": "🇨🇻", + "capricorn": "♑", + "caribbean_netherlands": "🇧🇶", + "cayman_islands": "🇰🇾", + "central_african_republic": "🇨🇫", + "ceuta_&_melilla": "🇪🇦", + "chad": "🇹🇩", + "chile": "🇨🇱", + "china": "🇨🇳", + "christmas_island": "🇨🇽", + "christmas_tree": "🎄", + "clipperton_island": "🇨🇵", + "cocos_(keeling)_islands": "🇨🇨", + "colombia": "🇨🇴", + "comoros": "🇰🇲", + "congo_-_brazzaville": "🇨🇬", + "congo_-_kinshasa": "🇨🇩", + "cook_islands": "🇨🇰", + "costa_rica": "🇨🇷", + "croatia": "🇭🇷", + "cuba": "🇨🇺", + "curaçao": "🇨🇼", + "cyprus": "🇨🇾", + "czechia": "🇨🇿", + "côte_d’ivoire": "🇨🇮", + "denmark": "🇩🇰", + "diego_garcia": "🇩🇬", + "djibouti": "🇩🇯", + "dominica": "🇩🇲", + "dominican_republic": "🇩🇴", + "end_arrow": "🔚", + "ecuador": "🇪🇨", + "egypt": "🇪🇬", + "el_salvador": "🇸🇻", + "england": "🏴\U000e0067\U000e0062\U000e0065\U000e006e\U000e0067\U000e007f", + "equatorial_guinea": "🇬🇶", + "eritrea": "🇪🇷", + "estonia": "🇪🇪", + "ethiopia": "🇪🇹", + "european_union": "🇪🇺", + "free_button": "🆓", + "falkland_islands": "🇫🇰", + "faroe_islands": "🇫🇴", + "fiji": "🇫🇯", + "finland": "🇫🇮", + "france": "🇫🇷", + "french_guiana": "🇬🇫", + "french_polynesia": "🇵🇫", + "french_southern_territories": "🇹🇫", + "gabon": "🇬🇦", + "gambia": "🇬🇲", + "gemini": "♊", + "georgia": "🇬🇪", + "germany": "🇩🇪", + "ghana": "🇬🇭", + "gibraltar": "🇬🇮", + "greece": "🇬🇷", + "greenland": "🇬🇱", + "grenada": "🇬🇩", + "guadeloupe": "🇬🇵", + "guam": "🇬🇺", + "guatemala": "🇬🇹", + "guernsey": "🇬🇬", + "guinea": "🇬🇳", + "guinea-bissau": "🇬🇼", + "guyana": "🇬🇾", + "haiti": "🇭🇹", + "heard_&_mcdonald_islands": "🇭🇲", + "honduras": "🇭🇳", + "hong_kong_sar_china": "🇭🇰", + "hungary": "🇭🇺", + "id_button": "🆔", + "iceland": "🇮🇸", + "india": "🇮🇳", + "indonesia": "🇮🇩", + "iran": "🇮🇷", + "iraq": "🇮🇶", + "ireland": "🇮🇪", + "isle_of_man": "🇮🇲", + "israel": "🇮🇱", + "italy": "🇮🇹", + "jamaica": "🇯🇲", + "japan": "🗾", + "japanese_acceptable_button": "🉑", + "japanese_application_button": "🈸", + "japanese_bargain_button": "🉐", + "japanese_castle": "🏯", + "japanese_congratulations_button": "㊗", + "japanese_discount_button": "🈹", + "japanese_dolls": "🎎", + "japanese_free_of_charge_button": "🈚", + "japanese_here_button": "🈁", + "japanese_monthly_amount_button": "🈷", + "japanese_no_vacancy_button": "🈵", + "japanese_not_free_of_charge_button": "🈶", + "japanese_open_for_business_button": "🈺", + "japanese_passing_grade_button": "🈴", + "japanese_post_office": "🏣", + "japanese_prohibited_button": "🈲", + "japanese_reserved_button": "🈯", + "japanese_secret_button": "㊙", + "japanese_service_charge_button": "🈂", + "japanese_symbol_for_beginner": "🔰", + "japanese_vacancy_button": "🈳", + "jersey": "🇯🇪", + "jordan": "🇯🇴", + "kazakhstan": "🇰🇿", + "kenya": "🇰🇪", + "kiribati": "🇰🇮", + "kosovo": "🇽🇰", + "kuwait": "🇰🇼", + "kyrgyzstan": "🇰🇬", + "laos": "🇱🇦", + "latvia": "🇱🇻", + "lebanon": "🇱🇧", + "leo": "♌", + "lesotho": "🇱🇸", + "liberia": "🇱🇷", + "libra": "♎", + "libya": "🇱🇾", + "liechtenstein": "🇱🇮", + "lithuania": "🇱🇹", + "luxembourg": "🇱🇺", + "macau_sar_china": "🇲🇴", + "macedonia": "🇲🇰", + "madagascar": "🇲🇬", + "malawi": "🇲🇼", + "malaysia": "🇲🇾", + "maldives": "🇲🇻", + "mali": "🇲🇱", + "malta": "🇲🇹", + "marshall_islands": "🇲🇭", + "martinique": "🇲🇶", + "mauritania": "🇲🇷", + "mauritius": "🇲🇺", + "mayotte": "🇾🇹", + "mexico": "🇲🇽", + "micronesia": "🇫🇲", + "moldova": "🇲🇩", + "monaco": "🇲🇨", + "mongolia": "🇲🇳", + "montenegro": "🇲🇪", + "montserrat": "🇲🇸", + "morocco": "🇲🇦", + "mozambique": "🇲🇿", + "mrs._claus": "🤶", + "mrs._claus_dark_skin_tone": "🤶🏿", + "mrs._claus_light_skin_tone": "🤶🏻", + "mrs._claus_medium-dark_skin_tone": "🤶🏾", + "mrs._claus_medium-light_skin_tone": "🤶🏼", + "mrs._claus_medium_skin_tone": "🤶🏽", + "myanmar_(burma)": "🇲🇲", + "new_button": "🆕", + "ng_button": "🆖", + "namibia": "🇳🇦", + "nauru": "🇳🇷", + "nepal": "🇳🇵", + "netherlands": "🇳🇱", + "new_caledonia": "🇳🇨", + "new_zealand": "🇳🇿", + "nicaragua": "🇳🇮", + "niger": "🇳🇪", + "nigeria": "🇳🇬", + "niue": "🇳🇺", + "norfolk_island": "🇳🇫", + "north_korea": "🇰🇵", + "northern_mariana_islands": "🇲🇵", + "norway": "🇳🇴", + "ok_button": "🆗", + "ok_hand": "👌", + "ok_hand_dark_skin_tone": "👌🏿", + "ok_hand_light_skin_tone": "👌🏻", + "ok_hand_medium-dark_skin_tone": "👌🏾", + "ok_hand_medium-light_skin_tone": "👌🏼", + "ok_hand_medium_skin_tone": "👌🏽", + "on!_arrow": "🔛", + "o_button_(blood_type)": "🅾", + "oman": "🇴🇲", + "ophiuchus": "⛎", + "p_button": "🅿", + "pakistan": "🇵🇰", + "palau": "🇵🇼", + "palestinian_territories": "🇵🇸", + "panama": "🇵🇦", + "papua_new_guinea": "🇵🇬", + "paraguay": "🇵🇾", + "peru": "🇵🇪", + "philippines": "🇵🇭", + "pisces": "♓", + "pitcairn_islands": "🇵🇳", + "poland": "🇵🇱", + "portugal": "🇵🇹", + "puerto_rico": "🇵🇷", + "qatar": "🇶🇦", + "romania": "🇷🇴", + "russia": "🇷🇺", + "rwanda": "🇷🇼", + "réunion": "🇷🇪", + "soon_arrow": "🔜", + "sos_button": "🆘", + "sagittarius": "♐", + "samoa": "🇼🇸", + "san_marino": "🇸🇲", + "santa_claus": "🎅", + "santa_claus_dark_skin_tone": "🎅🏿", + "santa_claus_light_skin_tone": "🎅🏻", + "santa_claus_medium-dark_skin_tone": "🎅🏾", + "santa_claus_medium-light_skin_tone": "🎅🏼", + "santa_claus_medium_skin_tone": "🎅🏽", + "saudi_arabia": "🇸🇦", + "scorpio": "♏", + "scotland": "🏴\U000e0067\U000e0062\U000e0073\U000e0063\U000e0074\U000e007f", + "senegal": "🇸🇳", + "serbia": "🇷🇸", + "seychelles": "🇸🇨", + "sierra_leone": "🇸🇱", + "singapore": "🇸🇬", + "sint_maarten": "🇸🇽", + "slovakia": "🇸🇰", + "slovenia": "🇸🇮", + "solomon_islands": "🇸🇧", + "somalia": "🇸🇴", + "south_africa": "🇿🇦", + "south_georgia_&_south_sandwich_islands": "🇬🇸", + "south_korea": "🇰🇷", + "south_sudan": "🇸🇸", + "spain": "🇪🇸", + "sri_lanka": "🇱🇰", + "st._barthélemy": "🇧🇱", + "st._helena": "🇸🇭", + "st._kitts_&_nevis": "🇰🇳", + "st._lucia": "🇱🇨", + "st._martin": "🇲🇫", + "st._pierre_&_miquelon": "🇵🇲", + "st._vincent_&_grenadines": "🇻🇨", + "statue_of_liberty": "🗽", + "sudan": "🇸🇩", + "suriname": "🇸🇷", + "svalbard_&_jan_mayen": "🇸🇯", + "swaziland": "🇸🇿", + "sweden": "🇸🇪", + "switzerland": "🇨🇭", + "syria": "🇸🇾", + "são_tomé_&_príncipe": "🇸🇹", + "t-rex": "🦖", + "top_arrow": "🔝", + "taiwan": "🇹🇼", + "tajikistan": "🇹🇯", + "tanzania": "🇹🇿", + "taurus": "♉", + "thailand": "🇹🇭", + "timor-leste": "🇹🇱", + "togo": "🇹🇬", + "tokelau": "🇹🇰", + "tokyo_tower": "🗼", + "tonga": "🇹🇴", + "trinidad_&_tobago": "🇹🇹", + "tristan_da_cunha": "🇹🇦", + "tunisia": "🇹🇳", + "turkey": "🦃", + "turkmenistan": "🇹🇲", + "turks_&_caicos_islands": "🇹🇨", + "tuvalu": "🇹🇻", + "u.s._outlying_islands": "🇺🇲", + "u.s._virgin_islands": "🇻🇮", + "up!_button": "🆙", + "uganda": "🇺🇬", + "ukraine": "🇺🇦", + "united_arab_emirates": "🇦🇪", + "united_kingdom": "🇬🇧", + "united_nations": "🇺🇳", + "united_states": "🇺🇸", + "uruguay": "🇺🇾", + "uzbekistan": "🇺🇿", + "vs_button": "🆚", + "vanuatu": "🇻🇺", + "vatican_city": "🇻🇦", + "venezuela": "🇻🇪", + "vietnam": "🇻🇳", + "virgo": "♍", + "wales": "🏴\U000e0067\U000e0062\U000e0077\U000e006c\U000e0073\U000e007f", + "wallis_&_futuna": "🇼🇫", + "western_sahara": "🇪🇭", + "yemen": "🇾🇪", + "zambia": "🇿🇲", + "zimbabwe": "🇿🇼", + "abacus": "🧮", + "adhesive_bandage": "🩹", + "admission_tickets": "🎟", + "adult": "🧑", + "adult_dark_skin_tone": "🧑🏿", + "adult_light_skin_tone": "🧑🏻", + "adult_medium-dark_skin_tone": "🧑🏾", + "adult_medium-light_skin_tone": "🧑🏼", + "adult_medium_skin_tone": "🧑🏽", + "aerial_tramway": "🚡", + "airplane": "✈", + "airplane_arrival": "🛬", + "airplane_departure": "🛫", + "alarm_clock": "⏰", + "alembic": "⚗", + "alien": "👽", + "alien_monster": "👾", + "ambulance": "🚑", + "american_football": "🏈", + "amphora": "🏺", + "anchor": "⚓", + "anger_symbol": "💢", + "angry_face": "😠", + "angry_face_with_horns": "👿", + "anguished_face": "😧", + "ant": "🐜", + "antenna_bars": "📶", + "anxious_face_with_sweat": "😰", + "articulated_lorry": "🚛", + "artist_palette": "🎨", + "astonished_face": "😲", + "atom_symbol": "⚛", + "auto_rickshaw": "🛺", + "automobile": "🚗", + "avocado": "🥑", + "axe": "🪓", + "baby": "👶", + "baby_angel": "👼", + "baby_angel_dark_skin_tone": "👼🏿", + "baby_angel_light_skin_tone": "👼🏻", + "baby_angel_medium-dark_skin_tone": "👼🏾", + "baby_angel_medium-light_skin_tone": "👼🏼", + "baby_angel_medium_skin_tone": "👼🏽", + "baby_bottle": "🍼", + "baby_chick": "🐤", + "baby_dark_skin_tone": "👶🏿", + "baby_light_skin_tone": "👶🏻", + "baby_medium-dark_skin_tone": "👶🏾", + "baby_medium-light_skin_tone": "👶🏼", + "baby_medium_skin_tone": "👶🏽", + "baby_symbol": "🚼", + "backhand_index_pointing_down": "👇", + "backhand_index_pointing_down_dark_skin_tone": "👇🏿", + "backhand_index_pointing_down_light_skin_tone": "👇🏻", + "backhand_index_pointing_down_medium-dark_skin_tone": "👇🏾", + "backhand_index_pointing_down_medium-light_skin_tone": "👇🏼", + "backhand_index_pointing_down_medium_skin_tone": "👇🏽", + "backhand_index_pointing_left": "👈", + "backhand_index_pointing_left_dark_skin_tone": "👈🏿", + "backhand_index_pointing_left_light_skin_tone": "👈🏻", + "backhand_index_pointing_left_medium-dark_skin_tone": "👈🏾", + "backhand_index_pointing_left_medium-light_skin_tone": "👈🏼", + "backhand_index_pointing_left_medium_skin_tone": "👈🏽", + "backhand_index_pointing_right": "👉", + "backhand_index_pointing_right_dark_skin_tone": "👉🏿", + "backhand_index_pointing_right_light_skin_tone": "👉🏻", + "backhand_index_pointing_right_medium-dark_skin_tone": "👉🏾", + "backhand_index_pointing_right_medium-light_skin_tone": "👉🏼", + "backhand_index_pointing_right_medium_skin_tone": "👉🏽", + "backhand_index_pointing_up": "👆", + "backhand_index_pointing_up_dark_skin_tone": "👆🏿", + "backhand_index_pointing_up_light_skin_tone": "👆🏻", + "backhand_index_pointing_up_medium-dark_skin_tone": "👆🏾", + "backhand_index_pointing_up_medium-light_skin_tone": "👆🏼", + "backhand_index_pointing_up_medium_skin_tone": "👆🏽", + "bacon": "🥓", + "badger": "🦡", + "badminton": "🏸", + "bagel": "🥯", + "baggage_claim": "🛄", + "baguette_bread": "🥖", + "balance_scale": "⚖", + "bald": "🦲", + "bald_man": "👨\u200d🦲", + "bald_woman": "👩\u200d🦲", + "ballet_shoes": "🩰", + "balloon": "🎈", + "ballot_box_with_ballot": "🗳", + "ballot_box_with_check": "☑", + "banana": "🍌", + "banjo": "🪕", + "bank": "🏦", + "bar_chart": "📊", + "barber_pole": "💈", + "baseball": "⚾", + "basket": "🧺", + "basketball": "🏀", + "bat": "🦇", + "bathtub": "🛁", + "battery": "🔋", + "beach_with_umbrella": "🏖", + "beaming_face_with_smiling_eyes": "😁", + "bear_face": "🐻", + "bearded_person": "🧔", + "bearded_person_dark_skin_tone": "🧔🏿", + "bearded_person_light_skin_tone": "🧔🏻", + "bearded_person_medium-dark_skin_tone": "🧔🏾", + "bearded_person_medium-light_skin_tone": "🧔🏼", + "bearded_person_medium_skin_tone": "🧔🏽", + "beating_heart": "💓", + "bed": "🛏", + "beer_mug": "🍺", + "bell": "🔔", + "bell_with_slash": "🔕", + "bellhop_bell": "🛎", + "bento_box": "🍱", + "beverage_box": "🧃", + "bicycle": "🚲", + "bikini": "👙", + "billed_cap": "🧢", + "biohazard": "☣", + "bird": "🐦", + "birthday_cake": "🎂", + "black_circle": "⚫", + "black_flag": "🏴", + "black_heart": "🖤", + "black_large_square": "⬛", + "black_medium-small_square": "◾", + "black_medium_square": "◼", + "black_nib": "✒", + "black_small_square": "▪", + "black_square_button": "🔲", + "blond-haired_man": "👱\u200d♂️", + "blond-haired_man_dark_skin_tone": "👱🏿\u200d♂️", + "blond-haired_man_light_skin_tone": "👱🏻\u200d♂️", + "blond-haired_man_medium-dark_skin_tone": "👱🏾\u200d♂️", + "blond-haired_man_medium-light_skin_tone": "👱🏼\u200d♂️", + "blond-haired_man_medium_skin_tone": "👱🏽\u200d♂️", + "blond-haired_person": "👱", + "blond-haired_person_dark_skin_tone": "👱🏿", + "blond-haired_person_light_skin_tone": "👱🏻", + "blond-haired_person_medium-dark_skin_tone": "👱🏾", + "blond-haired_person_medium-light_skin_tone": "👱🏼", + "blond-haired_person_medium_skin_tone": "👱🏽", + "blond-haired_woman": "👱\u200d♀️", + "blond-haired_woman_dark_skin_tone": "👱🏿\u200d♀️", + "blond-haired_woman_light_skin_tone": "👱🏻\u200d♀️", + "blond-haired_woman_medium-dark_skin_tone": "👱🏾\u200d♀️", + "blond-haired_woman_medium-light_skin_tone": "👱🏼\u200d♀️", + "blond-haired_woman_medium_skin_tone": "👱🏽\u200d♀️", + "blossom": "🌼", + "blowfish": "🐡", + "blue_book": "📘", + "blue_circle": "🔵", + "blue_heart": "💙", + "blue_square": "🟦", + "boar": "🐗", + "bomb": "💣", + "bone": "🦴", + "bookmark": "🔖", + "bookmark_tabs": "📑", + "books": "📚", + "bottle_with_popping_cork": "🍾", + "bouquet": "💐", + "bow_and_arrow": "🏹", + "bowl_with_spoon": "🥣", + "bowling": "🎳", + "boxing_glove": "🥊", + "boy": "👦", + "boy_dark_skin_tone": "👦🏿", + "boy_light_skin_tone": "👦🏻", + "boy_medium-dark_skin_tone": "👦🏾", + "boy_medium-light_skin_tone": "👦🏼", + "boy_medium_skin_tone": "👦🏽", + "brain": "🧠", + "bread": "🍞", + "breast-feeding": "🤱", + "breast-feeding_dark_skin_tone": "🤱🏿", + "breast-feeding_light_skin_tone": "🤱🏻", + "breast-feeding_medium-dark_skin_tone": "🤱🏾", + "breast-feeding_medium-light_skin_tone": "🤱🏼", + "breast-feeding_medium_skin_tone": "🤱🏽", + "brick": "🧱", + "bride_with_veil": "👰", + "bride_with_veil_dark_skin_tone": "👰🏿", + "bride_with_veil_light_skin_tone": "👰🏻", + "bride_with_veil_medium-dark_skin_tone": "👰🏾", + "bride_with_veil_medium-light_skin_tone": "👰🏼", + "bride_with_veil_medium_skin_tone": "👰🏽", + "bridge_at_night": "🌉", + "briefcase": "💼", + "briefs": "🩲", + "bright_button": "🔆", + "broccoli": "🥦", + "broken_heart": "💔", + "broom": "🧹", + "brown_circle": "🟤", + "brown_heart": "🤎", + "brown_square": "🟫", + "bug": "🐛", + "building_construction": "🏗", + "bullet_train": "🚅", + "burrito": "🌯", + "bus": "🚌", + "bus_stop": "🚏", + "bust_in_silhouette": "👤", + "busts_in_silhouette": "👥", + "butter": "🧈", + "butterfly": "🦋", + "cactus": "🌵", + "calendar": "📆", + "call_me_hand": "🤙", + "call_me_hand_dark_skin_tone": "🤙🏿", + "call_me_hand_light_skin_tone": "🤙🏻", + "call_me_hand_medium-dark_skin_tone": "🤙🏾", + "call_me_hand_medium-light_skin_tone": "🤙🏼", + "call_me_hand_medium_skin_tone": "🤙🏽", + "camel": "🐫", + "camera": "📷", + "camera_with_flash": "📸", + "camping": "🏕", + "candle": "🕯", + "candy": "🍬", + "canned_food": "🥫", + "canoe": "🛶", + "card_file_box": "🗃", + "card_index": "📇", + "card_index_dividers": "🗂", + "carousel_horse": "🎠", + "carp_streamer": "🎏", + "carrot": "🥕", + "castle": "🏰", + "cat": "🐱", + "cat_face": "🐱", + "cat_face_with_tears_of_joy": "😹", + "cat_face_with_wry_smile": "😼", + "chains": "⛓", + "chair": "🪑", + "chart_decreasing": "📉", + "chart_increasing": "📈", + "chart_increasing_with_yen": "💹", + "cheese_wedge": "🧀", + "chequered_flag": "🏁", + "cherries": "🍒", + "cherry_blossom": "🌸", + "chess_pawn": "♟", + "chestnut": "🌰", + "chicken": "🐔", + "child": "🧒", + "child_dark_skin_tone": "🧒🏿", + "child_light_skin_tone": "🧒🏻", + "child_medium-dark_skin_tone": "🧒🏾", + "child_medium-light_skin_tone": "🧒🏼", + "child_medium_skin_tone": "🧒🏽", + "children_crossing": "🚸", + "chipmunk": "🐿", + "chocolate_bar": "🍫", + "chopsticks": "🥢", + "church": "⛪", + "cigarette": "🚬", + "cinema": "🎦", + "circled_m": "Ⓜ", + "circus_tent": "🎪", + "cityscape": "🏙", + "cityscape_at_dusk": "🌆", + "clamp": "🗜", + "clapper_board": "🎬", + "clapping_hands": "👏", + "clapping_hands_dark_skin_tone": "👏🏿", + "clapping_hands_light_skin_tone": "👏🏻", + "clapping_hands_medium-dark_skin_tone": "👏🏾", + "clapping_hands_medium-light_skin_tone": "👏🏼", + "clapping_hands_medium_skin_tone": "👏🏽", + "classical_building": "🏛", + "clinking_beer_mugs": "🍻", + "clinking_glasses": "🥂", + "clipboard": "📋", + "clockwise_vertical_arrows": "🔃", + "closed_book": "📕", + "closed_mailbox_with_lowered_flag": "📪", + "closed_mailbox_with_raised_flag": "📫", + "closed_umbrella": "🌂", + "cloud": "☁", + "cloud_with_lightning": "🌩", + "cloud_with_lightning_and_rain": "⛈", + "cloud_with_rain": "🌧", + "cloud_with_snow": "🌨", + "clown_face": "🤡", + "club_suit": "♣", + "clutch_bag": "👝", + "coat": "🧥", + "cocktail_glass": "🍸", + "coconut": "🥥", + "coffin": "⚰", + "cold_face": "🥶", + "collision": "💥", + "comet": "☄", + "compass": "🧭", + "computer_disk": "💽", + "computer_mouse": "🖱", + "confetti_ball": "🎊", + "confounded_face": "😖", + "confused_face": "😕", + "construction": "🚧", + "construction_worker": "👷", + "construction_worker_dark_skin_tone": "👷🏿", + "construction_worker_light_skin_tone": "👷🏻", + "construction_worker_medium-dark_skin_tone": "👷🏾", + "construction_worker_medium-light_skin_tone": "👷🏼", + "construction_worker_medium_skin_tone": "👷🏽", + "control_knobs": "🎛", + "convenience_store": "🏪", + "cooked_rice": "🍚", + "cookie": "🍪", + "cooking": "🍳", + "copyright": "©", + "couch_and_lamp": "🛋", + "counterclockwise_arrows_button": "🔄", + "couple_with_heart": "💑", + "couple_with_heart_man_man": "👨\u200d❤️\u200d👨", + "couple_with_heart_woman_man": "👩\u200d❤️\u200d👨", + "couple_with_heart_woman_woman": "👩\u200d❤️\u200d👩", + "cow": "🐮", + "cow_face": "🐮", + "cowboy_hat_face": "🤠", + "crab": "🦀", + "crayon": "🖍", + "credit_card": "💳", + "crescent_moon": "🌙", + "cricket": "🦗", + "cricket_game": "🏏", + "crocodile": "🐊", + "croissant": "🥐", + "cross_mark": "❌", + "cross_mark_button": "❎", + "crossed_fingers": "🤞", + "crossed_fingers_dark_skin_tone": "🤞🏿", + "crossed_fingers_light_skin_tone": "🤞🏻", + "crossed_fingers_medium-dark_skin_tone": "🤞🏾", + "crossed_fingers_medium-light_skin_tone": "🤞🏼", + "crossed_fingers_medium_skin_tone": "🤞🏽", + "crossed_flags": "🎌", + "crossed_swords": "⚔", + "crown": "👑", + "crying_cat_face": "😿", + "crying_face": "😢", + "crystal_ball": "🔮", + "cucumber": "🥒", + "cupcake": "🧁", + "cup_with_straw": "🥤", + "curling_stone": "🥌", + "curly_hair": "🦱", + "curly-haired_man": "👨\u200d🦱", + "curly-haired_woman": "👩\u200d🦱", + "curly_loop": "➰", + "currency_exchange": "💱", + "curry_rice": "🍛", + "custard": "🍮", + "customs": "🛃", + "cut_of_meat": "🥩", + "cyclone": "🌀", + "dagger": "🗡", + "dango": "🍡", + "dashing_away": "💨", + "deaf_person": "🧏", + "deciduous_tree": "🌳", + "deer": "🦌", + "delivery_truck": "🚚", + "department_store": "🏬", + "derelict_house": "🏚", + "desert": "🏜", + "desert_island": "🏝", + "desktop_computer": "🖥", + "detective": "🕵", + "detective_dark_skin_tone": "🕵🏿", + "detective_light_skin_tone": "🕵🏻", + "detective_medium-dark_skin_tone": "🕵🏾", + "detective_medium-light_skin_tone": "🕵🏼", + "detective_medium_skin_tone": "🕵🏽", + "diamond_suit": "♦", + "diamond_with_a_dot": "💠", + "dim_button": "🔅", + "direct_hit": "🎯", + "disappointed_face": "😞", + "diving_mask": "🤿", + "diya_lamp": "🪔", + "dizzy": "💫", + "dizzy_face": "😵", + "dna": "🧬", + "dog": "🐶", + "dog_face": "🐶", + "dollar_banknote": "💵", + "dolphin": "🐬", + "door": "🚪", + "dotted_six-pointed_star": "🔯", + "double_curly_loop": "➿", + "double_exclamation_mark": "‼", + "doughnut": "🍩", + "dove": "🕊", + "down-left_arrow": "↙", + "down-right_arrow": "↘", + "down_arrow": "⬇", + "downcast_face_with_sweat": "😓", + "downwards_button": "🔽", + "dragon": "🐉", + "dragon_face": "🐲", + "dress": "👗", + "drooling_face": "🤤", + "drop_of_blood": "🩸", + "droplet": "💧", + "drum": "🥁", + "duck": "🦆", + "dumpling": "🥟", + "dvd": "📀", + "e-mail": "📧", + "eagle": "🦅", + "ear": "👂", + "ear_dark_skin_tone": "👂🏿", + "ear_light_skin_tone": "👂🏻", + "ear_medium-dark_skin_tone": "👂🏾", + "ear_medium-light_skin_tone": "👂🏼", + "ear_medium_skin_tone": "👂🏽", + "ear_of_corn": "🌽", + "ear_with_hearing_aid": "🦻", + "egg": "🍳", + "eggplant": "🍆", + "eight-pointed_star": "✴", + "eight-spoked_asterisk": "✳", + "eight-thirty": "🕣", + "eight_o’clock": "🕗", + "eject_button": "⏏", + "electric_plug": "🔌", + "elephant": "🐘", + "eleven-thirty": "🕦", + "eleven_o’clock": "🕚", + "elf": "🧝", + "elf_dark_skin_tone": "🧝🏿", + "elf_light_skin_tone": "🧝🏻", + "elf_medium-dark_skin_tone": "🧝🏾", + "elf_medium-light_skin_tone": "🧝🏼", + "elf_medium_skin_tone": "🧝🏽", + "envelope": "✉", + "envelope_with_arrow": "📩", + "euro_banknote": "💶", + "evergreen_tree": "🌲", + "ewe": "🐑", + "exclamation_mark": "❗", + "exclamation_question_mark": "⁉", + "exploding_head": "🤯", + "expressionless_face": "😑", + "eye": "👁", + "eye_in_speech_bubble": "👁️\u200d🗨️", + "eyes": "👀", + "face_blowing_a_kiss": "😘", + "face_savoring_food": "😋", + "face_screaming_in_fear": "😱", + "face_vomiting": "🤮", + "face_with_hand_over_mouth": "🤭", + "face_with_head-bandage": "🤕", + "face_with_medical_mask": "😷", + "face_with_monocle": "🧐", + "face_with_open_mouth": "😮", + "face_with_raised_eyebrow": "🤨", + "face_with_rolling_eyes": "🙄", + "face_with_steam_from_nose": "😤", + "face_with_symbols_on_mouth": "🤬", + "face_with_tears_of_joy": "😂", + "face_with_thermometer": "🤒", + "face_with_tongue": "😛", + "face_without_mouth": "😶", + "factory": "🏭", + "fairy": "🧚", + "fairy_dark_skin_tone": "🧚🏿", + "fairy_light_skin_tone": "🧚🏻", + "fairy_medium-dark_skin_tone": "🧚🏾", + "fairy_medium-light_skin_tone": "🧚🏼", + "fairy_medium_skin_tone": "🧚🏽", + "falafel": "🧆", + "fallen_leaf": "🍂", + "family": "👪", + "family_man_boy": "👨\u200d👦", + "family_man_boy_boy": "👨\u200d👦\u200d👦", + "family_man_girl": "👨\u200d👧", + "family_man_girl_boy": "👨\u200d👧\u200d👦", + "family_man_girl_girl": "👨\u200d👧\u200d👧", + "family_man_man_boy": "👨\u200d👨\u200d👦", + "family_man_man_boy_boy": "👨\u200d👨\u200d👦\u200d👦", + "family_man_man_girl": "👨\u200d👨\u200d👧", + "family_man_man_girl_boy": "👨\u200d👨\u200d👧\u200d👦", + "family_man_man_girl_girl": "👨\u200d👨\u200d👧\u200d👧", + "family_man_woman_boy": "👨\u200d👩\u200d👦", + "family_man_woman_boy_boy": "👨\u200d👩\u200d👦\u200d👦", + "family_man_woman_girl": "👨\u200d👩\u200d👧", + "family_man_woman_girl_boy": "👨\u200d👩\u200d👧\u200d👦", + "family_man_woman_girl_girl": "👨\u200d👩\u200d👧\u200d👧", + "family_woman_boy": "👩\u200d👦", + "family_woman_boy_boy": "👩\u200d👦\u200d👦", + "family_woman_girl": "👩\u200d👧", + "family_woman_girl_boy": "👩\u200d👧\u200d👦", + "family_woman_girl_girl": "👩\u200d👧\u200d👧", + "family_woman_woman_boy": "👩\u200d👩\u200d👦", + "family_woman_woman_boy_boy": "👩\u200d👩\u200d👦\u200d👦", + "family_woman_woman_girl": "👩\u200d👩\u200d👧", + "family_woman_woman_girl_boy": "👩\u200d👩\u200d👧\u200d👦", + "family_woman_woman_girl_girl": "👩\u200d👩\u200d👧\u200d👧", + "fast-forward_button": "⏩", + "fast_down_button": "⏬", + "fast_reverse_button": "⏪", + "fast_up_button": "⏫", + "fax_machine": "📠", + "fearful_face": "😨", + "female_sign": "♀", + "ferris_wheel": "🎡", + "ferry": "⛴", + "field_hockey": "🏑", + "file_cabinet": "🗄", + "file_folder": "📁", + "film_frames": "🎞", + "film_projector": "📽", + "fire": "🔥", + "fire_extinguisher": "🧯", + "firecracker": "🧨", + "fire_engine": "🚒", + "fireworks": "🎆", + "first_quarter_moon": "🌓", + "first_quarter_moon_face": "🌛", + "fish": "🐟", + "fish_cake_with_swirl": "🍥", + "fishing_pole": "🎣", + "five-thirty": "🕠", + "five_o’clock": "🕔", + "flag_in_hole": "⛳", + "flamingo": "🦩", + "flashlight": "🔦", + "flat_shoe": "🥿", + "fleur-de-lis": "⚜", + "flexed_biceps": "💪", + "flexed_biceps_dark_skin_tone": "💪🏿", + "flexed_biceps_light_skin_tone": "💪🏻", + "flexed_biceps_medium-dark_skin_tone": "💪🏾", + "flexed_biceps_medium-light_skin_tone": "💪🏼", + "flexed_biceps_medium_skin_tone": "💪🏽", + "floppy_disk": "💾", + "flower_playing_cards": "🎴", + "flushed_face": "😳", + "flying_disc": "🥏", + "flying_saucer": "🛸", + "fog": "🌫", + "foggy": "🌁", + "folded_hands": "🙏", + "folded_hands_dark_skin_tone": "🙏🏿", + "folded_hands_light_skin_tone": "🙏🏻", + "folded_hands_medium-dark_skin_tone": "🙏🏾", + "folded_hands_medium-light_skin_tone": "🙏🏼", + "folded_hands_medium_skin_tone": "🙏🏽", + "foot": "🦶", + "footprints": "👣", + "fork_and_knife": "🍴", + "fork_and_knife_with_plate": "🍽", + "fortune_cookie": "🥠", + "fountain": "⛲", + "fountain_pen": "🖋", + "four-thirty": "🕟", + "four_leaf_clover": "🍀", + "four_o’clock": "🕓", + "fox_face": "🦊", + "framed_picture": "🖼", + "french_fries": "🍟", + "fried_shrimp": "🍤", + "frog_face": "🐸", + "front-facing_baby_chick": "🐥", + "frowning_face": "☹", + "frowning_face_with_open_mouth": "😦", + "fuel_pump": "⛽", + "full_moon": "🌕", + "full_moon_face": "🌝", + "funeral_urn": "⚱", + "game_die": "🎲", + "garlic": "🧄", + "gear": "⚙", + "gem_stone": "💎", + "genie": "🧞", + "ghost": "👻", + "giraffe": "🦒", + "girl": "👧", + "girl_dark_skin_tone": "👧🏿", + "girl_light_skin_tone": "👧🏻", + "girl_medium-dark_skin_tone": "👧🏾", + "girl_medium-light_skin_tone": "👧🏼", + "girl_medium_skin_tone": "👧🏽", + "glass_of_milk": "🥛", + "glasses": "👓", + "globe_showing_americas": "🌎", + "globe_showing_asia-australia": "🌏", + "globe_showing_europe-africa": "🌍", + "globe_with_meridians": "🌐", + "gloves": "🧤", + "glowing_star": "🌟", + "goal_net": "🥅", + "goat": "🐐", + "goblin": "👺", + "goggles": "🥽", + "gorilla": "🦍", + "graduation_cap": "🎓", + "grapes": "🍇", + "green_apple": "🍏", + "green_book": "📗", + "green_circle": "🟢", + "green_heart": "💚", + "green_salad": "🥗", + "green_square": "🟩", + "grimacing_face": "😬", + "grinning_cat_face": "😺", + "grinning_cat_face_with_smiling_eyes": "😸", + "grinning_face": "😀", + "grinning_face_with_big_eyes": "😃", + "grinning_face_with_smiling_eyes": "😄", + "grinning_face_with_sweat": "😅", + "grinning_squinting_face": "😆", + "growing_heart": "💗", + "guard": "💂", + "guard_dark_skin_tone": "💂🏿", + "guard_light_skin_tone": "💂🏻", + "guard_medium-dark_skin_tone": "💂🏾", + "guard_medium-light_skin_tone": "💂🏼", + "guard_medium_skin_tone": "💂🏽", + "guide_dog": "🦮", + "guitar": "🎸", + "hamburger": "🍔", + "hammer": "🔨", + "hammer_and_pick": "⚒", + "hammer_and_wrench": "🛠", + "hamster_face": "🐹", + "hand_with_fingers_splayed": "🖐", + "hand_with_fingers_splayed_dark_skin_tone": "🖐🏿", + "hand_with_fingers_splayed_light_skin_tone": "🖐🏻", + "hand_with_fingers_splayed_medium-dark_skin_tone": "🖐🏾", + "hand_with_fingers_splayed_medium-light_skin_tone": "🖐🏼", + "hand_with_fingers_splayed_medium_skin_tone": "🖐🏽", + "handbag": "👜", + "handshake": "🤝", + "hatching_chick": "🐣", + "headphone": "🎧", + "hear-no-evil_monkey": "🙉", + "heart_decoration": "💟", + "heart_suit": "♥", + "heart_with_arrow": "💘", + "heart_with_ribbon": "💝", + "heavy_check_mark": "✔", + "heavy_division_sign": "➗", + "heavy_dollar_sign": "💲", + "heavy_heart_exclamation": "❣", + "heavy_large_circle": "⭕", + "heavy_minus_sign": "➖", + "heavy_multiplication_x": "✖", + "heavy_plus_sign": "➕", + "hedgehog": "🦔", + "helicopter": "🚁", + "herb": "🌿", + "hibiscus": "🌺", + "high-heeled_shoe": "👠", + "high-speed_train": "🚄", + "high_voltage": "⚡", + "hiking_boot": "🥾", + "hindu_temple": "🛕", + "hippopotamus": "🦛", + "hole": "🕳", + "honey_pot": "🍯", + "honeybee": "🐝", + "horizontal_traffic_light": "🚥", + "horse": "🐴", + "horse_face": "🐴", + "horse_racing": "🏇", + "horse_racing_dark_skin_tone": "🏇🏿", + "horse_racing_light_skin_tone": "🏇🏻", + "horse_racing_medium-dark_skin_tone": "🏇🏾", + "horse_racing_medium-light_skin_tone": "🏇🏼", + "horse_racing_medium_skin_tone": "🏇🏽", + "hospital": "🏥", + "hot_beverage": "☕", + "hot_dog": "🌭", + "hot_face": "🥵", + "hot_pepper": "🌶", + "hot_springs": "♨", + "hotel": "🏨", + "hourglass_done": "⌛", + "hourglass_not_done": "⏳", + "house": "🏠", + "house_with_garden": "🏡", + "houses": "🏘", + "hugging_face": "🤗", + "hundred_points": "💯", + "hushed_face": "😯", + "ice": "🧊", + "ice_cream": "🍨", + "ice_hockey": "🏒", + "ice_skate": "⛸", + "inbox_tray": "📥", + "incoming_envelope": "📨", + "index_pointing_up": "☝", + "index_pointing_up_dark_skin_tone": "☝🏿", + "index_pointing_up_light_skin_tone": "☝🏻", + "index_pointing_up_medium-dark_skin_tone": "☝🏾", + "index_pointing_up_medium-light_skin_tone": "☝🏼", + "index_pointing_up_medium_skin_tone": "☝🏽", + "infinity": "♾", + "information": "ℹ", + "input_latin_letters": "🔤", + "input_latin_lowercase": "🔡", + "input_latin_uppercase": "🔠", + "input_numbers": "🔢", + "input_symbols": "🔣", + "jack-o-lantern": "🎃", + "jeans": "👖", + "jigsaw": "🧩", + "joker": "🃏", + "joystick": "🕹", + "kaaba": "🕋", + "kangaroo": "🦘", + "key": "🔑", + "keyboard": "⌨", + "keycap_#": "#️⃣", + "keycap_*": "*️⃣", + "keycap_0": "0️⃣", + "keycap_1": "1️⃣", + "keycap_10": "🔟", + "keycap_2": "2️⃣", + "keycap_3": "3️⃣", + "keycap_4": "4️⃣", + "keycap_5": "5️⃣", + "keycap_6": "6️⃣", + "keycap_7": "7️⃣", + "keycap_8": "8️⃣", + "keycap_9": "9️⃣", + "kick_scooter": "🛴", + "kimono": "👘", + "kiss": "💋", + "kiss_man_man": "👨\u200d❤️\u200d💋\u200d👨", + "kiss_mark": "💋", + "kiss_woman_man": "👩\u200d❤️\u200d💋\u200d👨", + "kiss_woman_woman": "👩\u200d❤️\u200d💋\u200d👩", + "kissing_cat_face": "😽", + "kissing_face": "😗", + "kissing_face_with_closed_eyes": "😚", + "kissing_face_with_smiling_eyes": "😙", + "kitchen_knife": "🔪", + "kite": "🪁", + "kiwi_fruit": "🥝", + "koala": "🐨", + "lab_coat": "🥼", + "label": "🏷", + "lacrosse": "🥍", + "lady_beetle": "🐞", + "laptop_computer": "💻", + "large_blue_diamond": "🔷", + "large_orange_diamond": "🔶", + "last_quarter_moon": "🌗", + "last_quarter_moon_face": "🌜", + "last_track_button": "⏮", + "latin_cross": "✝", + "leaf_fluttering_in_wind": "🍃", + "leafy_green": "🥬", + "ledger": "📒", + "left-facing_fist": "🤛", + "left-facing_fist_dark_skin_tone": "🤛🏿", + "left-facing_fist_light_skin_tone": "🤛🏻", + "left-facing_fist_medium-dark_skin_tone": "🤛🏾", + "left-facing_fist_medium-light_skin_tone": "🤛🏼", + "left-facing_fist_medium_skin_tone": "🤛🏽", + "left-right_arrow": "↔", + "left_arrow": "⬅", + "left_arrow_curving_right": "↪", + "left_luggage": "🛅", + "left_speech_bubble": "🗨", + "leg": "🦵", + "lemon": "🍋", + "leopard": "🐆", + "level_slider": "🎚", + "light_bulb": "💡", + "light_rail": "🚈", + "link": "🔗", + "linked_paperclips": "🖇", + "lion_face": "🦁", + "lipstick": "💄", + "litter_in_bin_sign": "🚮", + "lizard": "🦎", + "llama": "🦙", + "lobster": "🦞", + "locked": "🔒", + "locked_with_key": "🔐", + "locked_with_pen": "🔏", + "locomotive": "🚂", + "lollipop": "🍭", + "lotion_bottle": "🧴", + "loudly_crying_face": "😭", + "loudspeaker": "📢", + "love-you_gesture": "🤟", + "love-you_gesture_dark_skin_tone": "🤟🏿", + "love-you_gesture_light_skin_tone": "🤟🏻", + "love-you_gesture_medium-dark_skin_tone": "🤟🏾", + "love-you_gesture_medium-light_skin_tone": "🤟🏼", + "love-you_gesture_medium_skin_tone": "🤟🏽", + "love_hotel": "🏩", + "love_letter": "💌", + "luggage": "🧳", + "lying_face": "🤥", + "mage": "🧙", + "mage_dark_skin_tone": "🧙🏿", + "mage_light_skin_tone": "🧙🏻", + "mage_medium-dark_skin_tone": "🧙🏾", + "mage_medium-light_skin_tone": "🧙🏼", + "mage_medium_skin_tone": "🧙🏽", + "magnet": "🧲", + "magnifying_glass_tilted_left": "🔍", + "magnifying_glass_tilted_right": "🔎", + "mahjong_red_dragon": "🀄", + "male_sign": "♂", + "man": "👨", + "man_and_woman_holding_hands": "👫", + "man_artist": "👨\u200d🎨", + "man_artist_dark_skin_tone": "👨🏿\u200d🎨", + "man_artist_light_skin_tone": "👨🏻\u200d🎨", + "man_artist_medium-dark_skin_tone": "👨🏾\u200d🎨", + "man_artist_medium-light_skin_tone": "👨🏼\u200d🎨", + "man_artist_medium_skin_tone": "👨🏽\u200d🎨", + "man_astronaut": "👨\u200d🚀", + "man_astronaut_dark_skin_tone": "👨🏿\u200d🚀", + "man_astronaut_light_skin_tone": "👨🏻\u200d🚀", + "man_astronaut_medium-dark_skin_tone": "👨🏾\u200d🚀", + "man_astronaut_medium-light_skin_tone": "👨🏼\u200d🚀", + "man_astronaut_medium_skin_tone": "👨🏽\u200d🚀", + "man_biking": "🚴\u200d♂️", + "man_biking_dark_skin_tone": "🚴🏿\u200d♂️", + "man_biking_light_skin_tone": "🚴🏻\u200d♂️", + "man_biking_medium-dark_skin_tone": "🚴🏾\u200d♂️", + "man_biking_medium-light_skin_tone": "🚴🏼\u200d♂️", + "man_biking_medium_skin_tone": "🚴🏽\u200d♂️", + "man_bouncing_ball": "⛹️\u200d♂️", + "man_bouncing_ball_dark_skin_tone": "⛹🏿\u200d♂️", + "man_bouncing_ball_light_skin_tone": "⛹🏻\u200d♂️", + "man_bouncing_ball_medium-dark_skin_tone": "⛹🏾\u200d♂️", + "man_bouncing_ball_medium-light_skin_tone": "⛹🏼\u200d♂️", + "man_bouncing_ball_medium_skin_tone": "⛹🏽\u200d♂️", + "man_bowing": "🙇\u200d♂️", + "man_bowing_dark_skin_tone": "🙇🏿\u200d♂️", + "man_bowing_light_skin_tone": "🙇🏻\u200d♂️", + "man_bowing_medium-dark_skin_tone": "🙇🏾\u200d♂️", + "man_bowing_medium-light_skin_tone": "🙇🏼\u200d♂️", + "man_bowing_medium_skin_tone": "🙇🏽\u200d♂️", + "man_cartwheeling": "🤸\u200d♂️", + "man_cartwheeling_dark_skin_tone": "🤸🏿\u200d♂️", + "man_cartwheeling_light_skin_tone": "🤸🏻\u200d♂️", + "man_cartwheeling_medium-dark_skin_tone": "🤸🏾\u200d♂️", + "man_cartwheeling_medium-light_skin_tone": "🤸🏼\u200d♂️", + "man_cartwheeling_medium_skin_tone": "🤸🏽\u200d♂️", + "man_climbing": "🧗\u200d♂️", + "man_climbing_dark_skin_tone": "🧗🏿\u200d♂️", + "man_climbing_light_skin_tone": "🧗🏻\u200d♂️", + "man_climbing_medium-dark_skin_tone": "🧗🏾\u200d♂️", + "man_climbing_medium-light_skin_tone": "🧗🏼\u200d♂️", + "man_climbing_medium_skin_tone": "🧗🏽\u200d♂️", + "man_construction_worker": "👷\u200d♂️", + "man_construction_worker_dark_skin_tone": "👷🏿\u200d♂️", + "man_construction_worker_light_skin_tone": "👷🏻\u200d♂️", + "man_construction_worker_medium-dark_skin_tone": "👷🏾\u200d♂️", + "man_construction_worker_medium-light_skin_tone": "👷🏼\u200d♂️", + "man_construction_worker_medium_skin_tone": "👷🏽\u200d♂️", + "man_cook": "👨\u200d🍳", + "man_cook_dark_skin_tone": "👨🏿\u200d🍳", + "man_cook_light_skin_tone": "👨🏻\u200d🍳", + "man_cook_medium-dark_skin_tone": "👨🏾\u200d🍳", + "man_cook_medium-light_skin_tone": "👨🏼\u200d🍳", + "man_cook_medium_skin_tone": "👨🏽\u200d🍳", + "man_dancing": "🕺", + "man_dancing_dark_skin_tone": "🕺🏿", + "man_dancing_light_skin_tone": "🕺🏻", + "man_dancing_medium-dark_skin_tone": "🕺🏾", + "man_dancing_medium-light_skin_tone": "🕺🏼", + "man_dancing_medium_skin_tone": "🕺🏽", + "man_dark_skin_tone": "👨🏿", + "man_detective": "🕵️\u200d♂️", + "man_detective_dark_skin_tone": "🕵🏿\u200d♂️", + "man_detective_light_skin_tone": "🕵🏻\u200d♂️", + "man_detective_medium-dark_skin_tone": "🕵🏾\u200d♂️", + "man_detective_medium-light_skin_tone": "🕵🏼\u200d♂️", + "man_detective_medium_skin_tone": "🕵🏽\u200d♂️", + "man_elf": "🧝\u200d♂️", + "man_elf_dark_skin_tone": "🧝🏿\u200d♂️", + "man_elf_light_skin_tone": "🧝🏻\u200d♂️", + "man_elf_medium-dark_skin_tone": "🧝🏾\u200d♂️", + "man_elf_medium-light_skin_tone": "🧝🏼\u200d♂️", + "man_elf_medium_skin_tone": "🧝🏽\u200d♂️", + "man_facepalming": "🤦\u200d♂️", + "man_facepalming_dark_skin_tone": "🤦🏿\u200d♂️", + "man_facepalming_light_skin_tone": "🤦🏻\u200d♂️", + "man_facepalming_medium-dark_skin_tone": "🤦🏾\u200d♂️", + "man_facepalming_medium-light_skin_tone": "🤦🏼\u200d♂️", + "man_facepalming_medium_skin_tone": "🤦🏽\u200d♂️", + "man_factory_worker": "👨\u200d🏭", + "man_factory_worker_dark_skin_tone": "👨🏿\u200d🏭", + "man_factory_worker_light_skin_tone": "👨🏻\u200d🏭", + "man_factory_worker_medium-dark_skin_tone": "👨🏾\u200d🏭", + "man_factory_worker_medium-light_skin_tone": "👨🏼\u200d🏭", + "man_factory_worker_medium_skin_tone": "👨🏽\u200d🏭", + "man_fairy": "🧚\u200d♂️", + "man_fairy_dark_skin_tone": "🧚🏿\u200d♂️", + "man_fairy_light_skin_tone": "🧚🏻\u200d♂️", + "man_fairy_medium-dark_skin_tone": "🧚🏾\u200d♂️", + "man_fairy_medium-light_skin_tone": "🧚🏼\u200d♂️", + "man_fairy_medium_skin_tone": "🧚🏽\u200d♂️", + "man_farmer": "👨\u200d🌾", + "man_farmer_dark_skin_tone": "👨🏿\u200d🌾", + "man_farmer_light_skin_tone": "👨🏻\u200d🌾", + "man_farmer_medium-dark_skin_tone": "👨🏾\u200d🌾", + "man_farmer_medium-light_skin_tone": "👨🏼\u200d🌾", + "man_farmer_medium_skin_tone": "👨🏽\u200d🌾", + "man_firefighter": "👨\u200d🚒", + "man_firefighter_dark_skin_tone": "👨🏿\u200d🚒", + "man_firefighter_light_skin_tone": "👨🏻\u200d🚒", + "man_firefighter_medium-dark_skin_tone": "👨🏾\u200d🚒", + "man_firefighter_medium-light_skin_tone": "👨🏼\u200d🚒", + "man_firefighter_medium_skin_tone": "👨🏽\u200d🚒", + "man_frowning": "🙍\u200d♂️", + "man_frowning_dark_skin_tone": "🙍🏿\u200d♂️", + "man_frowning_light_skin_tone": "🙍🏻\u200d♂️", + "man_frowning_medium-dark_skin_tone": "🙍🏾\u200d♂️", + "man_frowning_medium-light_skin_tone": "🙍🏼\u200d♂️", + "man_frowning_medium_skin_tone": "🙍🏽\u200d♂️", + "man_genie": "🧞\u200d♂️", + "man_gesturing_no": "🙅\u200d♂️", + "man_gesturing_no_dark_skin_tone": "🙅🏿\u200d♂️", + "man_gesturing_no_light_skin_tone": "🙅🏻\u200d♂️", + "man_gesturing_no_medium-dark_skin_tone": "🙅🏾\u200d♂️", + "man_gesturing_no_medium-light_skin_tone": "🙅🏼\u200d♂️", + "man_gesturing_no_medium_skin_tone": "🙅🏽\u200d♂️", + "man_gesturing_ok": "🙆\u200d♂️", + "man_gesturing_ok_dark_skin_tone": "🙆🏿\u200d♂️", + "man_gesturing_ok_light_skin_tone": "🙆🏻\u200d♂️", + "man_gesturing_ok_medium-dark_skin_tone": "🙆🏾\u200d♂️", + "man_gesturing_ok_medium-light_skin_tone": "🙆🏼\u200d♂️", + "man_gesturing_ok_medium_skin_tone": "🙆🏽\u200d♂️", + "man_getting_haircut": "💇\u200d♂️", + "man_getting_haircut_dark_skin_tone": "💇🏿\u200d♂️", + "man_getting_haircut_light_skin_tone": "💇🏻\u200d♂️", + "man_getting_haircut_medium-dark_skin_tone": "💇🏾\u200d♂️", + "man_getting_haircut_medium-light_skin_tone": "💇🏼\u200d♂️", + "man_getting_haircut_medium_skin_tone": "💇🏽\u200d♂️", + "man_getting_massage": "💆\u200d♂️", + "man_getting_massage_dark_skin_tone": "💆🏿\u200d♂️", + "man_getting_massage_light_skin_tone": "💆🏻\u200d♂️", + "man_getting_massage_medium-dark_skin_tone": "💆🏾\u200d♂️", + "man_getting_massage_medium-light_skin_tone": "💆🏼\u200d♂️", + "man_getting_massage_medium_skin_tone": "💆🏽\u200d♂️", + "man_golfing": "🏌️\u200d♂️", + "man_golfing_dark_skin_tone": "🏌🏿\u200d♂️", + "man_golfing_light_skin_tone": "🏌🏻\u200d♂️", + "man_golfing_medium-dark_skin_tone": "🏌🏾\u200d♂️", + "man_golfing_medium-light_skin_tone": "🏌🏼\u200d♂️", + "man_golfing_medium_skin_tone": "🏌🏽\u200d♂️", + "man_guard": "💂\u200d♂️", + "man_guard_dark_skin_tone": "💂🏿\u200d♂️", + "man_guard_light_skin_tone": "💂🏻\u200d♂️", + "man_guard_medium-dark_skin_tone": "💂🏾\u200d♂️", + "man_guard_medium-light_skin_tone": "💂🏼\u200d♂️", + "man_guard_medium_skin_tone": "💂🏽\u200d♂️", + "man_health_worker": "👨\u200d⚕️", + "man_health_worker_dark_skin_tone": "👨🏿\u200d⚕️", + "man_health_worker_light_skin_tone": "👨🏻\u200d⚕️", + "man_health_worker_medium-dark_skin_tone": "👨🏾\u200d⚕️", + "man_health_worker_medium-light_skin_tone": "👨🏼\u200d⚕️", + "man_health_worker_medium_skin_tone": "👨🏽\u200d⚕️", + "man_in_lotus_position": "🧘\u200d♂️", + "man_in_lotus_position_dark_skin_tone": "🧘🏿\u200d♂️", + "man_in_lotus_position_light_skin_tone": "🧘🏻\u200d♂️", + "man_in_lotus_position_medium-dark_skin_tone": "🧘🏾\u200d♂️", + "man_in_lotus_position_medium-light_skin_tone": "🧘🏼\u200d♂️", + "man_in_lotus_position_medium_skin_tone": "🧘🏽\u200d♂️", + "man_in_manual_wheelchair": "👨\u200d🦽", + "man_in_motorized_wheelchair": "👨\u200d🦼", + "man_in_steamy_room": "🧖\u200d♂️", + "man_in_steamy_room_dark_skin_tone": "🧖🏿\u200d♂️", + "man_in_steamy_room_light_skin_tone": "🧖🏻\u200d♂️", + "man_in_steamy_room_medium-dark_skin_tone": "🧖🏾\u200d♂️", + "man_in_steamy_room_medium-light_skin_tone": "🧖🏼\u200d♂️", + "man_in_steamy_room_medium_skin_tone": "🧖🏽\u200d♂️", + "man_in_suit_levitating": "🕴", + "man_in_suit_levitating_dark_skin_tone": "🕴🏿", + "man_in_suit_levitating_light_skin_tone": "🕴🏻", + "man_in_suit_levitating_medium-dark_skin_tone": "🕴🏾", + "man_in_suit_levitating_medium-light_skin_tone": "🕴🏼", + "man_in_suit_levitating_medium_skin_tone": "🕴🏽", + "man_in_tuxedo": "🤵", + "man_in_tuxedo_dark_skin_tone": "🤵🏿", + "man_in_tuxedo_light_skin_tone": "🤵🏻", + "man_in_tuxedo_medium-dark_skin_tone": "🤵🏾", + "man_in_tuxedo_medium-light_skin_tone": "🤵🏼", + "man_in_tuxedo_medium_skin_tone": "🤵🏽", + "man_judge": "👨\u200d⚖️", + "man_judge_dark_skin_tone": "👨🏿\u200d⚖️", + "man_judge_light_skin_tone": "👨🏻\u200d⚖️", + "man_judge_medium-dark_skin_tone": "👨🏾\u200d⚖️", + "man_judge_medium-light_skin_tone": "👨🏼\u200d⚖️", + "man_judge_medium_skin_tone": "👨🏽\u200d⚖️", + "man_juggling": "🤹\u200d♂️", + "man_juggling_dark_skin_tone": "🤹🏿\u200d♂️", + "man_juggling_light_skin_tone": "🤹🏻\u200d♂️", + "man_juggling_medium-dark_skin_tone": "🤹🏾\u200d♂️", + "man_juggling_medium-light_skin_tone": "🤹🏼\u200d♂️", + "man_juggling_medium_skin_tone": "🤹🏽\u200d♂️", + "man_lifting_weights": "🏋️\u200d♂️", + "man_lifting_weights_dark_skin_tone": "🏋🏿\u200d♂️", + "man_lifting_weights_light_skin_tone": "🏋🏻\u200d♂️", + "man_lifting_weights_medium-dark_skin_tone": "🏋🏾\u200d♂️", + "man_lifting_weights_medium-light_skin_tone": "🏋🏼\u200d♂️", + "man_lifting_weights_medium_skin_tone": "🏋🏽\u200d♂️", + "man_light_skin_tone": "👨🏻", + "man_mage": "🧙\u200d♂️", + "man_mage_dark_skin_tone": "🧙🏿\u200d♂️", + "man_mage_light_skin_tone": "🧙🏻\u200d♂️", + "man_mage_medium-dark_skin_tone": "🧙🏾\u200d♂️", + "man_mage_medium-light_skin_tone": "🧙🏼\u200d♂️", + "man_mage_medium_skin_tone": "🧙🏽\u200d♂️", + "man_mechanic": "👨\u200d🔧", + "man_mechanic_dark_skin_tone": "👨🏿\u200d🔧", + "man_mechanic_light_skin_tone": "👨🏻\u200d🔧", + "man_mechanic_medium-dark_skin_tone": "👨🏾\u200d🔧", + "man_mechanic_medium-light_skin_tone": "👨🏼\u200d🔧", + "man_mechanic_medium_skin_tone": "👨🏽\u200d🔧", + "man_medium-dark_skin_tone": "👨🏾", + "man_medium-light_skin_tone": "👨🏼", + "man_medium_skin_tone": "👨🏽", + "man_mountain_biking": "🚵\u200d♂️", + "man_mountain_biking_dark_skin_tone": "🚵🏿\u200d♂️", + "man_mountain_biking_light_skin_tone": "🚵🏻\u200d♂️", + "man_mountain_biking_medium-dark_skin_tone": "🚵🏾\u200d♂️", + "man_mountain_biking_medium-light_skin_tone": "🚵🏼\u200d♂️", + "man_mountain_biking_medium_skin_tone": "🚵🏽\u200d♂️", + "man_office_worker": "👨\u200d💼", + "man_office_worker_dark_skin_tone": "👨🏿\u200d💼", + "man_office_worker_light_skin_tone": "👨🏻\u200d💼", + "man_office_worker_medium-dark_skin_tone": "👨🏾\u200d💼", + "man_office_worker_medium-light_skin_tone": "👨🏼\u200d💼", + "man_office_worker_medium_skin_tone": "👨🏽\u200d💼", + "man_pilot": "👨\u200d✈️", + "man_pilot_dark_skin_tone": "👨🏿\u200d✈️", + "man_pilot_light_skin_tone": "👨🏻\u200d✈️", + "man_pilot_medium-dark_skin_tone": "👨🏾\u200d✈️", + "man_pilot_medium-light_skin_tone": "👨🏼\u200d✈️", + "man_pilot_medium_skin_tone": "👨🏽\u200d✈️", + "man_playing_handball": "🤾\u200d♂️", + "man_playing_handball_dark_skin_tone": "🤾🏿\u200d♂️", + "man_playing_handball_light_skin_tone": "🤾🏻\u200d♂️", + "man_playing_handball_medium-dark_skin_tone": "🤾🏾\u200d♂️", + "man_playing_handball_medium-light_skin_tone": "🤾🏼\u200d♂️", + "man_playing_handball_medium_skin_tone": "🤾🏽\u200d♂️", + "man_playing_water_polo": "🤽\u200d♂️", + "man_playing_water_polo_dark_skin_tone": "🤽🏿\u200d♂️", + "man_playing_water_polo_light_skin_tone": "🤽🏻\u200d♂️", + "man_playing_water_polo_medium-dark_skin_tone": "🤽🏾\u200d♂️", + "man_playing_water_polo_medium-light_skin_tone": "🤽🏼\u200d♂️", + "man_playing_water_polo_medium_skin_tone": "🤽🏽\u200d♂️", + "man_police_officer": "👮\u200d♂️", + "man_police_officer_dark_skin_tone": "👮🏿\u200d♂️", + "man_police_officer_light_skin_tone": "👮🏻\u200d♂️", + "man_police_officer_medium-dark_skin_tone": "👮🏾\u200d♂️", + "man_police_officer_medium-light_skin_tone": "👮🏼\u200d♂️", + "man_police_officer_medium_skin_tone": "👮🏽\u200d♂️", + "man_pouting": "🙎\u200d♂️", + "man_pouting_dark_skin_tone": "🙎🏿\u200d♂️", + "man_pouting_light_skin_tone": "🙎🏻\u200d♂️", + "man_pouting_medium-dark_skin_tone": "🙎🏾\u200d♂️", + "man_pouting_medium-light_skin_tone": "🙎🏼\u200d♂️", + "man_pouting_medium_skin_tone": "🙎🏽\u200d♂️", + "man_raising_hand": "🙋\u200d♂️", + "man_raising_hand_dark_skin_tone": "🙋🏿\u200d♂️", + "man_raising_hand_light_skin_tone": "🙋🏻\u200d♂️", + "man_raising_hand_medium-dark_skin_tone": "🙋🏾\u200d♂️", + "man_raising_hand_medium-light_skin_tone": "🙋🏼\u200d♂️", + "man_raising_hand_medium_skin_tone": "🙋🏽\u200d♂️", + "man_rowing_boat": "🚣\u200d♂️", + "man_rowing_boat_dark_skin_tone": "🚣🏿\u200d♂️", + "man_rowing_boat_light_skin_tone": "🚣🏻\u200d♂️", + "man_rowing_boat_medium-dark_skin_tone": "🚣🏾\u200d♂️", + "man_rowing_boat_medium-light_skin_tone": "🚣🏼\u200d♂️", + "man_rowing_boat_medium_skin_tone": "🚣🏽\u200d♂️", + "man_running": "🏃\u200d♂️", + "man_running_dark_skin_tone": "🏃🏿\u200d♂️", + "man_running_light_skin_tone": "🏃🏻\u200d♂️", + "man_running_medium-dark_skin_tone": "🏃🏾\u200d♂️", + "man_running_medium-light_skin_tone": "🏃🏼\u200d♂️", + "man_running_medium_skin_tone": "🏃🏽\u200d♂️", + "man_scientist": "👨\u200d🔬", + "man_scientist_dark_skin_tone": "👨🏿\u200d🔬", + "man_scientist_light_skin_tone": "👨🏻\u200d🔬", + "man_scientist_medium-dark_skin_tone": "👨🏾\u200d🔬", + "man_scientist_medium-light_skin_tone": "👨🏼\u200d🔬", + "man_scientist_medium_skin_tone": "👨🏽\u200d🔬", + "man_shrugging": "🤷\u200d♂️", + "man_shrugging_dark_skin_tone": "🤷🏿\u200d♂️", + "man_shrugging_light_skin_tone": "🤷🏻\u200d♂️", + "man_shrugging_medium-dark_skin_tone": "🤷🏾\u200d♂️", + "man_shrugging_medium-light_skin_tone": "🤷🏼\u200d♂️", + "man_shrugging_medium_skin_tone": "🤷🏽\u200d♂️", + "man_singer": "👨\u200d🎤", + "man_singer_dark_skin_tone": "👨🏿\u200d🎤", + "man_singer_light_skin_tone": "👨🏻\u200d🎤", + "man_singer_medium-dark_skin_tone": "👨🏾\u200d🎤", + "man_singer_medium-light_skin_tone": "👨🏼\u200d🎤", + "man_singer_medium_skin_tone": "👨🏽\u200d🎤", + "man_student": "👨\u200d🎓", + "man_student_dark_skin_tone": "👨🏿\u200d🎓", + "man_student_light_skin_tone": "👨🏻\u200d🎓", + "man_student_medium-dark_skin_tone": "👨🏾\u200d🎓", + "man_student_medium-light_skin_tone": "👨🏼\u200d🎓", + "man_student_medium_skin_tone": "👨🏽\u200d🎓", + "man_surfing": "🏄\u200d♂️", + "man_surfing_dark_skin_tone": "🏄🏿\u200d♂️", + "man_surfing_light_skin_tone": "🏄🏻\u200d♂️", + "man_surfing_medium-dark_skin_tone": "🏄🏾\u200d♂️", + "man_surfing_medium-light_skin_tone": "🏄🏼\u200d♂️", + "man_surfing_medium_skin_tone": "🏄🏽\u200d♂️", + "man_swimming": "🏊\u200d♂️", + "man_swimming_dark_skin_tone": "🏊🏿\u200d♂️", + "man_swimming_light_skin_tone": "🏊🏻\u200d♂️", + "man_swimming_medium-dark_skin_tone": "🏊🏾\u200d♂️", + "man_swimming_medium-light_skin_tone": "🏊🏼\u200d♂️", + "man_swimming_medium_skin_tone": "🏊🏽\u200d♂️", + "man_teacher": "👨\u200d🏫", + "man_teacher_dark_skin_tone": "👨🏿\u200d🏫", + "man_teacher_light_skin_tone": "👨🏻\u200d🏫", + "man_teacher_medium-dark_skin_tone": "👨🏾\u200d🏫", + "man_teacher_medium-light_skin_tone": "👨🏼\u200d🏫", + "man_teacher_medium_skin_tone": "👨🏽\u200d🏫", + "man_technologist": "👨\u200d💻", + "man_technologist_dark_skin_tone": "👨🏿\u200d💻", + "man_technologist_light_skin_tone": "👨🏻\u200d💻", + "man_technologist_medium-dark_skin_tone": "👨🏾\u200d💻", + "man_technologist_medium-light_skin_tone": "👨🏼\u200d💻", + "man_technologist_medium_skin_tone": "👨🏽\u200d💻", + "man_tipping_hand": "💁\u200d♂️", + "man_tipping_hand_dark_skin_tone": "💁🏿\u200d♂️", + "man_tipping_hand_light_skin_tone": "💁🏻\u200d♂️", + "man_tipping_hand_medium-dark_skin_tone": "💁🏾\u200d♂️", + "man_tipping_hand_medium-light_skin_tone": "💁🏼\u200d♂️", + "man_tipping_hand_medium_skin_tone": "💁🏽\u200d♂️", + "man_vampire": "🧛\u200d♂️", + "man_vampire_dark_skin_tone": "🧛🏿\u200d♂️", + "man_vampire_light_skin_tone": "🧛🏻\u200d♂️", + "man_vampire_medium-dark_skin_tone": "🧛🏾\u200d♂️", + "man_vampire_medium-light_skin_tone": "🧛🏼\u200d♂️", + "man_vampire_medium_skin_tone": "🧛🏽\u200d♂️", + "man_walking": "🚶\u200d♂️", + "man_walking_dark_skin_tone": "🚶🏿\u200d♂️", + "man_walking_light_skin_tone": "🚶🏻\u200d♂️", + "man_walking_medium-dark_skin_tone": "🚶🏾\u200d♂️", + "man_walking_medium-light_skin_tone": "🚶🏼\u200d♂️", + "man_walking_medium_skin_tone": "🚶🏽\u200d♂️", + "man_wearing_turban": "👳\u200d♂️", + "man_wearing_turban_dark_skin_tone": "👳🏿\u200d♂️", + "man_wearing_turban_light_skin_tone": "👳🏻\u200d♂️", + "man_wearing_turban_medium-dark_skin_tone": "👳🏾\u200d♂️", + "man_wearing_turban_medium-light_skin_tone": "👳🏼\u200d♂️", + "man_wearing_turban_medium_skin_tone": "👳🏽\u200d♂️", + "man_with_probing_cane": "👨\u200d🦯", + "man_with_chinese_cap": "👲", + "man_with_chinese_cap_dark_skin_tone": "👲🏿", + "man_with_chinese_cap_light_skin_tone": "👲🏻", + "man_with_chinese_cap_medium-dark_skin_tone": "👲🏾", + "man_with_chinese_cap_medium-light_skin_tone": "👲🏼", + "man_with_chinese_cap_medium_skin_tone": "👲🏽", + "man_zombie": "🧟\u200d♂️", + "mango": "🥭", + "mantelpiece_clock": "🕰", + "manual_wheelchair": "🦽", + "man’s_shoe": "👞", + "map_of_japan": "🗾", + "maple_leaf": "🍁", + "martial_arts_uniform": "🥋", + "mate": "🧉", + "meat_on_bone": "🍖", + "mechanical_arm": "🦾", + "mechanical_leg": "🦿", + "medical_symbol": "⚕", + "megaphone": "📣", + "melon": "🍈", + "memo": "📝", + "men_with_bunny_ears": "👯\u200d♂️", + "men_wrestling": "🤼\u200d♂️", + "menorah": "🕎", + "men’s_room": "🚹", + "mermaid": "🧜\u200d♀️", + "mermaid_dark_skin_tone": "🧜🏿\u200d♀️", + "mermaid_light_skin_tone": "🧜🏻\u200d♀️", + "mermaid_medium-dark_skin_tone": "🧜🏾\u200d♀️", + "mermaid_medium-light_skin_tone": "🧜🏼\u200d♀️", + "mermaid_medium_skin_tone": "🧜🏽\u200d♀️", + "merman": "🧜\u200d♂️", + "merman_dark_skin_tone": "🧜🏿\u200d♂️", + "merman_light_skin_tone": "🧜🏻\u200d♂️", + "merman_medium-dark_skin_tone": "🧜🏾\u200d♂️", + "merman_medium-light_skin_tone": "🧜🏼\u200d♂️", + "merman_medium_skin_tone": "🧜🏽\u200d♂️", + "merperson": "🧜", + "merperson_dark_skin_tone": "🧜🏿", + "merperson_light_skin_tone": "🧜🏻", + "merperson_medium-dark_skin_tone": "🧜🏾", + "merperson_medium-light_skin_tone": "🧜🏼", + "merperson_medium_skin_tone": "🧜🏽", + "metro": "🚇", + "microbe": "🦠", + "microphone": "🎤", + "microscope": "🔬", + "middle_finger": "🖕", + "middle_finger_dark_skin_tone": "🖕🏿", + "middle_finger_light_skin_tone": "🖕🏻", + "middle_finger_medium-dark_skin_tone": "🖕🏾", + "middle_finger_medium-light_skin_tone": "🖕🏼", + "middle_finger_medium_skin_tone": "🖕🏽", + "military_medal": "🎖", + "milky_way": "🌌", + "minibus": "🚐", + "moai": "🗿", + "mobile_phone": "📱", + "mobile_phone_off": "📴", + "mobile_phone_with_arrow": "📲", + "money-mouth_face": "🤑", + "money_bag": "💰", + "money_with_wings": "💸", + "monkey": "🐒", + "monkey_face": "🐵", + "monorail": "🚝", + "moon_cake": "🥮", + "moon_viewing_ceremony": "🎑", + "mosque": "🕌", + "mosquito": "🦟", + "motor_boat": "🛥", + "motor_scooter": "🛵", + "motorcycle": "🏍", + "motorized_wheelchair": "🦼", + "motorway": "🛣", + "mount_fuji": "🗻", + "mountain": "⛰", + "mountain_cableway": "🚠", + "mountain_railway": "🚞", + "mouse": "🐭", + "mouse_face": "🐭", + "mouth": "👄", + "movie_camera": "🎥", + "mushroom": "🍄", + "musical_keyboard": "🎹", + "musical_note": "🎵", + "musical_notes": "🎶", + "musical_score": "🎼", + "muted_speaker": "🔇", + "nail_polish": "💅", + "nail_polish_dark_skin_tone": "💅🏿", + "nail_polish_light_skin_tone": "💅🏻", + "nail_polish_medium-dark_skin_tone": "💅🏾", + "nail_polish_medium-light_skin_tone": "💅🏼", + "nail_polish_medium_skin_tone": "💅🏽", + "name_badge": "📛", + "national_park": "🏞", + "nauseated_face": "🤢", + "nazar_amulet": "🧿", + "necktie": "👔", + "nerd_face": "🤓", + "neutral_face": "😐", + "new_moon": "🌑", + "new_moon_face": "🌚", + "newspaper": "📰", + "next_track_button": "⏭", + "night_with_stars": "🌃", + "nine-thirty": "🕤", + "nine_o’clock": "🕘", + "no_bicycles": "🚳", + "no_entry": "⛔", + "no_littering": "🚯", + "no_mobile_phones": "📵", + "no_one_under_eighteen": "🔞", + "no_pedestrians": "🚷", + "no_smoking": "🚭", + "non-potable_water": "🚱", + "nose": "👃", + "nose_dark_skin_tone": "👃🏿", + "nose_light_skin_tone": "👃🏻", + "nose_medium-dark_skin_tone": "👃🏾", + "nose_medium-light_skin_tone": "👃🏼", + "nose_medium_skin_tone": "👃🏽", + "notebook": "📓", + "notebook_with_decorative_cover": "📔", + "nut_and_bolt": "🔩", + "octopus": "🐙", + "oden": "🍢", + "office_building": "🏢", + "ogre": "👹", + "oil_drum": "🛢", + "old_key": "🗝", + "old_man": "👴", + "old_man_dark_skin_tone": "👴🏿", + "old_man_light_skin_tone": "👴🏻", + "old_man_medium-dark_skin_tone": "👴🏾", + "old_man_medium-light_skin_tone": "👴🏼", + "old_man_medium_skin_tone": "👴🏽", + "old_woman": "👵", + "old_woman_dark_skin_tone": "👵🏿", + "old_woman_light_skin_tone": "👵🏻", + "old_woman_medium-dark_skin_tone": "👵🏾", + "old_woman_medium-light_skin_tone": "👵🏼", + "old_woman_medium_skin_tone": "👵🏽", + "older_adult": "🧓", + "older_adult_dark_skin_tone": "🧓🏿", + "older_adult_light_skin_tone": "🧓🏻", + "older_adult_medium-dark_skin_tone": "🧓🏾", + "older_adult_medium-light_skin_tone": "🧓🏼", + "older_adult_medium_skin_tone": "🧓🏽", + "om": "🕉", + "oncoming_automobile": "🚘", + "oncoming_bus": "🚍", + "oncoming_fist": "👊", + "oncoming_fist_dark_skin_tone": "👊🏿", + "oncoming_fist_light_skin_tone": "👊🏻", + "oncoming_fist_medium-dark_skin_tone": "👊🏾", + "oncoming_fist_medium-light_skin_tone": "👊🏼", + "oncoming_fist_medium_skin_tone": "👊🏽", + "oncoming_police_car": "🚔", + "oncoming_taxi": "🚖", + "one-piece_swimsuit": "🩱", + "one-thirty": "🕜", + "one_o’clock": "🕐", + "onion": "🧅", + "open_book": "📖", + "open_file_folder": "📂", + "open_hands": "👐", + "open_hands_dark_skin_tone": "👐🏿", + "open_hands_light_skin_tone": "👐🏻", + "open_hands_medium-dark_skin_tone": "👐🏾", + "open_hands_medium-light_skin_tone": "👐🏼", + "open_hands_medium_skin_tone": "👐🏽", + "open_mailbox_with_lowered_flag": "📭", + "open_mailbox_with_raised_flag": "📬", + "optical_disk": "💿", + "orange_book": "📙", + "orange_circle": "🟠", + "orange_heart": "🧡", + "orange_square": "🟧", + "orangutan": "🦧", + "orthodox_cross": "☦", + "otter": "🦦", + "outbox_tray": "📤", + "owl": "🦉", + "ox": "🐂", + "oyster": "🦪", + "package": "📦", + "page_facing_up": "📄", + "page_with_curl": "📃", + "pager": "📟", + "paintbrush": "🖌", + "palm_tree": "🌴", + "palms_up_together": "🤲", + "palms_up_together_dark_skin_tone": "🤲🏿", + "palms_up_together_light_skin_tone": "🤲🏻", + "palms_up_together_medium-dark_skin_tone": "🤲🏾", + "palms_up_together_medium-light_skin_tone": "🤲🏼", + "palms_up_together_medium_skin_tone": "🤲🏽", + "pancakes": "🥞", + "panda_face": "🐼", + "paperclip": "📎", + "parrot": "🦜", + "part_alternation_mark": "〽", + "party_popper": "🎉", + "partying_face": "🥳", + "passenger_ship": "🛳", + "passport_control": "🛂", + "pause_button": "⏸", + "paw_prints": "🐾", + "peace_symbol": "☮", + "peach": "🍑", + "peacock": "🦚", + "peanuts": "🥜", + "pear": "🍐", + "pen": "🖊", + "pencil": "📝", + "penguin": "🐧", + "pensive_face": "😔", + "people_holding_hands": "🧑\u200d🤝\u200d🧑", + "people_with_bunny_ears": "👯", + "people_wrestling": "🤼", + "performing_arts": "🎭", + "persevering_face": "😣", + "person_biking": "🚴", + "person_biking_dark_skin_tone": "🚴🏿", + "person_biking_light_skin_tone": "🚴🏻", + "person_biking_medium-dark_skin_tone": "🚴🏾", + "person_biking_medium-light_skin_tone": "🚴🏼", + "person_biking_medium_skin_tone": "🚴🏽", + "person_bouncing_ball": "⛹", + "person_bouncing_ball_dark_skin_tone": "⛹🏿", + "person_bouncing_ball_light_skin_tone": "⛹🏻", + "person_bouncing_ball_medium-dark_skin_tone": "⛹🏾", + "person_bouncing_ball_medium-light_skin_tone": "⛹🏼", + "person_bouncing_ball_medium_skin_tone": "⛹🏽", + "person_bowing": "🙇", + "person_bowing_dark_skin_tone": "🙇🏿", + "person_bowing_light_skin_tone": "🙇🏻", + "person_bowing_medium-dark_skin_tone": "🙇🏾", + "person_bowing_medium-light_skin_tone": "🙇🏼", + "person_bowing_medium_skin_tone": "🙇🏽", + "person_cartwheeling": "🤸", + "person_cartwheeling_dark_skin_tone": "🤸🏿", + "person_cartwheeling_light_skin_tone": "🤸🏻", + "person_cartwheeling_medium-dark_skin_tone": "🤸🏾", + "person_cartwheeling_medium-light_skin_tone": "🤸🏼", + "person_cartwheeling_medium_skin_tone": "🤸🏽", + "person_climbing": "🧗", + "person_climbing_dark_skin_tone": "🧗🏿", + "person_climbing_light_skin_tone": "🧗🏻", + "person_climbing_medium-dark_skin_tone": "🧗🏾", + "person_climbing_medium-light_skin_tone": "🧗🏼", + "person_climbing_medium_skin_tone": "🧗🏽", + "person_facepalming": "🤦", + "person_facepalming_dark_skin_tone": "🤦🏿", + "person_facepalming_light_skin_tone": "🤦🏻", + "person_facepalming_medium-dark_skin_tone": "🤦🏾", + "person_facepalming_medium-light_skin_tone": "🤦🏼", + "person_facepalming_medium_skin_tone": "🤦🏽", + "person_fencing": "🤺", + "person_frowning": "🙍", + "person_frowning_dark_skin_tone": "🙍🏿", + "person_frowning_light_skin_tone": "🙍🏻", + "person_frowning_medium-dark_skin_tone": "🙍🏾", + "person_frowning_medium-light_skin_tone": "🙍🏼", + "person_frowning_medium_skin_tone": "🙍🏽", + "person_gesturing_no": "🙅", + "person_gesturing_no_dark_skin_tone": "🙅🏿", + "person_gesturing_no_light_skin_tone": "🙅🏻", + "person_gesturing_no_medium-dark_skin_tone": "🙅🏾", + "person_gesturing_no_medium-light_skin_tone": "🙅🏼", + "person_gesturing_no_medium_skin_tone": "🙅🏽", + "person_gesturing_ok": "🙆", + "person_gesturing_ok_dark_skin_tone": "🙆🏿", + "person_gesturing_ok_light_skin_tone": "🙆🏻", + "person_gesturing_ok_medium-dark_skin_tone": "🙆🏾", + "person_gesturing_ok_medium-light_skin_tone": "🙆🏼", + "person_gesturing_ok_medium_skin_tone": "🙆🏽", + "person_getting_haircut": "💇", + "person_getting_haircut_dark_skin_tone": "💇🏿", + "person_getting_haircut_light_skin_tone": "💇🏻", + "person_getting_haircut_medium-dark_skin_tone": "💇🏾", + "person_getting_haircut_medium-light_skin_tone": "💇🏼", + "person_getting_haircut_medium_skin_tone": "💇🏽", + "person_getting_massage": "💆", + "person_getting_massage_dark_skin_tone": "💆🏿", + "person_getting_massage_light_skin_tone": "💆🏻", + "person_getting_massage_medium-dark_skin_tone": "💆🏾", + "person_getting_massage_medium-light_skin_tone": "💆🏼", + "person_getting_massage_medium_skin_tone": "💆🏽", + "person_golfing": "🏌", + "person_golfing_dark_skin_tone": "🏌🏿", + "person_golfing_light_skin_tone": "🏌🏻", + "person_golfing_medium-dark_skin_tone": "🏌🏾", + "person_golfing_medium-light_skin_tone": "🏌🏼", + "person_golfing_medium_skin_tone": "🏌🏽", + "person_in_bed": "🛌", + "person_in_bed_dark_skin_tone": "🛌🏿", + "person_in_bed_light_skin_tone": "🛌🏻", + "person_in_bed_medium-dark_skin_tone": "🛌🏾", + "person_in_bed_medium-light_skin_tone": "🛌🏼", + "person_in_bed_medium_skin_tone": "🛌🏽", + "person_in_lotus_position": "🧘", + "person_in_lotus_position_dark_skin_tone": "🧘🏿", + "person_in_lotus_position_light_skin_tone": "🧘🏻", + "person_in_lotus_position_medium-dark_skin_tone": "🧘🏾", + "person_in_lotus_position_medium-light_skin_tone": "🧘🏼", + "person_in_lotus_position_medium_skin_tone": "🧘🏽", + "person_in_steamy_room": "🧖", + "person_in_steamy_room_dark_skin_tone": "🧖🏿", + "person_in_steamy_room_light_skin_tone": "🧖🏻", + "person_in_steamy_room_medium-dark_skin_tone": "🧖🏾", + "person_in_steamy_room_medium-light_skin_tone": "🧖🏼", + "person_in_steamy_room_medium_skin_tone": "🧖🏽", + "person_juggling": "🤹", + "person_juggling_dark_skin_tone": "🤹🏿", + "person_juggling_light_skin_tone": "🤹🏻", + "person_juggling_medium-dark_skin_tone": "🤹🏾", + "person_juggling_medium-light_skin_tone": "🤹🏼", + "person_juggling_medium_skin_tone": "🤹🏽", + "person_kneeling": "🧎", + "person_lifting_weights": "🏋", + "person_lifting_weights_dark_skin_tone": "🏋🏿", + "person_lifting_weights_light_skin_tone": "🏋🏻", + "person_lifting_weights_medium-dark_skin_tone": "🏋🏾", + "person_lifting_weights_medium-light_skin_tone": "🏋🏼", + "person_lifting_weights_medium_skin_tone": "🏋🏽", + "person_mountain_biking": "🚵", + "person_mountain_biking_dark_skin_tone": "🚵🏿", + "person_mountain_biking_light_skin_tone": "🚵🏻", + "person_mountain_biking_medium-dark_skin_tone": "🚵🏾", + "person_mountain_biking_medium-light_skin_tone": "🚵🏼", + "person_mountain_biking_medium_skin_tone": "🚵🏽", + "person_playing_handball": "🤾", + "person_playing_handball_dark_skin_tone": "🤾🏿", + "person_playing_handball_light_skin_tone": "🤾🏻", + "person_playing_handball_medium-dark_skin_tone": "🤾🏾", + "person_playing_handball_medium-light_skin_tone": "🤾🏼", + "person_playing_handball_medium_skin_tone": "🤾🏽", + "person_playing_water_polo": "🤽", + "person_playing_water_polo_dark_skin_tone": "🤽🏿", + "person_playing_water_polo_light_skin_tone": "🤽🏻", + "person_playing_water_polo_medium-dark_skin_tone": "🤽🏾", + "person_playing_water_polo_medium-light_skin_tone": "🤽🏼", + "person_playing_water_polo_medium_skin_tone": "🤽🏽", + "person_pouting": "🙎", + "person_pouting_dark_skin_tone": "🙎🏿", + "person_pouting_light_skin_tone": "🙎🏻", + "person_pouting_medium-dark_skin_tone": "🙎🏾", + "person_pouting_medium-light_skin_tone": "🙎🏼", + "person_pouting_medium_skin_tone": "🙎🏽", + "person_raising_hand": "🙋", + "person_raising_hand_dark_skin_tone": "🙋🏿", + "person_raising_hand_light_skin_tone": "🙋🏻", + "person_raising_hand_medium-dark_skin_tone": "🙋🏾", + "person_raising_hand_medium-light_skin_tone": "🙋🏼", + "person_raising_hand_medium_skin_tone": "🙋🏽", + "person_rowing_boat": "🚣", + "person_rowing_boat_dark_skin_tone": "🚣🏿", + "person_rowing_boat_light_skin_tone": "🚣🏻", + "person_rowing_boat_medium-dark_skin_tone": "🚣🏾", + "person_rowing_boat_medium-light_skin_tone": "🚣🏼", + "person_rowing_boat_medium_skin_tone": "🚣🏽", + "person_running": "🏃", + "person_running_dark_skin_tone": "🏃🏿", + "person_running_light_skin_tone": "🏃🏻", + "person_running_medium-dark_skin_tone": "🏃🏾", + "person_running_medium-light_skin_tone": "🏃🏼", + "person_running_medium_skin_tone": "🏃🏽", + "person_shrugging": "🤷", + "person_shrugging_dark_skin_tone": "🤷🏿", + "person_shrugging_light_skin_tone": "🤷🏻", + "person_shrugging_medium-dark_skin_tone": "🤷🏾", + "person_shrugging_medium-light_skin_tone": "🤷🏼", + "person_shrugging_medium_skin_tone": "🤷🏽", + "person_standing": "🧍", + "person_surfing": "🏄", + "person_surfing_dark_skin_tone": "🏄🏿", + "person_surfing_light_skin_tone": "🏄🏻", + "person_surfing_medium-dark_skin_tone": "🏄🏾", + "person_surfing_medium-light_skin_tone": "🏄🏼", + "person_surfing_medium_skin_tone": "🏄🏽", + "person_swimming": "🏊", + "person_swimming_dark_skin_tone": "🏊🏿", + "person_swimming_light_skin_tone": "🏊🏻", + "person_swimming_medium-dark_skin_tone": "🏊🏾", + "person_swimming_medium-light_skin_tone": "🏊🏼", + "person_swimming_medium_skin_tone": "🏊🏽", + "person_taking_bath": "🛀", + "person_taking_bath_dark_skin_tone": "🛀🏿", + "person_taking_bath_light_skin_tone": "🛀🏻", + "person_taking_bath_medium-dark_skin_tone": "🛀🏾", + "person_taking_bath_medium-light_skin_tone": "🛀🏼", + "person_taking_bath_medium_skin_tone": "🛀🏽", + "person_tipping_hand": "💁", + "person_tipping_hand_dark_skin_tone": "💁🏿", + "person_tipping_hand_light_skin_tone": "💁🏻", + "person_tipping_hand_medium-dark_skin_tone": "💁🏾", + "person_tipping_hand_medium-light_skin_tone": "💁🏼", + "person_tipping_hand_medium_skin_tone": "💁🏽", + "person_walking": "🚶", + "person_walking_dark_skin_tone": "🚶🏿", + "person_walking_light_skin_tone": "🚶🏻", + "person_walking_medium-dark_skin_tone": "🚶🏾", + "person_walking_medium-light_skin_tone": "🚶🏼", + "person_walking_medium_skin_tone": "🚶🏽", + "person_wearing_turban": "👳", + "person_wearing_turban_dark_skin_tone": "👳🏿", + "person_wearing_turban_light_skin_tone": "👳🏻", + "person_wearing_turban_medium-dark_skin_tone": "👳🏾", + "person_wearing_turban_medium-light_skin_tone": "👳🏼", + "person_wearing_turban_medium_skin_tone": "👳🏽", + "petri_dish": "🧫", + "pick": "⛏", + "pie": "🥧", + "pig": "🐷", + "pig_face": "🐷", + "pig_nose": "🐽", + "pile_of_poo": "💩", + "pill": "💊", + "pinching_hand": "🤏", + "pine_decoration": "🎍", + "pineapple": "🍍", + "ping_pong": "🏓", + "pirate_flag": "🏴\u200d☠️", + "pistol": "🔫", + "pizza": "🍕", + "place_of_worship": "🛐", + "play_button": "▶", + "play_or_pause_button": "⏯", + "pleading_face": "🥺", + "police_car": "🚓", + "police_car_light": "🚨", + "police_officer": "👮", + "police_officer_dark_skin_tone": "👮🏿", + "police_officer_light_skin_tone": "👮🏻", + "police_officer_medium-dark_skin_tone": "👮🏾", + "police_officer_medium-light_skin_tone": "👮🏼", + "police_officer_medium_skin_tone": "👮🏽", + "poodle": "🐩", + "pool_8_ball": "🎱", + "popcorn": "🍿", + "post_office": "🏣", + "postal_horn": "📯", + "postbox": "📮", + "pot_of_food": "🍲", + "potable_water": "🚰", + "potato": "🥔", + "poultry_leg": "🍗", + "pound_banknote": "💷", + "pouting_cat_face": "😾", + "pouting_face": "😡", + "prayer_beads": "📿", + "pregnant_woman": "🤰", + "pregnant_woman_dark_skin_tone": "🤰🏿", + "pregnant_woman_light_skin_tone": "🤰🏻", + "pregnant_woman_medium-dark_skin_tone": "🤰🏾", + "pregnant_woman_medium-light_skin_tone": "🤰🏼", + "pregnant_woman_medium_skin_tone": "🤰🏽", + "pretzel": "🥨", + "probing_cane": "🦯", + "prince": "🤴", + "prince_dark_skin_tone": "🤴🏿", + "prince_light_skin_tone": "🤴🏻", + "prince_medium-dark_skin_tone": "🤴🏾", + "prince_medium-light_skin_tone": "🤴🏼", + "prince_medium_skin_tone": "🤴🏽", + "princess": "👸", + "princess_dark_skin_tone": "👸🏿", + "princess_light_skin_tone": "👸🏻", + "princess_medium-dark_skin_tone": "👸🏾", + "princess_medium-light_skin_tone": "👸🏼", + "princess_medium_skin_tone": "👸🏽", + "printer": "🖨", + "prohibited": "🚫", + "purple_circle": "🟣", + "purple_heart": "💜", + "purple_square": "🟪", + "purse": "👛", + "pushpin": "📌", + "question_mark": "❓", + "rabbit": "🐰", + "rabbit_face": "🐰", + "raccoon": "🦝", + "racing_car": "🏎", + "radio": "📻", + "radio_button": "🔘", + "radioactive": "☢", + "railway_car": "🚃", + "railway_track": "🛤", + "rainbow": "🌈", + "rainbow_flag": "🏳️\u200d🌈", + "raised_back_of_hand": "🤚", + "raised_back_of_hand_dark_skin_tone": "🤚🏿", + "raised_back_of_hand_light_skin_tone": "🤚🏻", + "raised_back_of_hand_medium-dark_skin_tone": "🤚🏾", + "raised_back_of_hand_medium-light_skin_tone": "🤚🏼", + "raised_back_of_hand_medium_skin_tone": "🤚🏽", + "raised_fist": "✊", + "raised_fist_dark_skin_tone": "✊🏿", + "raised_fist_light_skin_tone": "✊🏻", + "raised_fist_medium-dark_skin_tone": "✊🏾", + "raised_fist_medium-light_skin_tone": "✊🏼", + "raised_fist_medium_skin_tone": "✊🏽", + "raised_hand": "✋", + "raised_hand_dark_skin_tone": "✋🏿", + "raised_hand_light_skin_tone": "✋🏻", + "raised_hand_medium-dark_skin_tone": "✋🏾", + "raised_hand_medium-light_skin_tone": "✋🏼", + "raised_hand_medium_skin_tone": "✋🏽", + "raising_hands": "🙌", + "raising_hands_dark_skin_tone": "🙌🏿", + "raising_hands_light_skin_tone": "🙌🏻", + "raising_hands_medium-dark_skin_tone": "🙌🏾", + "raising_hands_medium-light_skin_tone": "🙌🏼", + "raising_hands_medium_skin_tone": "🙌🏽", + "ram": "🐏", + "rat": "🐀", + "razor": "🪒", + "ringed_planet": "🪐", + "receipt": "🧾", + "record_button": "⏺", + "recycling_symbol": "♻", + "red_apple": "🍎", + "red_circle": "🔴", + "red_envelope": "🧧", + "red_hair": "🦰", + "red-haired_man": "👨\u200d🦰", + "red-haired_woman": "👩\u200d🦰", + "red_heart": "❤", + "red_paper_lantern": "🏮", + "red_square": "🟥", + "red_triangle_pointed_down": "🔻", + "red_triangle_pointed_up": "🔺", + "registered": "®", + "relieved_face": "😌", + "reminder_ribbon": "🎗", + "repeat_button": "🔁", + "repeat_single_button": "🔂", + "rescue_worker’s_helmet": "⛑", + "restroom": "🚻", + "reverse_button": "◀", + "revolving_hearts": "💞", + "rhinoceros": "🦏", + "ribbon": "🎀", + "rice_ball": "🍙", + "rice_cracker": "🍘", + "right-facing_fist": "🤜", + "right-facing_fist_dark_skin_tone": "🤜🏿", + "right-facing_fist_light_skin_tone": "🤜🏻", + "right-facing_fist_medium-dark_skin_tone": "🤜🏾", + "right-facing_fist_medium-light_skin_tone": "🤜🏼", + "right-facing_fist_medium_skin_tone": "🤜🏽", + "right_anger_bubble": "🗯", + "right_arrow": "➡", + "right_arrow_curving_down": "⤵", + "right_arrow_curving_left": "↩", + "right_arrow_curving_up": "⤴", + "ring": "💍", + "roasted_sweet_potato": "🍠", + "robot_face": "🤖", + "rocket": "🚀", + "roll_of_paper": "🧻", + "rolled-up_newspaper": "🗞", + "roller_coaster": "🎢", + "rolling_on_the_floor_laughing": "🤣", + "rooster": "🐓", + "rose": "🌹", + "rosette": "🏵", + "round_pushpin": "📍", + "rugby_football": "🏉", + "running_shirt": "🎽", + "running_shoe": "👟", + "sad_but_relieved_face": "😥", + "safety_pin": "🧷", + "safety_vest": "🦺", + "salt": "🧂", + "sailboat": "⛵", + "sake": "🍶", + "sandwich": "🥪", + "sari": "🥻", + "satellite": "📡", + "satellite_antenna": "📡", + "sauropod": "🦕", + "saxophone": "🎷", + "scarf": "🧣", + "school": "🏫", + "school_backpack": "🎒", + "scissors": "✂", + "scorpion": "🦂", + "scroll": "📜", + "seat": "💺", + "see-no-evil_monkey": "🙈", + "seedling": "🌱", + "selfie": "🤳", + "selfie_dark_skin_tone": "🤳🏿", + "selfie_light_skin_tone": "🤳🏻", + "selfie_medium-dark_skin_tone": "🤳🏾", + "selfie_medium-light_skin_tone": "🤳🏼", + "selfie_medium_skin_tone": "🤳🏽", + "service_dog": "🐕\u200d🦺", + "seven-thirty": "🕢", + "seven_o’clock": "🕖", + "shallow_pan_of_food": "🥘", + "shamrock": "☘", + "shark": "🦈", + "shaved_ice": "🍧", + "sheaf_of_rice": "🌾", + "shield": "🛡", + "shinto_shrine": "⛩", + "ship": "🚢", + "shooting_star": "🌠", + "shopping_bags": "🛍", + "shopping_cart": "🛒", + "shortcake": "🍰", + "shorts": "🩳", + "shower": "🚿", + "shrimp": "🦐", + "shuffle_tracks_button": "🔀", + "shushing_face": "🤫", + "sign_of_the_horns": "🤘", + "sign_of_the_horns_dark_skin_tone": "🤘🏿", + "sign_of_the_horns_light_skin_tone": "🤘🏻", + "sign_of_the_horns_medium-dark_skin_tone": "🤘🏾", + "sign_of_the_horns_medium-light_skin_tone": "🤘🏼", + "sign_of_the_horns_medium_skin_tone": "🤘🏽", + "six-thirty": "🕡", + "six_o’clock": "🕕", + "skateboard": "🛹", + "skier": "⛷", + "skis": "🎿", + "skull": "💀", + "skull_and_crossbones": "☠", + "skunk": "🦨", + "sled": "🛷", + "sleeping_face": "😴", + "sleepy_face": "😪", + "slightly_frowning_face": "🙁", + "slightly_smiling_face": "🙂", + "slot_machine": "🎰", + "sloth": "🦥", + "small_airplane": "🛩", + "small_blue_diamond": "🔹", + "small_orange_diamond": "🔸", + "smiling_cat_face_with_heart-eyes": "😻", + "smiling_face": "☺", + "smiling_face_with_halo": "😇", + "smiling_face_with_3_hearts": "🥰", + "smiling_face_with_heart-eyes": "😍", + "smiling_face_with_horns": "😈", + "smiling_face_with_smiling_eyes": "😊", + "smiling_face_with_sunglasses": "😎", + "smirking_face": "😏", + "snail": "🐌", + "snake": "🐍", + "sneezing_face": "🤧", + "snow-capped_mountain": "🏔", + "snowboarder": "🏂", + "snowboarder_dark_skin_tone": "🏂🏿", + "snowboarder_light_skin_tone": "🏂🏻", + "snowboarder_medium-dark_skin_tone": "🏂🏾", + "snowboarder_medium-light_skin_tone": "🏂🏼", + "snowboarder_medium_skin_tone": "🏂🏽", + "snowflake": "❄", + "snowman": "☃", + "snowman_without_snow": "⛄", + "soap": "🧼", + "soccer_ball": "⚽", + "socks": "🧦", + "softball": "🥎", + "soft_ice_cream": "🍦", + "spade_suit": "♠", + "spaghetti": "🍝", + "sparkle": "❇", + "sparkler": "🎇", + "sparkles": "✨", + "sparkling_heart": "💖", + "speak-no-evil_monkey": "🙊", + "speaker_high_volume": "🔊", + "speaker_low_volume": "🔈", + "speaker_medium_volume": "🔉", + "speaking_head": "🗣", + "speech_balloon": "💬", + "speedboat": "🚤", + "spider": "🕷", + "spider_web": "🕸", + "spiral_calendar": "🗓", + "spiral_notepad": "🗒", + "spiral_shell": "🐚", + "spoon": "🥄", + "sponge": "🧽", + "sport_utility_vehicle": "🚙", + "sports_medal": "🏅", + "spouting_whale": "🐳", + "squid": "🦑", + "squinting_face_with_tongue": "😝", + "stadium": "🏟", + "star-struck": "🤩", + "star_and_crescent": "☪", + "star_of_david": "✡", + "station": "🚉", + "steaming_bowl": "🍜", + "stethoscope": "🩺", + "stop_button": "⏹", + "stop_sign": "🛑", + "stopwatch": "⏱", + "straight_ruler": "📏", + "strawberry": "🍓", + "studio_microphone": "🎙", + "stuffed_flatbread": "🥙", + "sun": "☀", + "sun_behind_cloud": "⛅", + "sun_behind_large_cloud": "🌥", + "sun_behind_rain_cloud": "🌦", + "sun_behind_small_cloud": "🌤", + "sun_with_face": "🌞", + "sunflower": "🌻", + "sunglasses": "😎", + "sunrise": "🌅", + "sunrise_over_mountains": "🌄", + "sunset": "🌇", + "superhero": "🦸", + "supervillain": "🦹", + "sushi": "🍣", + "suspension_railway": "🚟", + "swan": "🦢", + "sweat_droplets": "💦", + "synagogue": "🕍", + "syringe": "💉", + "t-shirt": "👕", + "taco": "🌮", + "takeout_box": "🥡", + "tanabata_tree": "🎋", + "tangerine": "🍊", + "taxi": "🚕", + "teacup_without_handle": "🍵", + "tear-off_calendar": "📆", + "teddy_bear": "🧸", + "telephone": "☎", + "telephone_receiver": "📞", + "telescope": "🔭", + "television": "📺", + "ten-thirty": "🕥", + "ten_o’clock": "🕙", + "tennis": "🎾", + "tent": "⛺", + "test_tube": "🧪", + "thermometer": "🌡", + "thinking_face": "🤔", + "thought_balloon": "💭", + "thread": "🧵", + "three-thirty": "🕞", + "three_o’clock": "🕒", + "thumbs_down": "👎", + "thumbs_down_dark_skin_tone": "👎🏿", + "thumbs_down_light_skin_tone": "👎🏻", + "thumbs_down_medium-dark_skin_tone": "👎🏾", + "thumbs_down_medium-light_skin_tone": "👎🏼", + "thumbs_down_medium_skin_tone": "👎🏽", + "thumbs_up": "👍", + "thumbs_up_dark_skin_tone": "👍🏿", + "thumbs_up_light_skin_tone": "👍🏻", + "thumbs_up_medium-dark_skin_tone": "👍🏾", + "thumbs_up_medium-light_skin_tone": "👍🏼", + "thumbs_up_medium_skin_tone": "👍🏽", + "ticket": "🎫", + "tiger": "🐯", + "tiger_face": "🐯", + "timer_clock": "⏲", + "tired_face": "😫", + "toolbox": "🧰", + "toilet": "🚽", + "tomato": "🍅", + "tongue": "👅", + "tooth": "🦷", + "top_hat": "🎩", + "tornado": "🌪", + "trackball": "🖲", + "tractor": "🚜", + "trade_mark": "™", + "train": "🚋", + "tram": "🚊", + "tram_car": "🚋", + "triangular_flag": "🚩", + "triangular_ruler": "📐", + "trident_emblem": "🔱", + "trolleybus": "🚎", + "trophy": "🏆", + "tropical_drink": "🍹", + "tropical_fish": "🐠", + "trumpet": "🎺", + "tulip": "🌷", + "tumbler_glass": "🥃", + "turtle": "🐢", + "twelve-thirty": "🕧", + "twelve_o’clock": "🕛", + "two-hump_camel": "🐫", + "two-thirty": "🕝", + "two_hearts": "💕", + "two_men_holding_hands": "👬", + "two_o’clock": "🕑", + "two_women_holding_hands": "👭", + "umbrella": "☂", + "umbrella_on_ground": "⛱", + "umbrella_with_rain_drops": "☔", + "unamused_face": "😒", + "unicorn_face": "🦄", + "unlocked": "🔓", + "up-down_arrow": "↕", + "up-left_arrow": "↖", + "up-right_arrow": "↗", + "up_arrow": "⬆", + "upside-down_face": "🙃", + "upwards_button": "🔼", + "vampire": "🧛", + "vampire_dark_skin_tone": "🧛🏿", + "vampire_light_skin_tone": "🧛🏻", + "vampire_medium-dark_skin_tone": "🧛🏾", + "vampire_medium-light_skin_tone": "🧛🏼", + "vampire_medium_skin_tone": "🧛🏽", + "vertical_traffic_light": "🚦", + "vibration_mode": "📳", + "victory_hand": "✌", + "victory_hand_dark_skin_tone": "✌🏿", + "victory_hand_light_skin_tone": "✌🏻", + "victory_hand_medium-dark_skin_tone": "✌🏾", + "victory_hand_medium-light_skin_tone": "✌🏼", + "victory_hand_medium_skin_tone": "✌🏽", + "video_camera": "📹", + "video_game": "🎮", + "videocassette": "📼", + "violin": "🎻", + "volcano": "🌋", + "volleyball": "🏐", + "vulcan_salute": "🖖", + "vulcan_salute_dark_skin_tone": "🖖🏿", + "vulcan_salute_light_skin_tone": "🖖🏻", + "vulcan_salute_medium-dark_skin_tone": "🖖🏾", + "vulcan_salute_medium-light_skin_tone": "🖖🏼", + "vulcan_salute_medium_skin_tone": "🖖🏽", + "waffle": "🧇", + "waning_crescent_moon": "🌘", + "waning_gibbous_moon": "🌖", + "warning": "⚠", + "wastebasket": "🗑", + "watch": "⌚", + "water_buffalo": "🐃", + "water_closet": "🚾", + "water_wave": "🌊", + "watermelon": "🍉", + "waving_hand": "👋", + "waving_hand_dark_skin_tone": "👋🏿", + "waving_hand_light_skin_tone": "👋🏻", + "waving_hand_medium-dark_skin_tone": "👋🏾", + "waving_hand_medium-light_skin_tone": "👋🏼", + "waving_hand_medium_skin_tone": "👋🏽", + "wavy_dash": "〰", + "waxing_crescent_moon": "🌒", + "waxing_gibbous_moon": "🌔", + "weary_cat_face": "🙀", + "weary_face": "😩", + "wedding": "💒", + "whale": "🐳", + "wheel_of_dharma": "☸", + "wheelchair_symbol": "♿", + "white_circle": "⚪", + "white_exclamation_mark": "❕", + "white_flag": "🏳", + "white_flower": "💮", + "white_hair": "🦳", + "white-haired_man": "👨\u200d🦳", + "white-haired_woman": "👩\u200d🦳", + "white_heart": "🤍", + "white_heavy_check_mark": "✅", + "white_large_square": "⬜", + "white_medium-small_square": "◽", + "white_medium_square": "◻", + "white_medium_star": "⭐", + "white_question_mark": "❔", + "white_small_square": "▫", + "white_square_button": "🔳", + "wilted_flower": "🥀", + "wind_chime": "🎐", + "wind_face": "🌬", + "wine_glass": "🍷", + "winking_face": "😉", + "winking_face_with_tongue": "😜", + "wolf_face": "🐺", + "woman": "👩", + "woman_artist": "👩\u200d🎨", + "woman_artist_dark_skin_tone": "👩🏿\u200d🎨", + "woman_artist_light_skin_tone": "👩🏻\u200d🎨", + "woman_artist_medium-dark_skin_tone": "👩🏾\u200d🎨", + "woman_artist_medium-light_skin_tone": "👩🏼\u200d🎨", + "woman_artist_medium_skin_tone": "👩🏽\u200d🎨", + "woman_astronaut": "👩\u200d🚀", + "woman_astronaut_dark_skin_tone": "👩🏿\u200d🚀", + "woman_astronaut_light_skin_tone": "👩🏻\u200d🚀", + "woman_astronaut_medium-dark_skin_tone": "👩🏾\u200d🚀", + "woman_astronaut_medium-light_skin_tone": "👩🏼\u200d🚀", + "woman_astronaut_medium_skin_tone": "👩🏽\u200d🚀", + "woman_biking": "🚴\u200d♀️", + "woman_biking_dark_skin_tone": "🚴🏿\u200d♀️", + "woman_biking_light_skin_tone": "🚴🏻\u200d♀️", + "woman_biking_medium-dark_skin_tone": "🚴🏾\u200d♀️", + "woman_biking_medium-light_skin_tone": "🚴🏼\u200d♀️", + "woman_biking_medium_skin_tone": "🚴🏽\u200d♀️", + "woman_bouncing_ball": "⛹️\u200d♀️", + "woman_bouncing_ball_dark_skin_tone": "⛹🏿\u200d♀️", + "woman_bouncing_ball_light_skin_tone": "⛹🏻\u200d♀️", + "woman_bouncing_ball_medium-dark_skin_tone": "⛹🏾\u200d♀️", + "woman_bouncing_ball_medium-light_skin_tone": "⛹🏼\u200d♀️", + "woman_bouncing_ball_medium_skin_tone": "⛹🏽\u200d♀️", + "woman_bowing": "🙇\u200d♀️", + "woman_bowing_dark_skin_tone": "🙇🏿\u200d♀️", + "woman_bowing_light_skin_tone": "🙇🏻\u200d♀️", + "woman_bowing_medium-dark_skin_tone": "🙇🏾\u200d♀️", + "woman_bowing_medium-light_skin_tone": "🙇🏼\u200d♀️", + "woman_bowing_medium_skin_tone": "🙇🏽\u200d♀️", + "woman_cartwheeling": "🤸\u200d♀️", + "woman_cartwheeling_dark_skin_tone": "🤸🏿\u200d♀️", + "woman_cartwheeling_light_skin_tone": "🤸🏻\u200d♀️", + "woman_cartwheeling_medium-dark_skin_tone": "🤸🏾\u200d♀️", + "woman_cartwheeling_medium-light_skin_tone": "🤸🏼\u200d♀️", + "woman_cartwheeling_medium_skin_tone": "🤸🏽\u200d♀️", + "woman_climbing": "🧗\u200d♀️", + "woman_climbing_dark_skin_tone": "🧗🏿\u200d♀️", + "woman_climbing_light_skin_tone": "🧗🏻\u200d♀️", + "woman_climbing_medium-dark_skin_tone": "🧗🏾\u200d♀️", + "woman_climbing_medium-light_skin_tone": "🧗🏼\u200d♀️", + "woman_climbing_medium_skin_tone": "🧗🏽\u200d♀️", + "woman_construction_worker": "👷\u200d♀️", + "woman_construction_worker_dark_skin_tone": "👷🏿\u200d♀️", + "woman_construction_worker_light_skin_tone": "👷🏻\u200d♀️", + "woman_construction_worker_medium-dark_skin_tone": "👷🏾\u200d♀️", + "woman_construction_worker_medium-light_skin_tone": "👷🏼\u200d♀️", + "woman_construction_worker_medium_skin_tone": "👷🏽\u200d♀️", + "woman_cook": "👩\u200d🍳", + "woman_cook_dark_skin_tone": "👩🏿\u200d🍳", + "woman_cook_light_skin_tone": "👩🏻\u200d🍳", + "woman_cook_medium-dark_skin_tone": "👩🏾\u200d🍳", + "woman_cook_medium-light_skin_tone": "👩🏼\u200d🍳", + "woman_cook_medium_skin_tone": "👩🏽\u200d🍳", + "woman_dancing": "💃", + "woman_dancing_dark_skin_tone": "💃🏿", + "woman_dancing_light_skin_tone": "💃🏻", + "woman_dancing_medium-dark_skin_tone": "💃🏾", + "woman_dancing_medium-light_skin_tone": "💃🏼", + "woman_dancing_medium_skin_tone": "💃🏽", + "woman_dark_skin_tone": "👩🏿", + "woman_detective": "🕵️\u200d♀️", + "woman_detective_dark_skin_tone": "🕵🏿\u200d♀️", + "woman_detective_light_skin_tone": "🕵🏻\u200d♀️", + "woman_detective_medium-dark_skin_tone": "🕵🏾\u200d♀️", + "woman_detective_medium-light_skin_tone": "🕵🏼\u200d♀️", + "woman_detective_medium_skin_tone": "🕵🏽\u200d♀️", + "woman_elf": "🧝\u200d♀️", + "woman_elf_dark_skin_tone": "🧝🏿\u200d♀️", + "woman_elf_light_skin_tone": "🧝🏻\u200d♀️", + "woman_elf_medium-dark_skin_tone": "🧝🏾\u200d♀️", + "woman_elf_medium-light_skin_tone": "🧝🏼\u200d♀️", + "woman_elf_medium_skin_tone": "🧝🏽\u200d♀️", + "woman_facepalming": "🤦\u200d♀️", + "woman_facepalming_dark_skin_tone": "🤦🏿\u200d♀️", + "woman_facepalming_light_skin_tone": "🤦🏻\u200d♀️", + "woman_facepalming_medium-dark_skin_tone": "🤦🏾\u200d♀️", + "woman_facepalming_medium-light_skin_tone": "🤦🏼\u200d♀️", + "woman_facepalming_medium_skin_tone": "🤦🏽\u200d♀️", + "woman_factory_worker": "👩\u200d🏭", + "woman_factory_worker_dark_skin_tone": "👩🏿\u200d🏭", + "woman_factory_worker_light_skin_tone": "👩🏻\u200d🏭", + "woman_factory_worker_medium-dark_skin_tone": "👩🏾\u200d🏭", + "woman_factory_worker_medium-light_skin_tone": "👩🏼\u200d🏭", + "woman_factory_worker_medium_skin_tone": "👩🏽\u200d🏭", + "woman_fairy": "🧚\u200d♀️", + "woman_fairy_dark_skin_tone": "🧚🏿\u200d♀️", + "woman_fairy_light_skin_tone": "🧚🏻\u200d♀️", + "woman_fairy_medium-dark_skin_tone": "🧚🏾\u200d♀️", + "woman_fairy_medium-light_skin_tone": "🧚🏼\u200d♀️", + "woman_fairy_medium_skin_tone": "🧚🏽\u200d♀️", + "woman_farmer": "👩\u200d🌾", + "woman_farmer_dark_skin_tone": "👩🏿\u200d🌾", + "woman_farmer_light_skin_tone": "👩🏻\u200d🌾", + "woman_farmer_medium-dark_skin_tone": "👩🏾\u200d🌾", + "woman_farmer_medium-light_skin_tone": "👩🏼\u200d🌾", + "woman_farmer_medium_skin_tone": "👩🏽\u200d🌾", + "woman_firefighter": "👩\u200d🚒", + "woman_firefighter_dark_skin_tone": "👩🏿\u200d🚒", + "woman_firefighter_light_skin_tone": "👩🏻\u200d🚒", + "woman_firefighter_medium-dark_skin_tone": "👩🏾\u200d🚒", + "woman_firefighter_medium-light_skin_tone": "👩🏼\u200d🚒", + "woman_firefighter_medium_skin_tone": "👩🏽\u200d🚒", + "woman_frowning": "🙍\u200d♀️", + "woman_frowning_dark_skin_tone": "🙍🏿\u200d♀️", + "woman_frowning_light_skin_tone": "🙍🏻\u200d♀️", + "woman_frowning_medium-dark_skin_tone": "🙍🏾\u200d♀️", + "woman_frowning_medium-light_skin_tone": "🙍🏼\u200d♀️", + "woman_frowning_medium_skin_tone": "🙍🏽\u200d♀️", + "woman_genie": "🧞\u200d♀️", + "woman_gesturing_no": "🙅\u200d♀️", + "woman_gesturing_no_dark_skin_tone": "🙅🏿\u200d♀️", + "woman_gesturing_no_light_skin_tone": "🙅🏻\u200d♀️", + "woman_gesturing_no_medium-dark_skin_tone": "🙅🏾\u200d♀️", + "woman_gesturing_no_medium-light_skin_tone": "🙅🏼\u200d♀️", + "woman_gesturing_no_medium_skin_tone": "🙅🏽\u200d♀️", + "woman_gesturing_ok": "🙆\u200d♀️", + "woman_gesturing_ok_dark_skin_tone": "🙆🏿\u200d♀️", + "woman_gesturing_ok_light_skin_tone": "🙆🏻\u200d♀️", + "woman_gesturing_ok_medium-dark_skin_tone": "🙆🏾\u200d♀️", + "woman_gesturing_ok_medium-light_skin_tone": "🙆🏼\u200d♀️", + "woman_gesturing_ok_medium_skin_tone": "🙆🏽\u200d♀️", + "woman_getting_haircut": "💇\u200d♀️", + "woman_getting_haircut_dark_skin_tone": "💇🏿\u200d♀️", + "woman_getting_haircut_light_skin_tone": "💇🏻\u200d♀️", + "woman_getting_haircut_medium-dark_skin_tone": "💇🏾\u200d♀️", + "woman_getting_haircut_medium-light_skin_tone": "💇🏼\u200d♀️", + "woman_getting_haircut_medium_skin_tone": "💇🏽\u200d♀️", + "woman_getting_massage": "💆\u200d♀️", + "woman_getting_massage_dark_skin_tone": "💆🏿\u200d♀️", + "woman_getting_massage_light_skin_tone": "💆🏻\u200d♀️", + "woman_getting_massage_medium-dark_skin_tone": "💆🏾\u200d♀️", + "woman_getting_massage_medium-light_skin_tone": "💆🏼\u200d♀️", + "woman_getting_massage_medium_skin_tone": "💆🏽\u200d♀️", + "woman_golfing": "🏌️\u200d♀️", + "woman_golfing_dark_skin_tone": "🏌🏿\u200d♀️", + "woman_golfing_light_skin_tone": "🏌🏻\u200d♀️", + "woman_golfing_medium-dark_skin_tone": "🏌🏾\u200d♀️", + "woman_golfing_medium-light_skin_tone": "🏌🏼\u200d♀️", + "woman_golfing_medium_skin_tone": "🏌🏽\u200d♀️", + "woman_guard": "💂\u200d♀️", + "woman_guard_dark_skin_tone": "💂🏿\u200d♀️", + "woman_guard_light_skin_tone": "💂🏻\u200d♀️", + "woman_guard_medium-dark_skin_tone": "💂🏾\u200d♀️", + "woman_guard_medium-light_skin_tone": "💂🏼\u200d♀️", + "woman_guard_medium_skin_tone": "💂🏽\u200d♀️", + "woman_health_worker": "👩\u200d⚕️", + "woman_health_worker_dark_skin_tone": "👩🏿\u200d⚕️", + "woman_health_worker_light_skin_tone": "👩🏻\u200d⚕️", + "woman_health_worker_medium-dark_skin_tone": "👩🏾\u200d⚕️", + "woman_health_worker_medium-light_skin_tone": "👩🏼\u200d⚕️", + "woman_health_worker_medium_skin_tone": "👩🏽\u200d⚕️", + "woman_in_lotus_position": "🧘\u200d♀️", + "woman_in_lotus_position_dark_skin_tone": "🧘🏿\u200d♀️", + "woman_in_lotus_position_light_skin_tone": "🧘🏻\u200d♀️", + "woman_in_lotus_position_medium-dark_skin_tone": "🧘🏾\u200d♀️", + "woman_in_lotus_position_medium-light_skin_tone": "🧘🏼\u200d♀️", + "woman_in_lotus_position_medium_skin_tone": "🧘🏽\u200d♀️", + "woman_in_manual_wheelchair": "👩\u200d🦽", + "woman_in_motorized_wheelchair": "👩\u200d🦼", + "woman_in_steamy_room": "🧖\u200d♀️", + "woman_in_steamy_room_dark_skin_tone": "🧖🏿\u200d♀️", + "woman_in_steamy_room_light_skin_tone": "🧖🏻\u200d♀️", + "woman_in_steamy_room_medium-dark_skin_tone": "🧖🏾\u200d♀️", + "woman_in_steamy_room_medium-light_skin_tone": "🧖🏼\u200d♀️", + "woman_in_steamy_room_medium_skin_tone": "🧖🏽\u200d♀️", + "woman_judge": "👩\u200d⚖️", + "woman_judge_dark_skin_tone": "👩🏿\u200d⚖️", + "woman_judge_light_skin_tone": "👩🏻\u200d⚖️", + "woman_judge_medium-dark_skin_tone": "👩🏾\u200d⚖️", + "woman_judge_medium-light_skin_tone": "👩🏼\u200d⚖️", + "woman_judge_medium_skin_tone": "👩🏽\u200d⚖️", + "woman_juggling": "🤹\u200d♀️", + "woman_juggling_dark_skin_tone": "🤹🏿\u200d♀️", + "woman_juggling_light_skin_tone": "🤹🏻\u200d♀️", + "woman_juggling_medium-dark_skin_tone": "🤹🏾\u200d♀️", + "woman_juggling_medium-light_skin_tone": "🤹🏼\u200d♀️", + "woman_juggling_medium_skin_tone": "🤹🏽\u200d♀️", + "woman_lifting_weights": "🏋️\u200d♀️", + "woman_lifting_weights_dark_skin_tone": "🏋🏿\u200d♀️", + "woman_lifting_weights_light_skin_tone": "🏋🏻\u200d♀️", + "woman_lifting_weights_medium-dark_skin_tone": "🏋🏾\u200d♀️", + "woman_lifting_weights_medium-light_skin_tone": "🏋🏼\u200d♀️", + "woman_lifting_weights_medium_skin_tone": "🏋🏽\u200d♀️", + "woman_light_skin_tone": "👩🏻", + "woman_mage": "🧙\u200d♀️", + "woman_mage_dark_skin_tone": "🧙🏿\u200d♀️", + "woman_mage_light_skin_tone": "🧙🏻\u200d♀️", + "woman_mage_medium-dark_skin_tone": "🧙🏾\u200d♀️", + "woman_mage_medium-light_skin_tone": "🧙🏼\u200d♀️", + "woman_mage_medium_skin_tone": "🧙🏽\u200d♀️", + "woman_mechanic": "👩\u200d🔧", + "woman_mechanic_dark_skin_tone": "👩🏿\u200d🔧", + "woman_mechanic_light_skin_tone": "👩🏻\u200d🔧", + "woman_mechanic_medium-dark_skin_tone": "👩🏾\u200d🔧", + "woman_mechanic_medium-light_skin_tone": "👩🏼\u200d🔧", + "woman_mechanic_medium_skin_tone": "👩🏽\u200d🔧", + "woman_medium-dark_skin_tone": "👩🏾", + "woman_medium-light_skin_tone": "👩🏼", + "woman_medium_skin_tone": "👩🏽", + "woman_mountain_biking": "🚵\u200d♀️", + "woman_mountain_biking_dark_skin_tone": "🚵🏿\u200d♀️", + "woman_mountain_biking_light_skin_tone": "🚵🏻\u200d♀️", + "woman_mountain_biking_medium-dark_skin_tone": "🚵🏾\u200d♀️", + "woman_mountain_biking_medium-light_skin_tone": "🚵🏼\u200d♀️", + "woman_mountain_biking_medium_skin_tone": "🚵🏽\u200d♀️", + "woman_office_worker": "👩\u200d💼", + "woman_office_worker_dark_skin_tone": "👩🏿\u200d💼", + "woman_office_worker_light_skin_tone": "👩🏻\u200d💼", + "woman_office_worker_medium-dark_skin_tone": "👩🏾\u200d💼", + "woman_office_worker_medium-light_skin_tone": "👩🏼\u200d💼", + "woman_office_worker_medium_skin_tone": "👩🏽\u200d💼", + "woman_pilot": "👩\u200d✈️", + "woman_pilot_dark_skin_tone": "👩🏿\u200d✈️", + "woman_pilot_light_skin_tone": "👩🏻\u200d✈️", + "woman_pilot_medium-dark_skin_tone": "👩🏾\u200d✈️", + "woman_pilot_medium-light_skin_tone": "👩🏼\u200d✈️", + "woman_pilot_medium_skin_tone": "👩🏽\u200d✈️", + "woman_playing_handball": "🤾\u200d♀️", + "woman_playing_handball_dark_skin_tone": "🤾🏿\u200d♀️", + "woman_playing_handball_light_skin_tone": "🤾🏻\u200d♀️", + "woman_playing_handball_medium-dark_skin_tone": "🤾🏾\u200d♀️", + "woman_playing_handball_medium-light_skin_tone": "🤾🏼\u200d♀️", + "woman_playing_handball_medium_skin_tone": "🤾🏽\u200d♀️", + "woman_playing_water_polo": "🤽\u200d♀️", + "woman_playing_water_polo_dark_skin_tone": "🤽🏿\u200d♀️", + "woman_playing_water_polo_light_skin_tone": "🤽🏻\u200d♀️", + "woman_playing_water_polo_medium-dark_skin_tone": "🤽🏾\u200d♀️", + "woman_playing_water_polo_medium-light_skin_tone": "🤽🏼\u200d♀️", + "woman_playing_water_polo_medium_skin_tone": "🤽🏽\u200d♀️", + "woman_police_officer": "👮\u200d♀️", + "woman_police_officer_dark_skin_tone": "👮🏿\u200d♀️", + "woman_police_officer_light_skin_tone": "👮🏻\u200d♀️", + "woman_police_officer_medium-dark_skin_tone": "👮🏾\u200d♀️", + "woman_police_officer_medium-light_skin_tone": "👮🏼\u200d♀️", + "woman_police_officer_medium_skin_tone": "👮🏽\u200d♀️", + "woman_pouting": "🙎\u200d♀️", + "woman_pouting_dark_skin_tone": "🙎🏿\u200d♀️", + "woman_pouting_light_skin_tone": "🙎🏻\u200d♀️", + "woman_pouting_medium-dark_skin_tone": "🙎🏾\u200d♀️", + "woman_pouting_medium-light_skin_tone": "🙎🏼\u200d♀️", + "woman_pouting_medium_skin_tone": "🙎🏽\u200d♀️", + "woman_raising_hand": "🙋\u200d♀️", + "woman_raising_hand_dark_skin_tone": "🙋🏿\u200d♀️", + "woman_raising_hand_light_skin_tone": "🙋🏻\u200d♀️", + "woman_raising_hand_medium-dark_skin_tone": "🙋🏾\u200d♀️", + "woman_raising_hand_medium-light_skin_tone": "🙋🏼\u200d♀️", + "woman_raising_hand_medium_skin_tone": "🙋🏽\u200d♀️", + "woman_rowing_boat": "🚣\u200d♀️", + "woman_rowing_boat_dark_skin_tone": "🚣🏿\u200d♀️", + "woman_rowing_boat_light_skin_tone": "🚣🏻\u200d♀️", + "woman_rowing_boat_medium-dark_skin_tone": "🚣🏾\u200d♀️", + "woman_rowing_boat_medium-light_skin_tone": "🚣🏼\u200d♀️", + "woman_rowing_boat_medium_skin_tone": "🚣🏽\u200d♀️", + "woman_running": "🏃\u200d♀️", + "woman_running_dark_skin_tone": "🏃🏿\u200d♀️", + "woman_running_light_skin_tone": "🏃🏻\u200d♀️", + "woman_running_medium-dark_skin_tone": "🏃🏾\u200d♀️", + "woman_running_medium-light_skin_tone": "🏃🏼\u200d♀️", + "woman_running_medium_skin_tone": "🏃🏽\u200d♀️", + "woman_scientist": "👩\u200d🔬", + "woman_scientist_dark_skin_tone": "👩🏿\u200d🔬", + "woman_scientist_light_skin_tone": "👩🏻\u200d🔬", + "woman_scientist_medium-dark_skin_tone": "👩🏾\u200d🔬", + "woman_scientist_medium-light_skin_tone": "👩🏼\u200d🔬", + "woman_scientist_medium_skin_tone": "👩🏽\u200d🔬", + "woman_shrugging": "🤷\u200d♀️", + "woman_shrugging_dark_skin_tone": "🤷🏿\u200d♀️", + "woman_shrugging_light_skin_tone": "🤷🏻\u200d♀️", + "woman_shrugging_medium-dark_skin_tone": "🤷🏾\u200d♀️", + "woman_shrugging_medium-light_skin_tone": "🤷🏼\u200d♀️", + "woman_shrugging_medium_skin_tone": "🤷🏽\u200d♀️", + "woman_singer": "👩\u200d🎤", + "woman_singer_dark_skin_tone": "👩🏿\u200d🎤", + "woman_singer_light_skin_tone": "👩🏻\u200d🎤", + "woman_singer_medium-dark_skin_tone": "👩🏾\u200d🎤", + "woman_singer_medium-light_skin_tone": "👩🏼\u200d🎤", + "woman_singer_medium_skin_tone": "👩🏽\u200d🎤", + "woman_student": "👩\u200d🎓", + "woman_student_dark_skin_tone": "👩🏿\u200d🎓", + "woman_student_light_skin_tone": "👩🏻\u200d🎓", + "woman_student_medium-dark_skin_tone": "👩🏾\u200d🎓", + "woman_student_medium-light_skin_tone": "👩🏼\u200d🎓", + "woman_student_medium_skin_tone": "👩🏽\u200d🎓", + "woman_surfing": "🏄\u200d♀️", + "woman_surfing_dark_skin_tone": "🏄🏿\u200d♀️", + "woman_surfing_light_skin_tone": "🏄🏻\u200d♀️", + "woman_surfing_medium-dark_skin_tone": "🏄🏾\u200d♀️", + "woman_surfing_medium-light_skin_tone": "🏄🏼\u200d♀️", + "woman_surfing_medium_skin_tone": "🏄🏽\u200d♀️", + "woman_swimming": "🏊\u200d♀️", + "woman_swimming_dark_skin_tone": "🏊🏿\u200d♀️", + "woman_swimming_light_skin_tone": "🏊🏻\u200d♀️", + "woman_swimming_medium-dark_skin_tone": "🏊🏾\u200d♀️", + "woman_swimming_medium-light_skin_tone": "🏊🏼\u200d♀️", + "woman_swimming_medium_skin_tone": "🏊🏽\u200d♀️", + "woman_teacher": "👩\u200d🏫", + "woman_teacher_dark_skin_tone": "👩🏿\u200d🏫", + "woman_teacher_light_skin_tone": "👩🏻\u200d🏫", + "woman_teacher_medium-dark_skin_tone": "👩🏾\u200d🏫", + "woman_teacher_medium-light_skin_tone": "👩🏼\u200d🏫", + "woman_teacher_medium_skin_tone": "👩🏽\u200d🏫", + "woman_technologist": "👩\u200d💻", + "woman_technologist_dark_skin_tone": "👩🏿\u200d💻", + "woman_technologist_light_skin_tone": "👩🏻\u200d💻", + "woman_technologist_medium-dark_skin_tone": "👩🏾\u200d💻", + "woman_technologist_medium-light_skin_tone": "👩🏼\u200d💻", + "woman_technologist_medium_skin_tone": "👩🏽\u200d💻", + "woman_tipping_hand": "💁\u200d♀️", + "woman_tipping_hand_dark_skin_tone": "💁🏿\u200d♀️", + "woman_tipping_hand_light_skin_tone": "💁🏻\u200d♀️", + "woman_tipping_hand_medium-dark_skin_tone": "💁🏾\u200d♀️", + "woman_tipping_hand_medium-light_skin_tone": "💁🏼\u200d♀️", + "woman_tipping_hand_medium_skin_tone": "💁🏽\u200d♀️", + "woman_vampire": "🧛\u200d♀️", + "woman_vampire_dark_skin_tone": "🧛🏿\u200d♀️", + "woman_vampire_light_skin_tone": "🧛🏻\u200d♀️", + "woman_vampire_medium-dark_skin_tone": "🧛🏾\u200d♀️", + "woman_vampire_medium-light_skin_tone": "🧛🏼\u200d♀️", + "woman_vampire_medium_skin_tone": "🧛🏽\u200d♀️", + "woman_walking": "🚶\u200d♀️", + "woman_walking_dark_skin_tone": "🚶🏿\u200d♀️", + "woman_walking_light_skin_tone": "🚶🏻\u200d♀️", + "woman_walking_medium-dark_skin_tone": "🚶🏾\u200d♀️", + "woman_walking_medium-light_skin_tone": "🚶🏼\u200d♀️", + "woman_walking_medium_skin_tone": "🚶🏽\u200d♀️", + "woman_wearing_turban": "👳\u200d♀️", + "woman_wearing_turban_dark_skin_tone": "👳🏿\u200d♀️", + "woman_wearing_turban_light_skin_tone": "👳🏻\u200d♀️", + "woman_wearing_turban_medium-dark_skin_tone": "👳🏾\u200d♀️", + "woman_wearing_turban_medium-light_skin_tone": "👳🏼\u200d♀️", + "woman_wearing_turban_medium_skin_tone": "👳🏽\u200d♀️", + "woman_with_headscarf": "🧕", + "woman_with_headscarf_dark_skin_tone": "🧕🏿", + "woman_with_headscarf_light_skin_tone": "🧕🏻", + "woman_with_headscarf_medium-dark_skin_tone": "🧕🏾", + "woman_with_headscarf_medium-light_skin_tone": "🧕🏼", + "woman_with_headscarf_medium_skin_tone": "🧕🏽", + "woman_with_probing_cane": "👩\u200d🦯", + "woman_zombie": "🧟\u200d♀️", + "woman’s_boot": "👢", + "woman’s_clothes": "👚", + "woman’s_hat": "👒", + "woman’s_sandal": "👡", + "women_with_bunny_ears": "👯\u200d♀️", + "women_wrestling": "🤼\u200d♀️", + "women’s_room": "🚺", + "woozy_face": "🥴", + "world_map": "🗺", + "worried_face": "😟", + "wrapped_gift": "🎁", + "wrench": "🔧", + "writing_hand": "✍", + "writing_hand_dark_skin_tone": "✍🏿", + "writing_hand_light_skin_tone": "✍🏻", + "writing_hand_medium-dark_skin_tone": "✍🏾", + "writing_hand_medium-light_skin_tone": "✍🏼", + "writing_hand_medium_skin_tone": "✍🏽", + "yarn": "🧶", + "yawning_face": "🥱", + "yellow_circle": "🟡", + "yellow_heart": "💛", + "yellow_square": "🟨", + "yen_banknote": "💴", + "yo-yo": "🪀", + "yin_yang": "☯", + "zany_face": "🤪", + "zebra": "🦓", + "zipper-mouth_face": "🤐", + "zombie": "🧟", + "zzz": "💤", + "åland_islands": "🇦🇽", + "keycap_asterisk": "*⃣", + "keycap_digit_eight": "8⃣", + "keycap_digit_five": "5⃣", + "keycap_digit_four": "4⃣", + "keycap_digit_nine": "9⃣", + "keycap_digit_one": "1⃣", + "keycap_digit_seven": "7⃣", + "keycap_digit_six": "6⃣", + "keycap_digit_three": "3⃣", + "keycap_digit_two": "2⃣", + "keycap_digit_zero": "0⃣", + "keycap_number_sign": "#⃣", + "light_skin_tone": "🏻", + "medium_light_skin_tone": "🏼", + "medium_skin_tone": "🏽", + "medium_dark_skin_tone": "🏾", + "dark_skin_tone": "🏿", + "regional_indicator_symbol_letter_a": "🇦", + "regional_indicator_symbol_letter_b": "🇧", + "regional_indicator_symbol_letter_c": "🇨", + "regional_indicator_symbol_letter_d": "🇩", + "regional_indicator_symbol_letter_e": "🇪", + "regional_indicator_symbol_letter_f": "🇫", + "regional_indicator_symbol_letter_g": "🇬", + "regional_indicator_symbol_letter_h": "🇭", + "regional_indicator_symbol_letter_i": "🇮", + "regional_indicator_symbol_letter_j": "🇯", + "regional_indicator_symbol_letter_k": "🇰", + "regional_indicator_symbol_letter_l": "🇱", + "regional_indicator_symbol_letter_m": "🇲", + "regional_indicator_symbol_letter_n": "🇳", + "regional_indicator_symbol_letter_o": "🇴", + "regional_indicator_symbol_letter_p": "🇵", + "regional_indicator_symbol_letter_q": "🇶", + "regional_indicator_symbol_letter_r": "🇷", + "regional_indicator_symbol_letter_s": "🇸", + "regional_indicator_symbol_letter_t": "🇹", + "regional_indicator_symbol_letter_u": "🇺", + "regional_indicator_symbol_letter_v": "🇻", + "regional_indicator_symbol_letter_w": "🇼", + "regional_indicator_symbol_letter_x": "🇽", + "regional_indicator_symbol_letter_y": "🇾", + "regional_indicator_symbol_letter_z": "🇿", + "airplane_arriving": "🛬", + "space_invader": "👾", + "football": "🏈", + "anger": "💢", + "angry": "😠", + "anguished": "😧", + "signal_strength": "📶", + "arrows_counterclockwise": "🔄", + "arrow_heading_down": "⤵", + "arrow_heading_up": "⤴", + "art": "🎨", + "astonished": "😲", + "athletic_shoe": "👟", + "atm": "🏧", + "car": "🚗", + "red_car": "🚗", + "angel": "👼", + "back": "🔙", + "badminton_racquet_and_shuttlecock": "🏸", + "dollar": "💵", + "euro": "💶", + "pound": "💷", + "yen": "💴", + "barber": "💈", + "bath": "🛀", + "bear": "🐻", + "heartbeat": "💓", + "beer": "🍺", + "no_bell": "🔕", + "bento": "🍱", + "bike": "🚲", + "bicyclist": "🚴", + "8ball": "🎱", + "biohazard_sign": "☣", + "birthday": "🎂", + "black_circle_for_record": "⏺", + "clubs": "♣", + "diamonds": "♦", + "arrow_double_down": "⏬", + "hearts": "♥", + "rewind": "⏪", + "black_left__pointing_double_triangle_with_vertical_bar": "⏮", + "arrow_backward": "◀", + "black_medium_small_square": "◾", + "question": "❓", + "fast_forward": "⏩", + "black_right__pointing_double_triangle_with_vertical_bar": "⏭", + "arrow_forward": "▶", + "black_right__pointing_triangle_with_double_vertical_bar": "⏯", + "arrow_right": "➡", + "spades": "♠", + "black_square_for_stop": "⏹", + "sunny": "☀", + "phone": "☎", + "recycle": "♻", + "arrow_double_up": "⏫", + "busstop": "🚏", + "date": "📅", + "flags": "🎏", + "cat2": "🐈", + "joy_cat": "😹", + "smirk_cat": "😼", + "chart_with_downwards_trend": "📉", + "chart_with_upwards_trend": "📈", + "chart": "💹", + "mega": "📣", + "checkered_flag": "🏁", + "accept": "🉑", + "ideograph_advantage": "🉐", + "congratulations": "㊗", + "secret": "㊙", + "m": "Ⓜ", + "city_sunset": "🌆", + "clapper": "🎬", + "clap": "👏", + "beers": "🍻", + "clock830": "🕣", + "clock8": "🕗", + "clock1130": "🕦", + "clock11": "🕚", + "clock530": "🕠", + "clock5": "🕔", + "clock430": "🕟", + "clock4": "🕓", + "clock930": "🕤", + "clock9": "🕘", + "clock130": "🕜", + "clock1": "🕐", + "clock730": "🕢", + "clock7": "🕖", + "clock630": "🕡", + "clock6": "🕕", + "clock1030": "🕥", + "clock10": "🕙", + "clock330": "🕞", + "clock3": "🕒", + "clock1230": "🕧", + "clock12": "🕛", + "clock230": "🕝", + "clock2": "🕑", + "arrows_clockwise": "🔃", + "repeat": "🔁", + "repeat_one": "🔂", + "closed_lock_with_key": "🔐", + "mailbox_closed": "📪", + "mailbox": "📫", + "cloud_with_tornado": "🌪", + "cocktail": "🍸", + "boom": "💥", + "compression": "🗜", + "confounded": "😖", + "confused": "😕", + "rice": "🍚", + "cow2": "🐄", + "cricket_bat_and_ball": "🏏", + "x": "❌", + "cry": "😢", + "curry": "🍛", + "dagger_knife": "🗡", + "dancer": "💃", + "dark_sunglasses": "🕶", + "dash": "💨", + "truck": "🚚", + "derelict_house_building": "🏚", + "diamond_shape_with_a_dot_inside": "💠", + "dart": "🎯", + "disappointed_relieved": "😥", + "disappointed": "😞", + "do_not_litter": "🚯", + "dog2": "🐕", + "flipper": "🐬", + "loop": "➿", + "bangbang": "‼", + "double_vertical_bar": "⏸", + "dove_of_peace": "🕊", + "small_red_triangle_down": "🔻", + "arrow_down_small": "🔽", + "arrow_down": "⬇", + "dromedary_camel": "🐪", + "e__mail": "📧", + "corn": "🌽", + "ear_of_rice": "🌾", + "earth_americas": "🌎", + "earth_asia": "🌏", + "earth_africa": "🌍", + "eight_pointed_black_star": "✴", + "eight_spoked_asterisk": "✳", + "eject_symbol": "⏏", + "bulb": "💡", + "emoji_modifier_fitzpatrick_type__1__2": "🏻", + "emoji_modifier_fitzpatrick_type__3": "🏼", + "emoji_modifier_fitzpatrick_type__4": "🏽", + "emoji_modifier_fitzpatrick_type__5": "🏾", + "emoji_modifier_fitzpatrick_type__6": "🏿", + "end": "🔚", + "email": "✉", + "european_castle": "🏰", + "european_post_office": "🏤", + "interrobang": "⁉", + "expressionless": "😑", + "eyeglasses": "👓", + "massage": "💆", + "yum": "😋", + "scream": "😱", + "kissing_heart": "😘", + "sweat": "😓", + "face_with_head__bandage": "🤕", + "triumph": "😤", + "mask": "😷", + "no_good": "🙅", + "ok_woman": "🙆", + "open_mouth": "😮", + "cold_sweat": "😰", + "stuck_out_tongue": "😛", + "stuck_out_tongue_closed_eyes": "😝", + "stuck_out_tongue_winking_eye": "😜", + "joy": "😂", + "no_mouth": "😶", + "santa": "🎅", + "fax": "📠", + "fearful": "😨", + "field_hockey_stick_and_ball": "🏑", + "first_quarter_moon_with_face": "🌛", + "fish_cake": "🍥", + "fishing_pole_and_fish": "🎣", + "facepunch": "👊", + "punch": "👊", + "flag_for_afghanistan": "🇦🇫", + "flag_for_albania": "🇦🇱", + "flag_for_algeria": "🇩🇿", + "flag_for_american_samoa": "🇦🇸", + "flag_for_andorra": "🇦🇩", + "flag_for_angola": "🇦🇴", + "flag_for_anguilla": "🇦🇮", + "flag_for_antarctica": "🇦🇶", + "flag_for_antigua_&_barbuda": "🇦🇬", + "flag_for_argentina": "🇦🇷", + "flag_for_armenia": "🇦🇲", + "flag_for_aruba": "🇦🇼", + "flag_for_ascension_island": "🇦🇨", + "flag_for_australia": "🇦🇺", + "flag_for_austria": "🇦🇹", + "flag_for_azerbaijan": "🇦🇿", + "flag_for_bahamas": "🇧🇸", + "flag_for_bahrain": "🇧🇭", + "flag_for_bangladesh": "🇧🇩", + "flag_for_barbados": "🇧🇧", + "flag_for_belarus": "🇧🇾", + "flag_for_belgium": "🇧🇪", + "flag_for_belize": "🇧🇿", + "flag_for_benin": "🇧🇯", + "flag_for_bermuda": "🇧🇲", + "flag_for_bhutan": "🇧🇹", + "flag_for_bolivia": "🇧🇴", + "flag_for_bosnia_&_herzegovina": "🇧🇦", + "flag_for_botswana": "🇧🇼", + "flag_for_bouvet_island": "🇧🇻", + "flag_for_brazil": "🇧🇷", + "flag_for_british_indian_ocean_territory": "🇮🇴", + "flag_for_british_virgin_islands": "🇻🇬", + "flag_for_brunei": "🇧🇳", + "flag_for_bulgaria": "🇧🇬", + "flag_for_burkina_faso": "🇧🇫", + "flag_for_burundi": "🇧🇮", + "flag_for_cambodia": "🇰🇭", + "flag_for_cameroon": "🇨🇲", + "flag_for_canada": "🇨🇦", + "flag_for_canary_islands": "🇮🇨", + "flag_for_cape_verde": "🇨🇻", + "flag_for_caribbean_netherlands": "🇧🇶", + "flag_for_cayman_islands": "🇰🇾", + "flag_for_central_african_republic": "🇨🇫", + "flag_for_ceuta_&_melilla": "🇪🇦", + "flag_for_chad": "🇹🇩", + "flag_for_chile": "🇨🇱", + "flag_for_china": "🇨🇳", + "flag_for_christmas_island": "🇨🇽", + "flag_for_clipperton_island": "🇨🇵", + "flag_for_cocos__islands": "🇨🇨", + "flag_for_colombia": "🇨🇴", + "flag_for_comoros": "🇰🇲", + "flag_for_congo____brazzaville": "🇨🇬", + "flag_for_congo____kinshasa": "🇨🇩", + "flag_for_cook_islands": "🇨🇰", + "flag_for_costa_rica": "🇨🇷", + "flag_for_croatia": "🇭🇷", + "flag_for_cuba": "🇨🇺", + "flag_for_curaçao": "🇨🇼", + "flag_for_cyprus": "🇨🇾", + "flag_for_czech_republic": "🇨🇿", + "flag_for_côte_d’ivoire": "🇨🇮", + "flag_for_denmark": "🇩🇰", + "flag_for_diego_garcia": "🇩🇬", + "flag_for_djibouti": "🇩🇯", + "flag_for_dominica": "🇩🇲", + "flag_for_dominican_republic": "🇩🇴", + "flag_for_ecuador": "🇪🇨", + "flag_for_egypt": "🇪🇬", + "flag_for_el_salvador": "🇸🇻", + "flag_for_equatorial_guinea": "🇬🇶", + "flag_for_eritrea": "🇪🇷", + "flag_for_estonia": "🇪🇪", + "flag_for_ethiopia": "🇪🇹", + "flag_for_european_union": "🇪🇺", + "flag_for_falkland_islands": "🇫🇰", + "flag_for_faroe_islands": "🇫🇴", + "flag_for_fiji": "🇫🇯", + "flag_for_finland": "🇫🇮", + "flag_for_france": "🇫🇷", + "flag_for_french_guiana": "🇬🇫", + "flag_for_french_polynesia": "🇵🇫", + "flag_for_french_southern_territories": "🇹🇫", + "flag_for_gabon": "🇬🇦", + "flag_for_gambia": "🇬🇲", + "flag_for_georgia": "🇬🇪", + "flag_for_germany": "🇩🇪", + "flag_for_ghana": "🇬🇭", + "flag_for_gibraltar": "🇬🇮", + "flag_for_greece": "🇬🇷", + "flag_for_greenland": "🇬🇱", + "flag_for_grenada": "🇬🇩", + "flag_for_guadeloupe": "🇬🇵", + "flag_for_guam": "🇬🇺", + "flag_for_guatemala": "🇬🇹", + "flag_for_guernsey": "🇬🇬", + "flag_for_guinea": "🇬🇳", + "flag_for_guinea__bissau": "🇬🇼", + "flag_for_guyana": "🇬🇾", + "flag_for_haiti": "🇭🇹", + "flag_for_heard_&_mcdonald_islands": "🇭🇲", + "flag_for_honduras": "🇭🇳", + "flag_for_hong_kong": "🇭🇰", + "flag_for_hungary": "🇭🇺", + "flag_for_iceland": "🇮🇸", + "flag_for_india": "🇮🇳", + "flag_for_indonesia": "🇮🇩", + "flag_for_iran": "🇮🇷", + "flag_for_iraq": "🇮🇶", + "flag_for_ireland": "🇮🇪", + "flag_for_isle_of_man": "🇮🇲", + "flag_for_israel": "🇮🇱", + "flag_for_italy": "🇮🇹", + "flag_for_jamaica": "🇯🇲", + "flag_for_japan": "🇯🇵", + "flag_for_jersey": "🇯🇪", + "flag_for_jordan": "🇯🇴", + "flag_for_kazakhstan": "🇰🇿", + "flag_for_kenya": "🇰🇪", + "flag_for_kiribati": "🇰🇮", + "flag_for_kosovo": "🇽🇰", + "flag_for_kuwait": "🇰🇼", + "flag_for_kyrgyzstan": "🇰🇬", + "flag_for_laos": "🇱🇦", + "flag_for_latvia": "🇱🇻", + "flag_for_lebanon": "🇱🇧", + "flag_for_lesotho": "🇱🇸", + "flag_for_liberia": "🇱🇷", + "flag_for_libya": "🇱🇾", + "flag_for_liechtenstein": "🇱🇮", + "flag_for_lithuania": "🇱🇹", + "flag_for_luxembourg": "🇱🇺", + "flag_for_macau": "🇲🇴", + "flag_for_macedonia": "🇲🇰", + "flag_for_madagascar": "🇲🇬", + "flag_for_malawi": "🇲🇼", + "flag_for_malaysia": "🇲🇾", + "flag_for_maldives": "🇲🇻", + "flag_for_mali": "🇲🇱", + "flag_for_malta": "🇲🇹", + "flag_for_marshall_islands": "🇲🇭", + "flag_for_martinique": "🇲🇶", + "flag_for_mauritania": "🇲🇷", + "flag_for_mauritius": "🇲🇺", + "flag_for_mayotte": "🇾🇹", + "flag_for_mexico": "🇲🇽", + "flag_for_micronesia": "🇫🇲", + "flag_for_moldova": "🇲🇩", + "flag_for_monaco": "🇲🇨", + "flag_for_mongolia": "🇲🇳", + "flag_for_montenegro": "🇲🇪", + "flag_for_montserrat": "🇲🇸", + "flag_for_morocco": "🇲🇦", + "flag_for_mozambique": "🇲🇿", + "flag_for_myanmar": "🇲🇲", + "flag_for_namibia": "🇳🇦", + "flag_for_nauru": "🇳🇷", + "flag_for_nepal": "🇳🇵", + "flag_for_netherlands": "🇳🇱", + "flag_for_new_caledonia": "🇳🇨", + "flag_for_new_zealand": "🇳🇿", + "flag_for_nicaragua": "🇳🇮", + "flag_for_niger": "🇳🇪", + "flag_for_nigeria": "🇳🇬", + "flag_for_niue": "🇳🇺", + "flag_for_norfolk_island": "🇳🇫", + "flag_for_north_korea": "🇰🇵", + "flag_for_northern_mariana_islands": "🇲🇵", + "flag_for_norway": "🇳🇴", + "flag_for_oman": "🇴🇲", + "flag_for_pakistan": "🇵🇰", + "flag_for_palau": "🇵🇼", + "flag_for_palestinian_territories": "🇵🇸", + "flag_for_panama": "🇵🇦", + "flag_for_papua_new_guinea": "🇵🇬", + "flag_for_paraguay": "🇵🇾", + "flag_for_peru": "🇵🇪", + "flag_for_philippines": "🇵🇭", + "flag_for_pitcairn_islands": "🇵🇳", + "flag_for_poland": "🇵🇱", + "flag_for_portugal": "🇵🇹", + "flag_for_puerto_rico": "🇵🇷", + "flag_for_qatar": "🇶🇦", + "flag_for_romania": "🇷🇴", + "flag_for_russia": "🇷🇺", + "flag_for_rwanda": "🇷🇼", + "flag_for_réunion": "🇷🇪", + "flag_for_samoa": "🇼🇸", + "flag_for_san_marino": "🇸🇲", + "flag_for_saudi_arabia": "🇸🇦", + "flag_for_senegal": "🇸🇳", + "flag_for_serbia": "🇷🇸", + "flag_for_seychelles": "🇸🇨", + "flag_for_sierra_leone": "🇸🇱", + "flag_for_singapore": "🇸🇬", + "flag_for_sint_maarten": "🇸🇽", + "flag_for_slovakia": "🇸🇰", + "flag_for_slovenia": "🇸🇮", + "flag_for_solomon_islands": "🇸🇧", + "flag_for_somalia": "🇸🇴", + "flag_for_south_africa": "🇿🇦", + "flag_for_south_georgia_&_south_sandwich_islands": "🇬🇸", + "flag_for_south_korea": "🇰🇷", + "flag_for_south_sudan": "🇸🇸", + "flag_for_spain": "🇪🇸", + "flag_for_sri_lanka": "🇱🇰", + "flag_for_st._barthélemy": "🇧🇱", + "flag_for_st._helena": "🇸🇭", + "flag_for_st._kitts_&_nevis": "🇰🇳", + "flag_for_st._lucia": "🇱🇨", + "flag_for_st._martin": "🇲🇫", + "flag_for_st._pierre_&_miquelon": "🇵🇲", + "flag_for_st._vincent_&_grenadines": "🇻🇨", + "flag_for_sudan": "🇸🇩", + "flag_for_suriname": "🇸🇷", + "flag_for_svalbard_&_jan_mayen": "🇸🇯", + "flag_for_swaziland": "🇸🇿", + "flag_for_sweden": "🇸🇪", + "flag_for_switzerland": "🇨🇭", + "flag_for_syria": "🇸🇾", + "flag_for_são_tomé_&_príncipe": "🇸🇹", + "flag_for_taiwan": "🇹🇼", + "flag_for_tajikistan": "🇹🇯", + "flag_for_tanzania": "🇹🇿", + "flag_for_thailand": "🇹🇭", + "flag_for_timor__leste": "🇹🇱", + "flag_for_togo": "🇹🇬", + "flag_for_tokelau": "🇹🇰", + "flag_for_tonga": "🇹🇴", + "flag_for_trinidad_&_tobago": "🇹🇹", + "flag_for_tristan_da_cunha": "🇹🇦", + "flag_for_tunisia": "🇹🇳", + "flag_for_turkey": "🇹🇷", + "flag_for_turkmenistan": "🇹🇲", + "flag_for_turks_&_caicos_islands": "🇹🇨", + "flag_for_tuvalu": "🇹🇻", + "flag_for_u.s._outlying_islands": "🇺🇲", + "flag_for_u.s._virgin_islands": "🇻🇮", + "flag_for_uganda": "🇺🇬", + "flag_for_ukraine": "🇺🇦", + "flag_for_united_arab_emirates": "🇦🇪", + "flag_for_united_kingdom": "🇬🇧", + "flag_for_united_states": "🇺🇸", + "flag_for_uruguay": "🇺🇾", + "flag_for_uzbekistan": "🇺🇿", + "flag_for_vanuatu": "🇻🇺", + "flag_for_vatican_city": "🇻🇦", + "flag_for_venezuela": "🇻🇪", + "flag_for_vietnam": "🇻🇳", + "flag_for_wallis_&_futuna": "🇼🇫", + "flag_for_western_sahara": "🇪🇭", + "flag_for_yemen": "🇾🇪", + "flag_for_zambia": "🇿🇲", + "flag_for_zimbabwe": "🇿🇼", + "flag_for_åland_islands": "🇦🇽", + "golf": "⛳", + "fleur__de__lis": "⚜", + "muscle": "💪", + "flushed": "😳", + "frame_with_picture": "🖼", + "fries": "🍟", + "frog": "🐸", + "hatched_chick": "🐥", + "frowning": "😦", + "fuelpump": "⛽", + "full_moon_with_face": "🌝", + "gem": "💎", + "star2": "🌟", + "golfer": "🏌", + "mortar_board": "🎓", + "grimacing": "😬", + "smile_cat": "😸", + "grinning": "😀", + "grin": "😁", + "heartpulse": "💗", + "guardsman": "💂", + "haircut": "💇", + "hamster": "🐹", + "raising_hand": "🙋", + "headphones": "🎧", + "hear_no_evil": "🙉", + "cupid": "💘", + "gift_heart": "💝", + "heart": "❤", + "exclamation": "❗", + "heavy_exclamation_mark": "❗", + "heavy_heart_exclamation_mark_ornament": "❣", + "o": "⭕", + "helm_symbol": "⎈", + "helmet_with_white_cross": "⛑", + "high_heel": "👠", + "bullettrain_side": "🚄", + "bullettrain_front": "🚅", + "high_brightness": "🔆", + "zap": "⚡", + "hocho": "🔪", + "knife": "🔪", + "bee": "🐝", + "traffic_light": "🚥", + "racehorse": "🐎", + "coffee": "☕", + "hotsprings": "♨", + "hourglass": "⌛", + "hourglass_flowing_sand": "⏳", + "house_buildings": "🏘", + "100": "💯", + "hushed": "😯", + "ice_hockey_stick_and_puck": "🏒", + "imp": "👿", + "information_desk_person": "💁", + "information_source": "ℹ", + "capital_abcd": "🔠", + "abc": "🔤", + "abcd": "🔡", + "1234": "🔢", + "symbols": "🔣", + "izakaya_lantern": "🏮", + "lantern": "🏮", + "jack_o_lantern": "🎃", + "dolls": "🎎", + "japanese_goblin": "👺", + "japanese_ogre": "👹", + "beginner": "🔰", + "zero": "0️⃣", + "one": "1️⃣", + "ten": "🔟", + "two": "2️⃣", + "three": "3️⃣", + "four": "4️⃣", + "five": "5️⃣", + "six": "6️⃣", + "seven": "7️⃣", + "eight": "8️⃣", + "nine": "9️⃣", + "couplekiss": "💏", + "kissing_cat": "😽", + "kissing": "😗", + "kissing_closed_eyes": "😚", + "kissing_smiling_eyes": "😙", + "beetle": "🐞", + "large_blue_circle": "🔵", + "last_quarter_moon_with_face": "🌜", + "leaves": "🍃", + "mag": "🔍", + "left_right_arrow": "↔", + "leftwards_arrow_with_hook": "↩", + "arrow_left": "⬅", + "lock": "🔒", + "lock_with_ink_pen": "🔏", + "sob": "😭", + "low_brightness": "🔅", + "lower_left_ballpoint_pen": "🖊", + "lower_left_crayon": "🖍", + "lower_left_fountain_pen": "🖋", + "lower_left_paintbrush": "🖌", + "mahjong": "🀄", + "couple": "👫", + "man_in_business_suit_levitating": "🕴", + "man_with_gua_pi_mao": "👲", + "man_with_turban": "👳", + "mans_shoe": "👞", + "shoe": "👞", + "menorah_with_nine_branches": "🕎", + "mens": "🚹", + "minidisc": "💽", + "iphone": "📱", + "calling": "📲", + "money__mouth_face": "🤑", + "moneybag": "💰", + "rice_scene": "🎑", + "mountain_bicyclist": "🚵", + "mouse2": "🐁", + "lips": "👄", + "moyai": "🗿", + "notes": "🎶", + "nail_care": "💅", + "ab": "🆎", + "negative_squared_cross_mark": "❎", + "a": "🅰", + "b": "🅱", + "o2": "🅾", + "parking": "🅿", + "new_moon_with_face": "🌚", + "no_entry_sign": "🚫", + "underage": "🔞", + "non__potable_water": "🚱", + "arrow_upper_right": "↗", + "arrow_upper_left": "↖", + "office": "🏢", + "older_man": "👴", + "older_woman": "👵", + "om_symbol": "🕉", + "on": "🔛", + "book": "📖", + "unlock": "🔓", + "mailbox_with_no_mail": "📭", + "mailbox_with_mail": "📬", + "cd": "💿", + "tada": "🎉", + "feet": "🐾", + "walking": "🚶", + "pencil2": "✏", + "pensive": "😔", + "persevere": "😣", + "bow": "🙇", + "raised_hands": "🙌", + "person_with_ball": "⛹", + "person_with_blond_hair": "👱", + "pray": "🙏", + "person_with_pouting_face": "🙎", + "computer": "💻", + "pig2": "🐖", + "hankey": "💩", + "poop": "💩", + "shit": "💩", + "bamboo": "🎍", + "gun": "🔫", + "black_joker": "🃏", + "rotating_light": "🚨", + "cop": "👮", + "stew": "🍲", + "pouch": "👝", + "pouting_cat": "😾", + "rage": "😡", + "put_litter_in_its_place": "🚮", + "rabbit2": "🐇", + "racing_motorcycle": "🏍", + "radioactive_sign": "☢", + "fist": "✊", + "hand": "✋", + "raised_hand_with_fingers_splayed": "🖐", + "raised_hand_with_part_between_middle_and_ring_fingers": "🖖", + "blue_car": "🚙", + "apple": "🍎", + "relieved": "😌", + "reversed_hand_with_middle_finger_extended": "🖕", + "mag_right": "🔎", + "arrow_right_hook": "↪", + "sweet_potato": "🍠", + "robot": "🤖", + "rolled__up_newspaper": "🗞", + "rowboat": "🚣", + "runner": "🏃", + "running": "🏃", + "running_shirt_with_sash": "🎽", + "boat": "⛵", + "scales": "⚖", + "school_satchel": "🎒", + "scorpius": "♏", + "see_no_evil": "🙈", + "sheep": "🐑", + "stars": "🌠", + "cake": "🍰", + "six_pointed_star": "🔯", + "ski": "🎿", + "sleeping_accommodation": "🛌", + "sleeping": "😴", + "sleepy": "😪", + "sleuth_or_spy": "🕵", + "heart_eyes_cat": "😻", + "smiley_cat": "😺", + "innocent": "😇", + "heart_eyes": "😍", + "smiling_imp": "😈", + "smiley": "😃", + "sweat_smile": "😅", + "smile": "😄", + "laughing": "😆", + "satisfied": "😆", + "blush": "😊", + "smirk": "😏", + "smoking": "🚬", + "snow_capped_mountain": "🏔", + "soccer": "⚽", + "icecream": "🍦", + "soon": "🔜", + "arrow_lower_right": "↘", + "arrow_lower_left": "↙", + "speak_no_evil": "🙊", + "speaker": "🔈", + "mute": "🔇", + "sound": "🔉", + "loud_sound": "🔊", + "speaking_head_in_silhouette": "🗣", + "spiral_calendar_pad": "🗓", + "spiral_note_pad": "🗒", + "shell": "🐚", + "sweat_drops": "💦", + "u5272": "🈹", + "u5408": "🈴", + "u55b6": "🈺", + "u6307": "🈯", + "u6708": "🈷", + "u6709": "🈶", + "u6e80": "🈵", + "u7121": "🈚", + "u7533": "🈸", + "u7981": "🈲", + "u7a7a": "🈳", + "cl": "🆑", + "cool": "🆒", + "free": "🆓", + "id": "🆔", + "koko": "🈁", + "sa": "🈂", + "new": "🆕", + "ng": "🆖", + "ok": "🆗", + "sos": "🆘", + "up": "🆙", + "vs": "🆚", + "steam_locomotive": "🚂", + "ramen": "🍜", + "partly_sunny": "⛅", + "city_sunrise": "🌇", + "surfer": "🏄", + "swimmer": "🏊", + "shirt": "👕", + "tshirt": "👕", + "table_tennis_paddle_and_ball": "🏓", + "tea": "🍵", + "tv": "📺", + "three_button_mouse": "🖱", + "+1": "👍", + "thumbsup": "👍", + "__1": "👎", + "-1": "👎", + "thumbsdown": "👎", + "thunder_cloud_and_rain": "⛈", + "tiger2": "🐅", + "tophat": "🎩", + "top": "🔝", + "tm": "™", + "train2": "🚆", + "triangular_flag_on_post": "🚩", + "trident": "🔱", + "twisted_rightwards_arrows": "🔀", + "unamused": "😒", + "small_red_triangle": "🔺", + "arrow_up_small": "🔼", + "arrow_up_down": "↕", + "upside__down_face": "🙃", + "arrow_up": "⬆", + "v": "✌", + "vhs": "📼", + "wc": "🚾", + "ocean": "🌊", + "waving_black_flag": "🏴", + "wave": "👋", + "waving_white_flag": "🏳", + "moon": "🌔", + "scream_cat": "🙀", + "weary": "😩", + "weight_lifter": "🏋", + "whale2": "🐋", + "wheelchair": "♿", + "point_down": "👇", + "grey_exclamation": "❕", + "white_frowning_face": "☹", + "white_check_mark": "✅", + "point_left": "👈", + "white_medium_small_square": "◽", + "star": "⭐", + "grey_question": "❔", + "point_right": "👉", + "relaxed": "☺", + "white_sun_behind_cloud": "🌥", + "white_sun_behind_cloud_with_rain": "🌦", + "white_sun_with_small_cloud": "🌤", + "point_up_2": "👆", + "point_up": "☝", + "wind_blowing_face": "🌬", + "wink": "😉", + "wolf": "🐺", + "dancers": "👯", + "boot": "👢", + "womans_clothes": "👚", + "womans_hat": "👒", + "sandal": "👡", + "womens": "🚺", + "worried": "😟", + "gift": "🎁", + "zipper__mouth_face": "🤐", + "regional_indicator_a": "🇦", + "regional_indicator_b": "🇧", + "regional_indicator_c": "🇨", + "regional_indicator_d": "🇩", + "regional_indicator_e": "🇪", + "regional_indicator_f": "🇫", + "regional_indicator_g": "🇬", + "regional_indicator_h": "🇭", + "regional_indicator_i": "🇮", + "regional_indicator_j": "🇯", + "regional_indicator_k": "🇰", + "regional_indicator_l": "🇱", + "regional_indicator_m": "🇲", + "regional_indicator_n": "🇳", + "regional_indicator_o": "🇴", + "regional_indicator_p": "🇵", + "regional_indicator_q": "🇶", + "regional_indicator_r": "🇷", + "regional_indicator_s": "🇸", + "regional_indicator_t": "🇹", + "regional_indicator_u": "🇺", + "regional_indicator_v": "🇻", + "regional_indicator_w": "🇼", + "regional_indicator_x": "🇽", + "regional_indicator_y": "🇾", + "regional_indicator_z": "🇿", +} diff --git a/testbed/Textualize__rich/rich/_emoji_replace.py b/testbed/Textualize__rich/rich/_emoji_replace.py new file mode 100644 index 0000000000000000000000000000000000000000..ee8cde009b3dc505d69c5ab7d3b6bc7c20d9098b --- /dev/null +++ b/testbed/Textualize__rich/rich/_emoji_replace.py @@ -0,0 +1,17 @@ +from typing import Match + +import re + +from ._emoji_codes import EMOJI + + +def _emoji_replace(text: str, _emoji_sub=re.compile(r"(:(\S*?):)").sub) -> str: + """Replace emoji code in text.""" + get_emoji = EMOJI.get + + def do_replace(match: Match[str]) -> str: + """Called by re.sub to do the replacement.""" + emoji_code, emoji_name = match.groups() + return get_emoji(emoji_name.lower(), emoji_code) + + return _emoji_sub(do_replace, text) diff --git a/testbed/Textualize__rich/rich/_inspect.py b/testbed/Textualize__rich/rich/_inspect.py new file mode 100644 index 0000000000000000000000000000000000000000..4643942af885c883689f410e3c71c4c1def4c1ca --- /dev/null +++ b/testbed/Textualize__rich/rich/_inspect.py @@ -0,0 +1,244 @@ +from __future__ import absolute_import + +from inspect import cleandoc, getdoc, getfile, isclass, ismodule, signature +from typing import Any, Iterable, Optional, Tuple + +from .console import RenderableType, RenderGroup +from .highlighter import ReprHighlighter +from .jupyter import JupyterMixin +from .panel import Panel +from .pretty import Pretty +from .table import Table +from .text import Text, TextType + + +def _first_paragraph(doc: str) -> str: + """Get the first paragraph from a docstring.""" + paragraph, _, _ = doc.partition("\n\n") + return paragraph + + +def _reformat_doc(doc: str) -> str: + """Reformat docstring.""" + doc = cleandoc(doc).strip() + return doc + + +class Inspect(JupyterMixin): + """A renderable to inspect any Python Object. + + Args: + obj (Any): An object to inspect. + title (str, optional): Title to display over inspect result, or None use type. Defaults to None. + help (bool, optional): Show full help text rather than just first paragraph. Defaults to False. + methods (bool, optional): Enable inspection of callables. Defaults to False. + docs (bool, optional): Also render doc strings. Defaults to True. + private (bool, optional): Show private attributes (beginning with underscore). Defaults to False. + dunder (bool, optional): Show attributes starting with double underscore. Defaults to False. + sort (bool, optional): Sort attributes alphabetically. Defaults to True. + all (bool, optional): Show all attributes. Defaults to False. + value (bool, optional): Pretty print value of object. Defaults to True. + """ + + def __init__( + self, + obj: Any, + *, + title: TextType = None, + help: bool = False, + methods: bool = False, + docs: bool = True, + private: bool = False, + dunder: bool = False, + sort: bool = True, + all: bool = True, + value: bool = True, + ) -> None: + self.highlighter = ReprHighlighter() + self.obj = obj + self.title = title or self._make_title(obj) + if all: + methods = private = dunder = True + self.help = help + self.methods = methods + self.docs = docs or help + self.private = private or dunder + self.dunder = dunder + self.sort = sort + self.value = value + + def _make_title(self, obj: Any) -> Text: + """Make a default title.""" + title_str = ( + str(obj) + if (isclass(obj) or callable(obj) or ismodule(obj)) + else str(type(obj)) + ) + title_text = self.highlighter(title_str) + return title_text + + def __rich__(self) -> Panel: + return Panel.fit( + RenderGroup(*self._render()), + title=self.title, + border_style="scope.border", + padding=(0, 1), + ) + + def _get_signature(self, name: str, obj: Any) -> Text: + """Get a signature for a callable.""" + try: + _signature = str(signature(obj)) + ":" + except ValueError: + _signature = "(...)" + + source_filename: Optional[str] = None + try: + source_filename = getfile(obj) + except TypeError: + pass + + callable_name = Text(name, style="inspect.callable") + if source_filename: + callable_name.stylize(f"link file://{source_filename}") + signature_text = self.highlighter(_signature) + + qualname = name or getattr(obj, "__qualname__", name) + qual_signature = Text.assemble( + ("def ", "inspect.def"), (qualname, "inspect.callable"), signature_text + ) + + return qual_signature + + def _render(self) -> Iterable[RenderableType]: + """Render object.""" + + def sort_items(item: Tuple[str, Any]) -> Tuple[bool, str]: + key, (_error, value) = item + return (callable(value), key.strip("_").lower()) + + def safe_getattr(attr_name: str) -> Tuple[Any, Any]: + """Get attribute or any exception.""" + try: + return (None, getattr(obj, attr_name)) + except Exception as error: + return (error, None) + + obj = self.obj + keys = dir(obj) + total_items = len(keys) + if not self.dunder: + keys = [key for key in keys if not key.startswith("__")] + if not self.private: + keys = [key for key in keys if not key.startswith("_")] + not_shown_count = total_items - len(keys) + items = [(key, safe_getattr(key)) for key in keys] + if self.sort: + items.sort(key=sort_items) + + items_table = Table.grid(padding=(0, 1), expand=False) + items_table.add_column(justify="right") + add_row = items_table.add_row + highlighter = self.highlighter + + if callable(obj): + yield self._get_signature("", obj) + yield "" + + _doc = getdoc(obj) + if _doc is not None: + if not self.help: + _doc = _first_paragraph(_doc) + doc_text = Text(_reformat_doc(_doc), style="inspect.help") + doc_text = highlighter(doc_text) + yield doc_text + yield "" + + if self.value and not (isclass(obj) or callable(obj) or ismodule(obj)): + yield Panel( + Pretty(obj, indent_guides=True, max_length=10, max_string=60), + border_style="inspect.value.border", + ) + yield "" + + for key, (error, value) in items: + key_text = Text.assemble( + ( + key, + "inspect.attr.dunder" if key.startswith("__") else "inspect.attr", + ), + (" =", "inspect.equals"), + ) + if error is not None: + warning = key_text.copy() + warning.stylize("inspect.error") + add_row(warning, highlighter(repr(error))) + continue + + if callable(value): + if not self.methods: + continue + _signature_text = self._get_signature(key, value) + + if self.docs: + docs = getdoc(value) + if docs is not None: + _doc = _reformat_doc(str(docs)) + if not self.help: + _doc = _first_paragraph(_doc) + _signature_text.append("\n" if "\n" in _doc else " ") + doc = highlighter(_doc) + doc.stylize("inspect.doc") + _signature_text.append(doc) + + add_row(key_text, _signature_text) + else: + add_row(key_text, Pretty(value, highlighter=highlighter)) + if items_table.row_count: + yield items_table + else: + yield self.highlighter( + Text.from_markup( + f"[i][b]{not_shown_count}[/b] attribute(s) not shown.[/i] Run [b][red]inspect[/red]([not b]inspect[/])[/b] for options." + ) + ) + + +if __name__ == "__main__": # type: ignore + from rich import print + + inspect = Inspect({}, docs=True, methods=True, dunder=True) + print(inspect) + + t = Text("Hello, World") + print(Inspect(t)) + + from rich.style import Style + from rich.color import Color + + print(Inspect(Style.parse("bold red on black"), methods=True, docs=True)) + print(Inspect(Color.parse("#ffe326"), methods=True, docs=True)) + + from rich import get_console + + print(Inspect(get_console(), methods=False)) + + print(Inspect(open("foo.txt", "wt"), methods=False)) + + print(Inspect("Hello", methods=False, dunder=True)) + print(Inspect(inspect, methods=False, dunder=False, docs=False)) + + class Foo: + @property + def broken(self): + 1 / 0 + + f = Foo() + print(Inspect(f)) + + print(Inspect(object, dunder=True)) + + print(Inspect(None, dunder=False)) + + print(Inspect(str, help=True)) + print(Inspect(1, help=False)) diff --git a/testbed/Textualize__rich/rich/_log_render.py b/testbed/Textualize__rich/rich/_log_render.py new file mode 100644 index 0000000000000000000000000000000000000000..e0380289aa6531ba4d2b10b33af0a3129aa1f73a --- /dev/null +++ b/testbed/Textualize__rich/rich/_log_render.py @@ -0,0 +1,82 @@ +from datetime import datetime +from typing import Iterable, List, Optional, TYPE_CHECKING, Union + + +from .text import Text, TextType + +if TYPE_CHECKING: + from .console import Console, ConsoleRenderable, RenderableType + from .table import Table + + +class LogRender: + def __init__( + self, + show_time: bool = True, + show_level: bool = False, + show_path: bool = True, + time_format: str = "[%x %X]", + level_width: Optional[int] = 8, + ) -> None: + self.show_time = show_time + self.show_level = show_level + self.show_path = show_path + self.time_format = time_format + self.level_width = level_width + self._last_time: Optional[str] = None + + def __call__( + self, + console: "Console", + renderables: Iterable["ConsoleRenderable"], + log_time: datetime = None, + time_format: str = None, + level: TextType = "", + path: str = None, + line_no: int = None, + link_path: str = None, + ) -> "Table": + from .containers import Renderables + from .table import Table + + output = Table.grid(padding=(0, 1)) + output.expand = True + if self.show_time: + output.add_column(style="log.time") + if self.show_level: + output.add_column(style="log.level", width=self.level_width) + output.add_column(ratio=1, style="log.message", overflow="fold") + if self.show_path and path: + output.add_column(style="log.path") + row: List["RenderableType"] = [] + if self.show_time: + log_time = log_time or console.get_datetime() + log_time_display = log_time.strftime(time_format or self.time_format) + if log_time_display == self._last_time: + row.append(Text(" " * len(log_time_display))) + else: + row.append(Text(log_time_display)) + self._last_time = log_time_display + if self.show_level: + row.append(level) + + row.append(Renderables(renderables)) + if self.show_path and path: + path_text = Text() + path_text.append( + path, style=f"link file://{link_path}" if link_path else "" + ) + if line_no: + path_text.append(f":{line_no}") + row.append(path_text) + + output.add_row(*row) + return output + + +if __name__ == "__main__": # pragma: no cover + from rich.console import Console + + c = Console() + c.print("[on blue]Hello", justify="right") + c.log("[on blue]hello", justify="right") diff --git a/testbed/Textualize__rich/rich/_loop.py b/testbed/Textualize__rich/rich/_loop.py new file mode 100644 index 0000000000000000000000000000000000000000..01c6cafbe53f1fcb12f7b382b2b35e2fd2c69933 --- /dev/null +++ b/testbed/Textualize__rich/rich/_loop.py @@ -0,0 +1,43 @@ +from typing import Iterable, Tuple, TypeVar + +T = TypeVar("T") + + +def loop_first(values: Iterable[T]) -> Iterable[Tuple[bool, T]]: + """Iterate and generate a tuple with a flag for first value.""" + iter_values = iter(values) + try: + value = next(iter_values) + except StopIteration: + return + yield True, value + for value in iter_values: + yield False, value + + +def loop_last(values: Iterable[T]) -> Iterable[Tuple[bool, T]]: + """Iterate and generate a tuple with a flag for last value.""" + iter_values = iter(values) + try: + previous_value = next(iter_values) + except StopIteration: + return + for value in iter_values: + yield False, previous_value + previous_value = value + yield True, previous_value + + +def loop_first_last(values: Iterable[T]) -> Iterable[Tuple[bool, bool, T]]: + """Iterate and generate a tuple with a flag for first and last value.""" + iter_values = iter(values) + try: + previous_value = next(iter_values) + except StopIteration: + return + first = True + for value in iter_values: + yield first, False, previous_value + first = False + previous_value = value + yield first, True, previous_value diff --git a/testbed/Textualize__rich/rich/_lru_cache.py b/testbed/Textualize__rich/rich/_lru_cache.py new file mode 100644 index 0000000000000000000000000000000000000000..b77c337ca5e31994f98c08628021a06ef11464f6 --- /dev/null +++ b/testbed/Textualize__rich/rich/_lru_cache.py @@ -0,0 +1,34 @@ +from collections import OrderedDict +from typing import Dict, Generic, TypeVar + + +CacheKey = TypeVar("CacheKey") +CacheValue = TypeVar("CacheValue") + + +class LRUCache(Generic[CacheKey, CacheValue], OrderedDict): + """ + A dictionary-like container that stores a given maximum items. + + If an additional item is added when the LRUCache is full, the least + recently used key is discarded to make room for the new item. + + """ + + def __init__(self, cache_size: int) -> None: + self.cache_size = cache_size + super(LRUCache, self).__init__() + + def __setitem__(self, key: CacheKey, value: CacheValue) -> None: + """Store a new views, potentially discarding an old value.""" + if key not in self: + if len(self) >= self.cache_size: + self.popitem(last=False) + OrderedDict.__setitem__(self, key, value) + + def __getitem__(self: Dict[CacheKey, CacheValue], key: CacheKey) -> CacheValue: + """Gets the item, but also makes it most recent.""" + value: CacheValue = OrderedDict.__getitem__(self, key) + OrderedDict.__delitem__(self, key) + OrderedDict.__setitem__(self, key, value) + return value diff --git a/testbed/Textualize__rich/rich/_palettes.py b/testbed/Textualize__rich/rich/_palettes.py new file mode 100644 index 0000000000000000000000000000000000000000..082d881741a10b0ce11d96970cda7042f4cec15e --- /dev/null +++ b/testbed/Textualize__rich/rich/_palettes.py @@ -0,0 +1,301 @@ +from .palette import Palette + + +# The standard ansi colors +WINDOWS_PALETTE = Palette( + [ + (0, 0, 0), + (128, 0, 0), + (0, 128, 0), + (128, 128, 0), + (0, 0, 128), + (128, 0, 128), + (0, 128, 128), + (192, 192, 192), + ] +) + +# # The standard ansi colors (including bright variants) +STANDARD_PALETTE = Palette( + [ + (0, 0, 0), + (170, 0, 0), + (0, 170, 0), + (170, 85, 0), + (0, 0, 170), + (170, 0, 170), + (0, 170, 170), + (170, 170, 170), + (85, 85, 85), + (255, 85, 85), + (85, 255, 85), + (255, 255, 85), + (85, 85, 255), + (255, 85, 255), + (85, 255, 255), + (255, 255, 255), + ] +) + + +# The 256 color palette +EIGHT_BIT_PALETTE = Palette( + [ + (0, 0, 0), + (128, 0, 0), + (0, 128, 0), + (128, 128, 0), + (0, 0, 128), + (128, 0, 128), + (0, 128, 128), + (192, 192, 192), + (128, 128, 128), + (255, 0, 0), + (0, 255, 0), + (255, 255, 0), + (0, 0, 255), + (255, 0, 255), + (0, 255, 255), + (255, 255, 255), + (0, 0, 0), + (0, 0, 95), + (0, 0, 135), + (0, 0, 175), + (0, 0, 215), + (0, 0, 255), + (0, 95, 0), + (0, 95, 95), + (0, 95, 135), + (0, 95, 175), + (0, 95, 215), + (0, 95, 255), + (0, 135, 0), + (0, 135, 95), + (0, 135, 135), + (0, 135, 175), + (0, 135, 215), + (0, 135, 255), + (0, 175, 0), + (0, 175, 95), + (0, 175, 135), + (0, 175, 175), + (0, 175, 215), + (0, 175, 255), + (0, 215, 0), + (0, 215, 95), + (0, 215, 135), + (0, 215, 175), + (0, 215, 215), + (0, 215, 255), + (0, 255, 0), + (0, 255, 95), + (0, 255, 135), + (0, 255, 175), + (0, 255, 215), + (0, 255, 255), + (95, 0, 0), + (95, 0, 95), + (95, 0, 135), + (95, 0, 175), + (95, 0, 215), + (95, 0, 255), + (95, 95, 0), + (95, 95, 95), + (95, 95, 135), + (95, 95, 175), + (95, 95, 215), + (95, 95, 255), + (95, 135, 0), + (95, 135, 95), + (95, 135, 135), + (95, 135, 175), + (95, 135, 215), + (95, 135, 255), + (95, 175, 0), + (95, 175, 95), + (95, 175, 135), + (95, 175, 175), + (95, 175, 215), + (95, 175, 255), + (95, 215, 0), + (95, 215, 95), + (95, 215, 135), + (95, 215, 175), + (95, 215, 215), + (95, 215, 255), + (95, 255, 0), + (95, 255, 95), + (95, 255, 135), + (95, 255, 175), + (95, 255, 215), + (95, 255, 255), + (135, 0, 0), + (135, 0, 95), + (135, 0, 135), + (135, 0, 175), + (135, 0, 215), + (135, 0, 255), + (135, 95, 0), + (135, 95, 95), + (135, 95, 135), + (135, 95, 175), + (135, 95, 215), + (135, 95, 255), + (135, 135, 0), + (135, 135, 95), + (135, 135, 135), + (135, 135, 175), + (135, 135, 215), + (135, 135, 255), + (135, 175, 0), + (135, 175, 95), + (135, 175, 135), + (135, 175, 175), + (135, 175, 215), + (135, 175, 255), + (135, 215, 0), + (135, 215, 95), + (135, 215, 135), + (135, 215, 175), + (135, 215, 215), + (135, 215, 255), + (135, 255, 0), + (135, 255, 95), + (135, 255, 135), + (135, 255, 175), + (135, 255, 215), + (135, 255, 255), + (175, 0, 0), + (175, 0, 95), + (175, 0, 135), + (175, 0, 175), + (175, 0, 215), + (175, 0, 255), + (175, 95, 0), + (175, 95, 95), + (175, 95, 135), + (175, 95, 175), + (175, 95, 215), + (175, 95, 255), + (175, 135, 0), + (175, 135, 95), + (175, 135, 135), + (175, 135, 175), + (175, 135, 215), + (175, 135, 255), + (175, 175, 0), + (175, 175, 95), + (175, 175, 135), + (175, 175, 175), + (175, 175, 215), + (175, 175, 255), + (175, 215, 0), + (175, 215, 95), + (175, 215, 135), + (175, 215, 175), + (175, 215, 215), + (175, 215, 255), + (175, 255, 0), + (175, 255, 95), + (175, 255, 135), + (175, 255, 175), + (175, 255, 215), + (175, 255, 255), + (215, 0, 0), + (215, 0, 95), + (215, 0, 135), + (215, 0, 175), + (215, 0, 215), + (215, 0, 255), + (215, 95, 0), + (215, 95, 95), + (215, 95, 135), + (215, 95, 175), + (215, 95, 215), + (215, 95, 255), + (215, 135, 0), + (215, 135, 95), + (215, 135, 135), + (215, 135, 175), + (215, 135, 215), + (215, 135, 255), + (215, 175, 0), + (215, 175, 95), + (215, 175, 135), + (215, 175, 175), + (215, 175, 215), + (215, 175, 255), + (215, 215, 0), + (215, 215, 95), + (215, 215, 135), + (215, 215, 175), + (215, 215, 215), + (215, 215, 255), + (215, 255, 0), + (215, 255, 95), + (215, 255, 135), + (215, 255, 175), + (215, 255, 215), + (215, 255, 255), + (255, 0, 0), + (255, 0, 95), + (255, 0, 135), + (255, 0, 175), + (255, 0, 215), + (255, 0, 255), + (255, 95, 0), + (255, 95, 95), + (255, 95, 135), + (255, 95, 175), + (255, 95, 215), + (255, 95, 255), + (255, 135, 0), + (255, 135, 95), + (255, 135, 135), + (255, 135, 175), + (255, 135, 215), + (255, 135, 255), + (255, 175, 0), + (255, 175, 95), + (255, 175, 135), + (255, 175, 175), + (255, 175, 215), + (255, 175, 255), + (255, 215, 0), + (255, 215, 95), + (255, 215, 135), + (255, 215, 175), + (255, 215, 215), + (255, 215, 255), + (255, 255, 0), + (255, 255, 95), + (255, 255, 135), + (255, 255, 175), + (255, 255, 215), + (255, 255, 255), + (8, 8, 8), + (18, 18, 18), + (28, 28, 28), + (38, 38, 38), + (48, 48, 48), + (58, 58, 58), + (68, 68, 68), + (78, 78, 78), + (88, 88, 88), + (98, 98, 98), + (108, 108, 108), + (118, 118, 118), + (128, 128, 128), + (138, 138, 138), + (148, 148, 148), + (158, 158, 158), + (168, 168, 168), + (178, 178, 178), + (188, 188, 188), + (198, 198, 198), + (208, 208, 208), + (218, 218, 218), + (228, 228, 228), + (238, 238, 238), + ] +) diff --git a/testbed/Textualize__rich/rich/_pick.py b/testbed/Textualize__rich/rich/_pick.py new file mode 100644 index 0000000000000000000000000000000000000000..4f6d8b2d79406012c5f8bae9c289ed5bf4d179cc --- /dev/null +++ b/testbed/Textualize__rich/rich/_pick.py @@ -0,0 +1,17 @@ +from typing import Optional + + +def pick_bool(*values: Optional[bool]) -> bool: + """Pick the first non-none bool or return the last value. + + Args: + *values (bool): Any number of boolean or None values. + + Returns: + bool: First non-none boolean. + """ + assert values, "1 or more values required" + for value in values: + if value is not None: + return value + return bool(value) diff --git a/testbed/Textualize__rich/rich/_ratio.py b/testbed/Textualize__rich/rich/_ratio.py new file mode 100644 index 0000000000000000000000000000000000000000..4d9010d44f69a713c472b8861637c45c39b12f57 --- /dev/null +++ b/testbed/Textualize__rich/rich/_ratio.py @@ -0,0 +1,70 @@ +from math import ceil +from typing import List + + +def ratio_reduce( + total: int, ratios: List[int], maximums: List[int], values: List[int] +) -> List[int]: + """Divide an integer total in to parts based on ratios. + + Args: + total (int): The total to divide. + ratios (List[int]): A list of integer ratios. + maximums (List[int]): List of maximums values for each slot. + values (List[int]): List of values + + Returns: + List[int]: A list of integers guaranteed to sum to total. + """ + ratios = [ratio if _max else 0 for ratio, _max in zip(ratios, maximums)] + total_ratio = sum(ratios) + if not total_ratio: + return values[:] + total_remaining = total + result: List[int] = [] + append = result.append + for ratio, maximum, value in zip(ratios, maximums, values): + if ratio and total_ratio > 0: + distributed = min(maximum, round(ratio * total_remaining / total_ratio)) + append(value - distributed) + total_remaining -= distributed + total_ratio -= ratio + else: + append(value) + return result + + +def ratio_distribute( + total: int, ratios: List[int], minimums: List[int] = None +) -> List[int]: + """Distribute an integer total in to parts based on ratios. + + Args: + total (int): The total to divide. + ratios (List[int]): A list of integer ratios. + minimums (List[int]): List of minimum values for each slot. + + Returns: + List[int]: A list of integers guaranteed to sum to total. + """ + if minimums: + ratios = [ratio if _min else 0 for ratio, _min in zip(ratios, minimums)] + total_ratio = sum(ratios) + assert total_ratio > 0, "Sum of ratios must be > 0" + + total_remaining = total + distributed_total: List[int] = [] + append = distributed_total.append + if minimums is None: + _minimums = [0] * len(ratios) + else: + _minimums = minimums + for ratio, minimum in zip(ratios, _minimums): + if total_ratio > 0: + distributed = max(minimum, ceil(ratio * total_remaining / total_ratio)) + else: + distributed = total_remaining + append(distributed) + total_ratio -= ratio + total_remaining -= distributed + return distributed_total diff --git a/testbed/Textualize__rich/rich/_spinners.py b/testbed/Textualize__rich/rich/_spinners.py new file mode 100644 index 0000000000000000000000000000000000000000..dc1db0777ee9285b0c51b7bfced7187c71c25699 --- /dev/null +++ b/testbed/Textualize__rich/rich/_spinners.py @@ -0,0 +1,848 @@ +""" +Spinners are from: +* cli-spinners: + MIT License + Copyright (c) Sindre Sorhus (sindresorhus.com) + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights to + use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + the Software, and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + IN THE SOFTWARE. +""" + +SPINNERS = { + "dots": { + "interval": 80, + "frames": ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"], + }, + "dots2": {"interval": 80, "frames": ["⣾", "⣽", "⣻", "⢿", "⡿", "⣟", "⣯", "⣷"]}, + "dots3": { + "interval": 80, + "frames": ["⠋", "⠙", "⠚", "⠞", "⠖", "⠦", "⠴", "⠲", "⠳", "⠓"], + }, + "dots4": { + "interval": 80, + "frames": [ + "⠄", + "⠆", + "⠇", + "⠋", + "⠙", + "⠸", + "⠰", + "⠠", + "⠰", + "⠸", + "⠙", + "⠋", + "⠇", + "⠆", + ], + }, + "dots5": { + "interval": 80, + "frames": [ + "⠋", + "⠙", + "⠚", + "⠒", + "⠂", + "⠂", + "⠒", + "⠲", + "⠴", + "⠦", + "⠖", + "⠒", + "⠐", + "⠐", + "⠒", + "⠓", + "⠋", + ], + }, + "dots6": { + "interval": 80, + "frames": [ + "⠁", + "⠉", + "⠙", + "⠚", + "⠒", + "⠂", + "⠂", + "⠒", + "⠲", + "⠴", + "⠤", + "⠄", + "⠄", + "⠤", + "⠴", + "⠲", + "⠒", + "⠂", + "⠂", + "⠒", + "⠚", + "⠙", + "⠉", + "⠁", + ], + }, + "dots7": { + "interval": 80, + "frames": [ + "⠈", + "⠉", + "⠋", + "⠓", + "⠒", + "⠐", + "⠐", + "⠒", + "⠖", + "⠦", + "⠤", + "⠠", + "⠠", + "⠤", + "⠦", + "⠖", + "⠒", + "⠐", + "⠐", + "⠒", + "⠓", + "⠋", + "⠉", + "⠈", + ], + }, + "dots8": { + "interval": 80, + "frames": [ + "⠁", + "⠁", + "⠉", + "⠙", + "⠚", + "⠒", + "⠂", + "⠂", + "⠒", + "⠲", + "⠴", + "⠤", + "⠄", + "⠄", + "⠤", + "⠠", + "⠠", + "⠤", + "⠦", + "⠖", + "⠒", + "⠐", + "⠐", + "⠒", + "⠓", + "⠋", + "⠉", + "⠈", + "⠈", + ], + }, + "dots9": {"interval": 80, "frames": ["⢹", "⢺", "⢼", "⣸", "⣇", "⡧", "⡗", "⡏"]}, + "dots10": {"interval": 80, "frames": ["⢄", "⢂", "⢁", "⡁", "⡈", "⡐", "⡠"]}, + "dots11": {"interval": 100, "frames": ["⠁", "⠂", "⠄", "⡀", "⢀", "⠠", "⠐", "⠈"]}, + "dots12": { + "interval": 80, + "frames": [ + "⢀⠀", + "⡀⠀", + "⠄⠀", + "⢂⠀", + "⡂⠀", + "⠅⠀", + "⢃⠀", + "⡃⠀", + "⠍⠀", + "⢋⠀", + "⡋⠀", + "⠍⠁", + "⢋⠁", + "⡋⠁", + "⠍⠉", + "⠋⠉", + "⠋⠉", + "⠉⠙", + "⠉⠙", + "⠉⠩", + "⠈⢙", + "⠈⡙", + "⢈⠩", + "⡀⢙", + "⠄⡙", + "⢂⠩", + "⡂⢘", + "⠅⡘", + "⢃⠨", + "⡃⢐", + "⠍⡐", + "⢋⠠", + "⡋⢀", + "⠍⡁", + "⢋⠁", + "⡋⠁", + "⠍⠉", + "⠋⠉", + "⠋⠉", + "⠉⠙", + "⠉⠙", + "⠉⠩", + "⠈⢙", + "⠈⡙", + "⠈⠩", + "⠀⢙", + "⠀⡙", + "⠀⠩", + "⠀⢘", + "⠀⡘", + "⠀⠨", + "⠀⢐", + "⠀⡐", + "⠀⠠", + "⠀⢀", + "⠀⡀", + ], + }, + "dots8Bit": { + "interval": 80, + "frames": [ + "⠀", + "⠁", + "⠂", + "⠃", + "⠄", + "⠅", + "⠆", + "⠇", + "⡀", + "⡁", + "⡂", + "⡃", + "⡄", + "⡅", + "⡆", + "⡇", + "⠈", + "⠉", + "⠊", + "⠋", + "⠌", + "⠍", + "⠎", + "⠏", + "⡈", + "⡉", + "⡊", + "⡋", + "⡌", + "⡍", + "⡎", + "⡏", + "⠐", + "⠑", + "⠒", + "⠓", + "⠔", + "⠕", + "⠖", + "⠗", + "⡐", + "⡑", + "⡒", + "⡓", + "⡔", + "⡕", + "⡖", + "⡗", + "⠘", + "⠙", + "⠚", + "⠛", + "⠜", + "⠝", + "⠞", + "⠟", + "⡘", + "⡙", + "⡚", + "⡛", + "⡜", + "⡝", + "⡞", + "⡟", + "⠠", + "⠡", + "⠢", + "⠣", + "⠤", + "⠥", + "⠦", + "⠧", + "⡠", + "⡡", + "⡢", + "⡣", + "⡤", + "⡥", + "⡦", + "⡧", + "⠨", + "⠩", + "⠪", + "⠫", + "⠬", + "⠭", + "⠮", + "⠯", + "⡨", + "⡩", + "⡪", + "⡫", + "⡬", + "⡭", + "⡮", + "⡯", + "⠰", + "⠱", + "⠲", + "⠳", + "⠴", + "⠵", + "⠶", + "⠷", + "⡰", + "⡱", + "⡲", + "⡳", + "⡴", + "⡵", + "⡶", + "⡷", + "⠸", + "⠹", + "⠺", + "⠻", + "⠼", + "⠽", + "⠾", + "⠿", + "⡸", + "⡹", + "⡺", + "⡻", + "⡼", + "⡽", + "⡾", + "⡿", + "⢀", + "⢁", + "⢂", + "⢃", + "⢄", + "⢅", + "⢆", + "⢇", + "⣀", + "⣁", + "⣂", + "⣃", + "⣄", + "⣅", + "⣆", + "⣇", + "⢈", + "⢉", + "⢊", + "⢋", + "⢌", + "⢍", + "⢎", + "⢏", + "⣈", + "⣉", + "⣊", + "⣋", + "⣌", + "⣍", + "⣎", + "⣏", + "⢐", + "⢑", + "⢒", + "⢓", + "⢔", + "⢕", + "⢖", + "⢗", + "⣐", + "⣑", + "⣒", + "⣓", + "⣔", + "⣕", + "⣖", + "⣗", + "⢘", + "⢙", + "⢚", + "⢛", + "⢜", + "⢝", + "⢞", + "⢟", + "⣘", + "⣙", + "⣚", + "⣛", + "⣜", + "⣝", + "⣞", + "⣟", + "⢠", + "⢡", + "⢢", + "⢣", + "⢤", + "⢥", + "⢦", + "⢧", + "⣠", + "⣡", + "⣢", + "⣣", + "⣤", + "⣥", + "⣦", + "⣧", + "⢨", + "⢩", + "⢪", + "⢫", + "⢬", + "⢭", + "⢮", + "⢯", + "⣨", + "⣩", + "⣪", + "⣫", + "⣬", + "⣭", + "⣮", + "⣯", + "⢰", + "⢱", + "⢲", + "⢳", + "⢴", + "⢵", + "⢶", + "⢷", + "⣰", + "⣱", + "⣲", + "⣳", + "⣴", + "⣵", + "⣶", + "⣷", + "⢸", + "⢹", + "⢺", + "⢻", + "⢼", + "⢽", + "⢾", + "⢿", + "⣸", + "⣹", + "⣺", + "⣻", + "⣼", + "⣽", + "⣾", + "⣿", + ], + }, + "line": {"interval": 130, "frames": ["-", "\\", "|", "/"]}, + "line2": {"interval": 100, "frames": ["⠂", "-", "–", "—", "–", "-"]}, + "pipe": {"interval": 100, "frames": ["┤", "┘", "┴", "└", "├", "┌", "┬", "┐"]}, + "simpleDots": {"interval": 400, "frames": [". ", ".. ", "...", " "]}, + "simpleDotsScrolling": { + "interval": 200, + "frames": [". ", ".. ", "...", " ..", " .", " "], + }, + "star": {"interval": 70, "frames": ["✶", "✸", "✹", "✺", "✹", "✷"]}, + "star2": {"interval": 80, "frames": ["+", "x", "*"]}, + "flip": { + "interval": 70, + "frames": ["_", "_", "_", "-", "`", "`", "'", "´", "-", "_", "_", "_"], + }, + "hamburger": {"interval": 100, "frames": ["☱", "☲", "☴"]}, + "growVertical": { + "interval": 120, + "frames": ["▁", "▃", "▄", "▅", "▆", "▇", "▆", "▅", "▄", "▃"], + }, + "growHorizontal": { + "interval": 120, + "frames": ["▏", "▎", "▍", "▌", "▋", "▊", "▉", "▊", "▋", "▌", "▍", "▎"], + }, + "balloon": {"interval": 140, "frames": [" ", ".", "o", "O", "@", "*", " "]}, + "balloon2": {"interval": 120, "frames": [".", "o", "O", "°", "O", "o", "."]}, + "noise": {"interval": 100, "frames": ["▓", "▒", "░"]}, + "bounce": {"interval": 120, "frames": ["⠁", "⠂", "⠄", "⠂"]}, + "boxBounce": {"interval": 120, "frames": ["▖", "▘", "▝", "▗"]}, + "boxBounce2": {"interval": 100, "frames": ["▌", "▀", "▐", "▄"]}, + "triangle": {"interval": 50, "frames": ["◢", "◣", "◤", "◥"]}, + "arc": {"interval": 100, "frames": ["◜", "◠", "◝", "◞", "◡", "◟"]}, + "circle": {"interval": 120, "frames": ["◡", "⊙", "◠"]}, + "squareCorners": {"interval": 180, "frames": ["◰", "◳", "◲", "◱"]}, + "circleQuarters": {"interval": 120, "frames": ["◴", "◷", "◶", "◵"]}, + "circleHalves": {"interval": 50, "frames": ["◐", "◓", "◑", "◒"]}, + "squish": {"interval": 100, "frames": ["╫", "╪"]}, + "toggle": {"interval": 250, "frames": ["⊶", "⊷"]}, + "toggle2": {"interval": 80, "frames": ["▫", "▪"]}, + "toggle3": {"interval": 120, "frames": ["□", "■"]}, + "toggle4": {"interval": 100, "frames": ["■", "□", "▪", "▫"]}, + "toggle5": {"interval": 100, "frames": ["▮", "▯"]}, + "toggle6": {"interval": 300, "frames": ["ဝ", "၀"]}, + "toggle7": {"interval": 80, "frames": ["⦾", "⦿"]}, + "toggle8": {"interval": 100, "frames": ["◍", "◌"]}, + "toggle9": {"interval": 100, "frames": ["◉", "◎"]}, + "toggle10": {"interval": 100, "frames": ["㊂", "㊀", "㊁"]}, + "toggle11": {"interval": 50, "frames": ["⧇", "⧆"]}, + "toggle12": {"interval": 120, "frames": ["☗", "☖"]}, + "toggle13": {"interval": 80, "frames": ["=", "*", "-"]}, + "arrow": {"interval": 100, "frames": ["←", "↖", "↑", "↗", "→", "↘", "↓", "↙"]}, + "arrow2": { + "interval": 80, + "frames": ["⬆️ ", "↗️ ", "➡️ ", "↘️ ", "⬇️ ", "↙️ ", "⬅️ ", "↖️ "], + }, + "arrow3": { + "interval": 120, + "frames": ["▹▹▹▹▹", "▸▹▹▹▹", "▹▸▹▹▹", "▹▹▸▹▹", "▹▹▹▸▹", "▹▹▹▹▸"], + }, + "bouncingBar": { + "interval": 80, + "frames": [ + "[ ]", + "[= ]", + "[== ]", + "[=== ]", + "[ ===]", + "[ ==]", + "[ =]", + "[ ]", + "[ =]", + "[ ==]", + "[ ===]", + "[====]", + "[=== ]", + "[== ]", + "[= ]", + ], + }, + "bouncingBall": { + "interval": 80, + "frames": [ + "( ● )", + "( ● )", + "( ● )", + "( ● )", + "( ●)", + "( ● )", + "( ● )", + "( ● )", + "( ● )", + "(● )", + ], + }, + "smiley": {"interval": 200, "frames": ["😄 ", "😝 "]}, + "monkey": {"interval": 300, "frames": ["🙈 ", "🙈 ", "🙉 ", "🙊 "]}, + "hearts": {"interval": 100, "frames": ["💛 ", "💙 ", "💜 ", "💚 ", "❤️ "]}, + "clock": { + "interval": 100, + "frames": [ + "🕛 ", + "🕐 ", + "🕑 ", + "🕒 ", + "🕓 ", + "🕔 ", + "🕕 ", + "🕖 ", + "🕗 ", + "🕘 ", + "🕙 ", + "🕚 ", + ], + }, + "earth": {"interval": 180, "frames": ["🌍 ", "🌎 ", "🌏 "]}, + "material": { + "interval": 17, + "frames": [ + "█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁", + "██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁", + "███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁", + "████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁", + "██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁", + "██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁", + "███████▁▁▁▁▁▁▁▁▁▁▁▁▁", + "████████▁▁▁▁▁▁▁▁▁▁▁▁", + "█████████▁▁▁▁▁▁▁▁▁▁▁", + "█████████▁▁▁▁▁▁▁▁▁▁▁", + "██████████▁▁▁▁▁▁▁▁▁▁", + "███████████▁▁▁▁▁▁▁▁▁", + "█████████████▁▁▁▁▁▁▁", + "██████████████▁▁▁▁▁▁", + "██████████████▁▁▁▁▁▁", + "▁██████████████▁▁▁▁▁", + "▁██████████████▁▁▁▁▁", + "▁██████████████▁▁▁▁▁", + "▁▁██████████████▁▁▁▁", + "▁▁▁██████████████▁▁▁", + "▁▁▁▁█████████████▁▁▁", + "▁▁▁▁██████████████▁▁", + "▁▁▁▁██████████████▁▁", + "▁▁▁▁▁██████████████▁", + "▁▁▁▁▁██████████████▁", + "▁▁▁▁▁██████████████▁", + "▁▁▁▁▁▁██████████████", + "▁▁▁▁▁▁██████████████", + "▁▁▁▁▁▁▁█████████████", + "▁▁▁▁▁▁▁█████████████", + "▁▁▁▁▁▁▁▁████████████", + "▁▁▁▁▁▁▁▁████████████", + "▁▁▁▁▁▁▁▁▁███████████", + "▁▁▁▁▁▁▁▁▁███████████", + "▁▁▁▁▁▁▁▁▁▁██████████", + "▁▁▁▁▁▁▁▁▁▁██████████", + "▁▁▁▁▁▁▁▁▁▁▁▁████████", + "▁▁▁▁▁▁▁▁▁▁▁▁▁███████", + "▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████", + "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████", + "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████", + "█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████", + "██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███", + "██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███", + "███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███", + "████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██", + "█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█", + "█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█", + "██████▁▁▁▁▁▁▁▁▁▁▁▁▁█", + "████████▁▁▁▁▁▁▁▁▁▁▁▁", + "█████████▁▁▁▁▁▁▁▁▁▁▁", + "█████████▁▁▁▁▁▁▁▁▁▁▁", + "█████████▁▁▁▁▁▁▁▁▁▁▁", + "█████████▁▁▁▁▁▁▁▁▁▁▁", + "███████████▁▁▁▁▁▁▁▁▁", + "████████████▁▁▁▁▁▁▁▁", + "████████████▁▁▁▁▁▁▁▁", + "██████████████▁▁▁▁▁▁", + "██████████████▁▁▁▁▁▁", + "▁██████████████▁▁▁▁▁", + "▁██████████████▁▁▁▁▁", + "▁▁▁█████████████▁▁▁▁", + "▁▁▁▁▁████████████▁▁▁", + "▁▁▁▁▁████████████▁▁▁", + "▁▁▁▁▁▁███████████▁▁▁", + "▁▁▁▁▁▁▁▁█████████▁▁▁", + "▁▁▁▁▁▁▁▁█████████▁▁▁", + "▁▁▁▁▁▁▁▁▁█████████▁▁", + "▁▁▁▁▁▁▁▁▁█████████▁▁", + "▁▁▁▁▁▁▁▁▁▁█████████▁", + "▁▁▁▁▁▁▁▁▁▁▁████████▁", + "▁▁▁▁▁▁▁▁▁▁▁████████▁", + "▁▁▁▁▁▁▁▁▁▁▁▁███████▁", + "▁▁▁▁▁▁▁▁▁▁▁▁███████▁", + "▁▁▁▁▁▁▁▁▁▁▁▁▁███████", + "▁▁▁▁▁▁▁▁▁▁▁▁▁███████", + "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████", + "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████", + "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████", + "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████", + "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███", + "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███", + "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██", + "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██", + "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██", + "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█", + "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█", + "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█", + "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁", + "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁", + "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁", + "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁", + ], + }, + "moon": { + "interval": 80, + "frames": ["🌑 ", "🌒 ", "🌓 ", "🌔 ", "🌕 ", "🌖 ", "🌗 ", "🌘 "], + }, + "runner": {"interval": 140, "frames": ["🚶 ", "🏃 "]}, + "pong": { + "interval": 80, + "frames": [ + "▐⠂ ▌", + "▐⠈ ▌", + "▐ ⠂ ▌", + "▐ ⠠ ▌", + "▐ ⡀ ▌", + "▐ ⠠ ▌", + "▐ ⠂ ▌", + "▐ ⠈ ▌", + "▐ ⠂ ▌", + "▐ ⠠ ▌", + "▐ ⡀ ▌", + "▐ ⠠ ▌", + "▐ ⠂ ▌", + "▐ ⠈ ▌", + "▐ ⠂▌", + "▐ ⠠▌", + "▐ ⡀▌", + "▐ ⠠ ▌", + "▐ ⠂ ▌", + "▐ ⠈ ▌", + "▐ ⠂ ▌", + "▐ ⠠ ▌", + "▐ ⡀ ▌", + "▐ ⠠ ▌", + "▐ ⠂ ▌", + "▐ ⠈ ▌", + "▐ ⠂ ▌", + "▐ ⠠ ▌", + "▐ ⡀ ▌", + "▐⠠ ▌", + ], + }, + "shark": { + "interval": 120, + "frames": [ + "▐|\\____________▌", + "▐_|\\___________▌", + "▐__|\\__________▌", + "▐___|\\_________▌", + "▐____|\\________▌", + "▐_____|\\_______▌", + "▐______|\\______▌", + "▐_______|\\_____▌", + "▐________|\\____▌", + "▐_________|\\___▌", + "▐__________|\\__▌", + "▐___________|\\_▌", + "▐____________|\\▌", + "▐____________/|▌", + "▐___________/|_▌", + "▐__________/|__▌", + "▐_________/|___▌", + "▐________/|____▌", + "▐_______/|_____▌", + "▐______/|______▌", + "▐_____/|_______▌", + "▐____/|________▌", + "▐___/|_________▌", + "▐__/|__________▌", + "▐_/|___________▌", + "▐/|____________▌", + ], + }, + "dqpb": {"interval": 100, "frames": ["d", "q", "p", "b"]}, + "weather": { + "interval": 100, + "frames": [ + "☀️ ", + "☀️ ", + "☀️ ", + "🌤 ", + "⛅️ ", + "🌥 ", + "☁️ ", + "🌧 ", + "🌨 ", + "🌧 ", + "🌨 ", + "🌧 ", + "🌨 ", + "⛈ ", + "🌨 ", + "🌧 ", + "🌨 ", + "☁️ ", + "🌥 ", + "⛅️ ", + "🌤 ", + "☀️ ", + "☀️ ", + ], + }, + "christmas": {"interval": 400, "frames": ["🌲", "🎄"]}, + "grenade": { + "interval": 80, + "frames": [ + "، ", + "′ ", + " ´ ", + " ‾ ", + " ⸌", + " ⸊", + " |", + " ⁎", + " ⁕", + " ෴ ", + " ⁓", + " ", + " ", + " ", + ], + }, + "point": {"interval": 125, "frames": ["∙∙∙", "●∙∙", "∙●∙", "∙∙●", "∙∙∙"]}, + "layer": {"interval": 150, "frames": ["-", "=", "≡"]}, + "betaWave": { + "interval": 80, + "frames": [ + "ρββββββ", + "βρβββββ", + "ββρββββ", + "βββρβββ", + "ββββρββ", + "βββββρβ", + "ββββββρ", + ], + }, + "aesthetic": { + "interval": 80, + "frames": [ + "▰▱▱▱▱▱▱", + "▰▰▱▱▱▱▱", + "▰▰▰▱▱▱▱", + "▰▰▰▰▱▱▱", + "▰▰▰▰▰▱▱", + "▰▰▰▰▰▰▱", + "▰▰▰▰▰▰▰", + "▰▱▱▱▱▱▱", + ], + }, +} diff --git a/testbed/Textualize__rich/rich/_stack.py b/testbed/Textualize__rich/rich/_stack.py new file mode 100644 index 0000000000000000000000000000000000000000..194564e761ddae165b39ef6598877e2e3820af0a --- /dev/null +++ b/testbed/Textualize__rich/rich/_stack.py @@ -0,0 +1,16 @@ +from typing import List, TypeVar + +T = TypeVar("T") + + +class Stack(List[T]): + """A small shim over builtin list.""" + + @property + def top(self) -> T: + """Get top of stack.""" + return self[-1] + + def push(self, item: T) -> None: + """Push an item on to the stack (append in stack nomenclature).""" + self.append(item) diff --git a/testbed/Textualize__rich/rich/_windows.py b/testbed/Textualize__rich/rich/_windows.py new file mode 100644 index 0000000000000000000000000000000000000000..d252d1f9ea27c3e6e5e69c8289c5dfe7dd337261 --- /dev/null +++ b/testbed/Textualize__rich/rich/_windows.py @@ -0,0 +1,71 @@ +import sys + +from dataclasses import dataclass + + +@dataclass +class WindowsConsoleFeatures: + """Windows features available.""" + + vt: bool = False + """The console supports VT codes.""" + truecolor: bool = False + """The console supports truecolor.""" + + +try: + import ctypes + from ctypes import wintypes + from ctypes import LibraryLoader + + windll = LibraryLoader(ctypes.WinDLL) # type: ignore +except (AttributeError, ImportError, ValueError): + + # Fallback if we can't load the Windows DLL + def get_windows_console_features() -> WindowsConsoleFeatures: + features = WindowsConsoleFeatures() + return features + + +else: + + STDOUT = -11 + ENABLE_VIRTUAL_TERMINAL_PROCESSING = 4 + _GetConsoleMode = windll.kernel32.GetConsoleMode + _GetConsoleMode.argtypes = [wintypes.HANDLE, wintypes.LPDWORD] + _GetConsoleMode.restype = wintypes.BOOL + + _GetStdHandle = windll.kernel32.GetStdHandle + _GetStdHandle.argtypes = [ + wintypes.DWORD, + ] + _GetStdHandle.restype = wintypes.HANDLE + + def get_windows_console_features() -> WindowsConsoleFeatures: + """Get windows console features. + + Returns: + WindowsConsoleFeatures: An instance of WindowsConsoleFeatures. + """ + handle = _GetStdHandle(STDOUT) + console_mode = wintypes.DWORD() + result = _GetConsoleMode(handle, console_mode) + vt = bool(result and console_mode.value & ENABLE_VIRTUAL_TERMINAL_PROCESSING) + truecolor = False + if vt: + win_version = sys.getwindowsversion() # type: ignore + truecolor = win_version.major > 10 or ( + win_version.major == 10 and win_version.build >= 15063 + ) + features = WindowsConsoleFeatures(vt=vt, truecolor=truecolor) + return features + + +if __name__ == "__main__": + import platform + + features = get_windows_console_features() + from rich import print + + print(f'platform="{platform.system()}"') + print(repr(features)) diff --git a/testbed/Textualize__rich/rich/_wrap.py b/testbed/Textualize__rich/rich/_wrap.py new file mode 100644 index 0000000000000000000000000000000000000000..b537757a573be8777c45b0b265a13a15d90bdf29 --- /dev/null +++ b/testbed/Textualize__rich/rich/_wrap.py @@ -0,0 +1,55 @@ +import re +from typing import Iterable, List, Tuple + +from .cells import cell_len, chop_cells +from ._loop import loop_last + +re_word = re.compile(r"\s*\S+\s*") + + +def words(text: str) -> Iterable[Tuple[int, int, str]]: + position = 0 + word_match = re_word.match(text, position) + while word_match is not None: + start, end = word_match.span() + word = word_match.group(0) + yield start, end, word + word_match = re_word.match(text, end) + + +def divide_line(text: str, width: int, fold: bool = True) -> List[int]: + divides: List[int] = [] + append = divides.append + line_position = 0 + _cell_len = cell_len + for start, _end, word in words(text): + word_length = _cell_len(word.rstrip()) + if line_position + word_length > width: + if word_length > width: + if fold: + for last, line in loop_last( + chop_cells(word, width, position=line_position) + ): + if last: + line_position = _cell_len(line) + else: + start += len(line) + append(start) + else: + if start: + append(start) + line_position = _cell_len(word) + elif line_position and start: + append(start) + line_position = _cell_len(word) + else: + line_position += _cell_len(word) + return divides + + +if __name__ == "__main__": # pragma: no cover + from .console import Console + + console = Console(width=10) + console.print("12345 abcdefghijklmnopqrstuvwyxzABCDEFGHIJKLMNOPQRSTUVWXYZ 12345") + print(chop_cells("abcdefghijklmnopqrstuvwxyz", 10, position=2)) diff --git a/testbed/Textualize__rich/rich/abc.py b/testbed/Textualize__rich/rich/abc.py new file mode 100644 index 0000000000000000000000000000000000000000..42db7c00202962561f5dfdb295b2cab54d4868c7 --- /dev/null +++ b/testbed/Textualize__rich/rich/abc.py @@ -0,0 +1,33 @@ +from abc import ABC + + +class RichRenderable(ABC): + """An abstract base class for Rich renderables. + + Note that there is no need to extend this class, the intended use is to check if an + object supports the Rich renderable protocol. For example:: + + if isinstance(my_object, RichRenderable): + console.print(my_object) + + """ + + @classmethod + def __subclasshook__(cls, other: type) -> bool: + """Check if this class supports the rich render protocol.""" + return hasattr(other, "__rich_console__") or hasattr(other, "__rich__") + + +if __name__ == "__main__": # pragma: no cover + from rich.text import Text + + t = Text() + print(isinstance(Text, RichRenderable)) + print(isinstance(t, RichRenderable)) + + class Foo: + pass + + f = Foo() + print(isinstance(f, RichRenderable)) + print(isinstance("", RichRenderable)) diff --git a/testbed/Textualize__rich/rich/ansi.py b/testbed/Textualize__rich/rich/ansi.py new file mode 100644 index 0000000000000000000000000000000000000000..c2ec3581dd13f76db1fabef1dfa47a21dbe27d46 --- /dev/null +++ b/testbed/Textualize__rich/rich/ansi.py @@ -0,0 +1,229 @@ +from contextlib import suppress +import re +from typing import Iterable, NamedTuple + +from .color import Color +from .style import Style +from .text import Text + +re_ansi = re.compile(r"(?:\x1b\[(.*?)m)|(?:\x1b\](.*?)\x1b\\)") +re_csi = re.compile(r"\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])") + + +class _AnsiToken(NamedTuple): + """Result of ansi tokenized string.""" + + plain: str = "" + sgr: str = "" + osc: str = "" + + +def _ansi_tokenize(ansi_text: str) -> Iterable[_AnsiToken]: + """Tokenize a string in to plain text and ANSI codes. + + Args: + ansi_text (str): A String containing ANSI codes. + + Yields: + AnsiToken: A named tuple of (plain, sgr, osc) + """ + + def remove_csi(ansi_text: str) -> str: + """Remove unknown CSI sequences.""" + return re_csi.sub("", ansi_text) + + position = 0 + for match in re_ansi.finditer(ansi_text): + start, end = match.span(0) + sgr, osc = match.groups() + if start > position: + yield _AnsiToken(remove_csi(ansi_text[position:start])) + yield _AnsiToken("", sgr, osc) + position = end + if position < len(ansi_text): + yield _AnsiToken(remove_csi(ansi_text[position:])) + + +SGR_STYLE_MAP = { + 1: "bold", + 2: "dim", + 3: "italic", + 4: "underline", + 5: "blink", + 6: "blink2", + 7: "reverse", + 8: "conceal", + 9: "strike", + 21: "underline2", + 22: "not dim not bold", + 23: "not italic", + 24: "not underline", + 25: "not blink", + 26: "not blink2", + 27: "not reverse", + 28: "not conceal", + 29: "not strike", + 30: "color(0)", + 31: "color(1)", + 32: "color(2)", + 33: "color(3)", + 34: "color(4)", + 35: "color(5)", + 36: "color(6)", + 37: "color(7)", + 39: "default", + 40: "on color(0)", + 41: "on color(1)", + 42: "on color(2)", + 43: "on color(3)", + 44: "on color(4)", + 45: "on color(5)", + 46: "on color(6)", + 47: "on color(7)", + 49: "on default", + 51: "frame", + 52: "encircle", + 53: "overline", + 54: "not frame not encircle", + 55: "not overline", + 90: "color(8)", + 91: "color(9)", + 92: "color(10)", + 93: "color(11)", + 94: "color(12)", + 95: "color(13)", + 96: "color(14)", + 97: "color(15)", + 100: "on color(8)", + 101: "on color(9)", + 102: "on color(10)", + 103: "on color(11)", + 104: "on color(12)", + 105: "on color(13)", + 106: "on color(14)", + 107: "on color(15)", +} + + +class AnsiDecoder: + """Translate ANSI code in to styled Text.""" + + def __init__(self) -> None: + self.style = Style.null() + + def decode(self, terminal_text: str) -> Iterable[Text]: + """Decode ANSI codes in an interable of lines. + + Args: + lines (Iterable[str]): An iterable of lines of terminal output. + + + Yields: + Text: Marked up Text. + """ + for line in terminal_text.splitlines(): + yield self.decode_line(line) + + def decode_line(self, line: str) -> Text: + """Decode a line containing ansi codes. + + Args: + line (str): A line of terminal output. + + Returns: + Text: A Text instance marked up according to ansi codes. + """ + from_ansi = Color.from_ansi + from_rgb = Color.from_rgb + _Style = Style + text = Text() + append = text.append + line = line.rsplit("\r", 1)[-1] + for token in _ansi_tokenize(line): + plain_text, sgr, osc = token + if plain_text: + append(plain_text, self.style or None) + elif osc: + if osc.startswith("8;"): + _params, semicolon, link = osc[2:].partition(";") + if semicolon: + self.style = self.style.update_link(link or None) + elif sgr: + # Translate in to semi-colon separated codes + # Ignore invalid codes, because we want to be lenient + codes = [ + min(255, int(_code)) for _code in sgr.split(";") if _code.isdigit() + ] + iter_codes = iter(codes) + for code in iter_codes: + if code == 0: + # reset + self.style = _Style.null() + elif code in SGR_STYLE_MAP: + # styles + self.style += _Style.parse(SGR_STYLE_MAP[code]) + elif code == 38: + #  Foreground + with suppress(StopIteration): + color_type = next(iter_codes) + if color_type == 5: + self.style += _Style.from_color( + from_ansi(next(iter_codes)) + ) + elif color_type == 2: + self.style += _Style.from_color( + from_rgb( + next(iter_codes), + next(iter_codes), + next(iter_codes), + ) + ) + elif code == 48: + # Background + with suppress(StopIteration): + color_type = next(iter_codes) + if color_type == 5: + self.style += _Style.from_color( + None, from_ansi(next(iter_codes)) + ) + elif color_type == 2: + self.style += _Style.from_color( + None, + from_rgb( + next(iter_codes), + next(iter_codes), + next(iter_codes), + ), + ) + + return text + + +if __name__ == "__main__": # pragma: no cover + import pty + import io + import os + import sys + + decoder = AnsiDecoder() + + stdout = io.BytesIO() + + def read(fd): + data = os.read(fd, 1024) + stdout.write(data) + return data + + pty.spawn(sys.argv[1:], read) + + from .console import Console + + console = Console(record=True) + + stdout_result = stdout.getvalue().decode("utf-8") + print(stdout_result) + + for line in decoder.decode(stdout_result): + console.print(line) + + console.save_html("stdout.html") diff --git a/testbed/Textualize__rich/rich/bar.py b/testbed/Textualize__rich/rich/bar.py new file mode 100644 index 0000000000000000000000000000000000000000..5764b85c38ed1d9334595210a9a1b68fec922b03 --- /dev/null +++ b/testbed/Textualize__rich/rich/bar.py @@ -0,0 +1,89 @@ +from typing import Union + +from .color import Color +from .console import Console, ConsoleOptions, RenderResult +from .jupyter import JupyterMixin +from .measure import Measurement +from .segment import Segment +from .style import Style + +# There are left-aligned characters for 1/8 to 7/8, but +# the right-aligned characters exist only for 1/8 and 4/8. +BEGIN_BLOCK_ELEMENTS = ["█", "█", "█", "▐", "▐", "▐", "▕", "▕"] +END_BLOCK_ELEMENTS = [" ", "▏", "▎", "▍", "▌", "▋", "▊", "▉"] +FULL_BLOCK = "█" + + +class Bar(JupyterMixin): + """Renders a solid block bar. + + Args: + size (float): Value for the end of the bar. + begin (float): Begin point (between 0 and size, inclusive). + end (float): End point (between 0 and size, inclusive). + width (int, optional): Width of the bar, or ``None`` for maximum width. Defaults to None. + color (Union[Color, str], optional): Color of the bar. Defaults to "default". + bgcolor (Union[Color, str], optional): Color of bar background. Defaults to "default". + """ + + def __init__( + self, + size: float, + begin: float, + end: float, + *, + width: int = None, + color: Union[Color, str] = "default", + bgcolor: Union[Color, str] = "default", + ): + self.size = size + self.begin = max(begin, 0) + self.end = min(end, size) + self.width = width + self.style = Style(color=color, bgcolor=bgcolor) + + def __repr__(self) -> str: + return f"Bar({self.size}, {self.begin}, {self.end})" + + def __rich_console__( + self, console: Console, options: ConsoleOptions + ) -> RenderResult: + + width = min(self.width or options.max_width, options.max_width) + + if self.begin >= self.end: + yield Segment(" " * width, self.style) + yield Segment.line() + return + + prefix_complete_eights = int(width * 8 * self.begin / self.size) + prefix_bar_count = prefix_complete_eights // 8 + prefix_eights_count = prefix_complete_eights % 8 + + body_complete_eights = int(width * 8 * self.end / self.size) + body_bar_count = body_complete_eights // 8 + body_eights_count = body_complete_eights % 8 + + # When start and end fall into the same cell, we ideally should render + # a symbol that's "center-aligned", but there is no good symbol in Unicode. + # In this case, we fall back to right-aligned block symbol for simplicity. + + prefix = " " * prefix_bar_count + if prefix_eights_count: + prefix += BEGIN_BLOCK_ELEMENTS[prefix_eights_count] + + body = FULL_BLOCK * body_bar_count + if body_eights_count: + body += END_BLOCK_ELEMENTS[body_eights_count] + + suffix = " " * (width - len(body)) + + yield Segment(prefix + body[len(prefix) :] + suffix, self.style) + yield Segment.line() + + def __rich_measure__(self, console: Console, max_width: int) -> Measurement: + return ( + Measurement(self.width, self.width) + if self.width is not None + else Measurement(4, max_width) + ) diff --git a/testbed/Textualize__rich/rich/box.py b/testbed/Textualize__rich/rich/box.py new file mode 100644 index 0000000000000000000000000000000000000000..b70b5c2cdc4de0e1aa8d1d892f934844791cea75 --- /dev/null +++ b/testbed/Textualize__rich/rich/box.py @@ -0,0 +1,478 @@ +from typing import TYPE_CHECKING, Iterable, List + +from typing_extensions import Literal + +from ._loop import loop_last + +if TYPE_CHECKING: + from rich.console import ConsoleOptions + + +class Box: + """Defines characters to render boxes. + + ┌─┬┐ top + │ ││ head + ├─┼┤ head_row + │ ││ mid + ├─┼┤ row + ├─┼┤ foot_row + │ ││ foot + └─┴┘ bottom + + Args: + box (str): Characters making up box. + ascii (bool, optional): True if this box uses ascii characters only. Default is False. + """ + + def __init__(self, box: str, *, ascii: bool = False) -> None: + self._box = box + self.ascii = ascii + line1, line2, line3, line4, line5, line6, line7, line8 = box.splitlines() + # top + self.top_left, self.top, self.top_divider, self.top_right = iter(line1) + # head + self.head_left, _, self.head_vertical, self.head_right = iter(line2) + # head_row + ( + self.head_row_left, + self.head_row_horizontal, + self.head_row_cross, + self.head_row_right, + ) = iter(line3) + + # mid + self.mid_left, _, self.mid_vertical, self.mid_right = iter(line4) + # row + self.row_left, self.row_horizontal, self.row_cross, self.row_right = iter(line5) + # foot_row + ( + self.foot_row_left, + self.foot_row_horizontal, + self.foot_row_cross, + self.foot_row_right, + ) = iter(line6) + # foot + self.foot_left, _, self.foot_vertical, self.foot_right = iter(line7) + # bottom + self.bottom_left, self.bottom, self.bottom_divider, self.bottom_right = iter( + line8 + ) + + def __repr__(self) -> str: + return "Box(...)" + + def __str__(self) -> str: + return self._box + + def substitute(self, options: "ConsoleOptions", safe: bool = True) -> "Box": + """Substitute this box for another if it won't render due to platform issues. + + Args: + options (ConsoleOptions): Console options used in rendering. + safe (bool, optional): Substitute this for another Box if there are known problems + displaying on the platform (currently only relevant on Windows). Default is True. + + Returns: + Box: A different Box or the same Box. + """ + box = self + if options.legacy_windows and safe: + box = LEGACY_WINDOWS_SUBSTITUTIONS.get(box, box) + if options.ascii_only and not box.ascii: + box = ASCII + return box + + def get_top(self, widths: Iterable[int]) -> str: + """Get the top of a simple box. + + Args: + widths (List[int]): Widths of columns. + + Returns: + str: A string of box characters. + """ + + parts: List[str] = [] + append = parts.append + append(self.top_left) + for last, width in loop_last(widths): + append(self.top * width) + if not last: + append(self.top_divider) + append(self.top_right) + return "".join(parts) + + def get_row( + self, + widths: Iterable[int], + level: Literal["head", "row", "foot", "mid"] = "row", + edge: bool = True, + ) -> str: + """Get the top of a simple box. + + Args: + width (List[int]): Widths of columns. + + Returns: + str: A string of box characters. + """ + if level == "head": + left = self.head_row_left + horizontal = self.head_row_horizontal + cross = self.head_row_cross + right = self.head_row_right + elif level == "row": + left = self.row_left + horizontal = self.row_horizontal + cross = self.row_cross + right = self.row_right + elif level == "mid": + left = self.mid_left + horizontal = " " + cross = self.mid_vertical + right = self.mid_right + elif level == "foot": + left = self.foot_row_left + horizontal = self.foot_row_horizontal + cross = self.foot_row_cross + right = self.foot_row_right + else: + raise ValueError("level must be 'head', 'row' or 'foot'") + + parts: List[str] = [] + append = parts.append + if edge: + append(left) + for last, width in loop_last(widths): + append(horizontal * width) + if not last: + append(cross) + if edge: + append(right) + return "".join(parts) + + def get_bottom(self, widths: Iterable[int]) -> str: + """Get the bottom of a simple box. + + Args: + widths (List[int]): Widths of columns. + + Returns: + str: A string of box characters. + """ + + parts: List[str] = [] + append = parts.append + append(self.bottom_left) + for last, width in loop_last(widths): + append(self.bottom * width) + if not last: + append(self.bottom_divider) + append(self.bottom_right) + return "".join(parts) + + +ASCII: Box = Box( + """\ ++--+ +| || +|-+| +| || +|-+| +|-+| +| || ++--+ +""", + ascii=True, +) + +ASCII2: Box = Box( + """\ ++-++ +| || ++-++ +| || ++-++ ++-++ +| || ++-++ +""", + ascii=True, +) + +ASCII_DOUBLE_HEAD: Box = Box( + """\ ++-++ +| || ++=++ +| || ++-++ ++-++ +| || ++-++ +""", + ascii=True, +) + +SQUARE: Box = Box( + """\ +┌─┬┐ +│ ││ +├─┼┤ +│ ││ +├─┼┤ +├─┼┤ +│ ││ +└─┴┘ +""" +) + +SQUARE_DOUBLE_HEAD: Box = Box( + """\ +┌─┬┐ +│ ││ +╞═╪╡ +│ ││ +├─┼┤ +├─┼┤ +│ ││ +└─┴┘ +""" +) + +MINIMAL: Box = Box( + """\ + ╷ + │ +╶─┼╴ + │ +╶─┼╴ +╶─┼╴ + │ + ╵ +""" +) + + +MINIMAL_HEAVY_HEAD: Box = Box( + """\ + ╷ + │ +╺━┿╸ + │ +╶─┼╴ +╶─┼╴ + │ + ╵ +""" +) + +MINIMAL_DOUBLE_HEAD: Box = Box( + """\ + ╷ + │ + ═╪ + │ + ─┼ + ─┼ + │ + ╵ +""" +) + + +SIMPLE: Box = Box( + """\ + + + ── + + + ── + + +""" +) + +SIMPLE_HEAD: Box = Box( + """\ + + + ── + + + + + +""" +) + + +SIMPLE_HEAVY: Box = Box( + """\ + + + ━━ + + + ━━ + + +""" +) + + +HORIZONTALS: Box = Box( + """\ + ── + + ── + + ── + ── + + ── +""" +) + +ROUNDED: Box = Box( + """\ +╭─┬╮ +│ ││ +├─┼┤ +│ ││ +├─┼┤ +├─┼┤ +│ ││ +╰─┴╯ +""" +) + +HEAVY: Box = Box( + """\ +┏━┳┓ +┃ ┃┃ +┣━╋┫ +┃ ┃┃ +┣━╋┫ +┣━╋┫ +┃ ┃┃ +┗━┻┛ +""" +) + +HEAVY_EDGE: Box = Box( + """\ +┏━┯┓ +┃ │┃ +┠─┼┨ +┃ │┃ +┠─┼┨ +┠─┼┨ +┃ │┃ +┗━┷┛ +""" +) + +HEAVY_HEAD: Box = Box( + """\ +┏━┳┓ +┃ ┃┃ +┡━╇┩ +│ ││ +├─┼┤ +├─┼┤ +│ ││ +└─┴┘ +""" +) + +DOUBLE: Box = Box( + """\ +╔═╦╗ +║ ║║ +╠═╬╣ +║ ║║ +╠═╬╣ +╠═╬╣ +║ ║║ +╚═╩╝ +""" +) + +DOUBLE_EDGE: Box = Box( + """\ +╔═╤╗ +║ │║ +╟─┼╢ +║ │║ +╟─┼╢ +╟─┼╢ +║ │║ +╚═╧╝ +""" +) + +# Map Boxes that don't render with raster fonts on to equivalent that do +LEGACY_WINDOWS_SUBSTITUTIONS = { + ROUNDED: SQUARE, + MINIMAL_HEAVY_HEAD: MINIMAL, + SIMPLE_HEAVY: SIMPLE, + HEAVY: SQUARE, + HEAVY_EDGE: SQUARE, + HEAVY_HEAD: SQUARE, +} + + +if __name__ == "__main__": # pragma: no cover + + from rich.columns import Columns + from rich.panel import Panel + + from . import box + from .console import Console + from .table import Table + from .text import Text + + console = Console(record=True) + + BOXES = [ + "ASCII", + "ASCII2", + "ASCII_DOUBLE_HEAD", + "SQUARE", + "SQUARE_DOUBLE_HEAD", + "MINIMAL", + "MINIMAL_HEAVY_HEAD", + "MINIMAL_DOUBLE_HEAD", + "SIMPLE", + "SIMPLE_HEAD", + "SIMPLE_HEAVY", + "HORIZONTALS", + "ROUNDED", + "HEAVY", + "HEAVY_EDGE", + "HEAVY_HEAD", + "DOUBLE", + "DOUBLE_EDGE", + ] + + console.print(Panel("[bold green]Box Constants", style="green"), justify="center") + console.print() + + columns = Columns(expand=True, padding=2) + for box_name in sorted(BOXES): + table = Table( + show_footer=True, style="dim", border_style="not dim", expand=True + ) + table.add_column("Header 1", "Footer 1") + table.add_column("Header 2", "Footer 2") + table.add_row("Cell", "Cell") + table.add_row("Cell", "Cell") + table.box = getattr(box, box_name) + table.title = Text(f"box.{box_name}", style="magenta") + columns.add_renderable(table) + console.print(columns) + + # console.save_html("box.html", inline_styles=True) diff --git a/testbed/Textualize__rich/rich/cells.py b/testbed/Textualize__rich/rich/cells.py new file mode 100644 index 0000000000000000000000000000000000000000..1a0ebccec411e4f2cb867661874b5097f57407b8 --- /dev/null +++ b/testbed/Textualize__rich/rich/cells.py @@ -0,0 +1,124 @@ +from functools import lru_cache +from typing import Dict, List + +from ._cell_widths import CELL_WIDTHS +from ._lru_cache import LRUCache + + +def cell_len(text: str, _cache: Dict[str, int] = LRUCache(1024 * 4)) -> int: + """Get the number of cells required to display text. + + Args: + text (str): Text to display. + + Returns: + int: Number of cells required to display the text. + """ + cached_result = _cache.get(text, None) + if cached_result is not None: + return cached_result + + _get_size = get_character_cell_size + total_size = sum(_get_size(character) for character in text) + if len(text) <= 64: + _cache[text] = total_size + return total_size + + +def get_character_cell_size(character: str) -> int: + """Get the cell size of a character. + + Args: + character (str): A single character. + + Returns: + int: Number of cells (0, 1 or 2) occupied by that character. + """ + + codepoint = ord(character) + if 127 > codepoint > 31: + # Shortcut for ascii + return 1 + return _get_codepoint_cell_size(codepoint) + + +@lru_cache(maxsize=4096) +def _get_codepoint_cell_size(codepoint: int) -> int: + """Get the cell size of a character. + + Args: + character (str): A single character. + + Returns: + int: Number of cells (0, 1 or 2) occupied by that character. + """ + + _table = CELL_WIDTHS + lower_bound = 0 + upper_bound = len(_table) - 1 + index = (lower_bound + upper_bound) // 2 + while True: + start, end, width = _table[index] + if codepoint < start: + upper_bound = index - 1 + elif codepoint > end: + lower_bound = index + 1 + else: + return 0 if width == -1 else width + if upper_bound < lower_bound: + break + index = (lower_bound + upper_bound) // 2 + return 1 + + +def set_cell_size(text: str, total: int) -> str: + """Set the length of a string to fit within given number of cells.""" + cell_size = cell_len(text) + if cell_size == total: + return text + if cell_size < total: + return text + " " * (total - cell_size) + + _get_character_cell_size = get_character_cell_size + character_sizes = [_get_character_cell_size(character) for character in text] + excess = cell_size - total + pop = character_sizes.pop + while excess > 0 and character_sizes: + excess -= pop() + text = text[: len(character_sizes)] + if excess == -1: + text += " " + return text + + +def chop_cells(text: str, max_size: int, position: int = 0) -> List[str]: + """Break text in to equal (cell) length strings.""" + _get_character_cell_size = get_character_cell_size + characters = [ + (character, _get_character_cell_size(character)) for character in text + ][::-1] + total_size = position + lines: List[List[str]] = [[]] + append = lines[-1].append + + pop = characters.pop + while characters: + character, size = pop() + if total_size + size > max_size: + lines.append([character]) + append = lines[-1].append + total_size = size + else: + total_size += size + append(character) + return ["".join(line) for line in lines] + + +if __name__ == "__main__": # pragma: no cover + + print(get_character_cell_size("😽")) + for line in chop_cells("""这是对亚洲语言支持的测试。面对模棱两可的想法,拒绝猜测的诱惑。""", 8): + print(line) + for n in range(80, 1, -1): + print(set_cell_size("""这是对亚洲语言支持的测试。面对模棱两可的想法,拒绝猜测的诱惑。""", n) + "|") + print("x" * n) diff --git a/testbed/Textualize__rich/rich/color.py b/testbed/Textualize__rich/rich/color.py new file mode 100644 index 0000000000000000000000000000000000000000..59dc9f88b7f7ec3550b9ff810ab8459e2c878962 --- /dev/null +++ b/testbed/Textualize__rich/rich/color.py @@ -0,0 +1,572 @@ +import platform +import re +from colorsys import rgb_to_hls +from enum import IntEnum +from functools import lru_cache +from typing import TYPE_CHECKING, NamedTuple, Optional, Tuple + +from ._palettes import EIGHT_BIT_PALETTE, STANDARD_PALETTE, WINDOWS_PALETTE +from .color_triplet import ColorTriplet +from .terminal_theme import DEFAULT_TERMINAL_THEME + +if TYPE_CHECKING: # pragma: no cover + from .terminal_theme import TerminalTheme + from .text import Text + + +WINDOWS = platform.system() == "Windows" + + +class ColorSystem(IntEnum): + """One of the 3 color system supported by terminals.""" + + STANDARD = 1 + EIGHT_BIT = 2 + TRUECOLOR = 3 + WINDOWS = 4 + + +class ColorType(IntEnum): + """Type of color stored in Color class.""" + + DEFAULT = 0 + STANDARD = 1 + EIGHT_BIT = 2 + TRUECOLOR = 3 + WINDOWS = 4 + + +ANSI_COLOR_NAMES = { + "black": 0, + "red": 1, + "green": 2, + "yellow": 3, + "blue": 4, + "magenta": 5, + "cyan": 6, + "white": 7, + "bright_black": 8, + "bright_red": 9, + "bright_green": 10, + "bright_yellow": 11, + "bright_blue": 12, + "bright_magenta": 13, + "bright_cyan": 14, + "bright_white": 15, + "grey0": 16, + "navy_blue": 17, + "dark_blue": 18, + "blue3": 20, + "blue1": 21, + "dark_green": 22, + "deep_sky_blue4": 25, + "dodger_blue3": 26, + "dodger_blue2": 27, + "green4": 28, + "spring_green4": 29, + "turquoise4": 30, + "deep_sky_blue3": 32, + "dodger_blue1": 33, + "green3": 40, + "spring_green3": 41, + "dark_cyan": 36, + "light_sea_green": 37, + "deep_sky_blue2": 38, + "deep_sky_blue1": 39, + "spring_green2": 47, + "cyan3": 43, + "dark_turquoise": 44, + "turquoise2": 45, + "green1": 46, + "spring_green1": 48, + "medium_spring_green": 49, + "cyan2": 50, + "cyan1": 51, + "dark_red": 88, + "deep_pink4": 125, + "purple4": 55, + "purple3": 56, + "blue_violet": 57, + "orange4": 94, + "grey37": 59, + "medium_purple4": 60, + "slate_blue3": 62, + "royal_blue1": 63, + "chartreuse4": 64, + "dark_sea_green4": 71, + "pale_turquoise4": 66, + "steel_blue": 67, + "steel_blue3": 68, + "cornflower_blue": 69, + "chartreuse3": 76, + "cadet_blue": 73, + "sky_blue3": 74, + "steel_blue1": 81, + "pale_green3": 114, + "sea_green3": 78, + "aquamarine3": 79, + "medium_turquoise": 80, + "chartreuse2": 112, + "sea_green2": 83, + "sea_green1": 85, + "aquamarine1": 122, + "dark_slate_gray2": 87, + "dark_magenta": 91, + "dark_violet": 128, + "purple": 129, + "light_pink4": 95, + "plum4": 96, + "medium_purple3": 98, + "slate_blue1": 99, + "yellow4": 106, + "wheat4": 101, + "grey53": 102, + "light_slate_grey": 103, + "medium_purple": 104, + "light_slate_blue": 105, + "dark_olive_green3": 149, + "dark_sea_green": 108, + "light_sky_blue3": 110, + "sky_blue2": 111, + "dark_sea_green3": 150, + "dark_slate_gray3": 116, + "sky_blue1": 117, + "chartreuse1": 118, + "light_green": 120, + "pale_green1": 156, + "dark_slate_gray1": 123, + "red3": 160, + "medium_violet_red": 126, + "magenta3": 164, + "dark_orange3": 166, + "indian_red": 167, + "hot_pink3": 168, + "medium_orchid3": 133, + "medium_orchid": 134, + "medium_purple2": 140, + "dark_goldenrod": 136, + "light_salmon3": 173, + "rosy_brown": 138, + "grey63": 139, + "medium_purple1": 141, + "gold3": 178, + "dark_khaki": 143, + "navajo_white3": 144, + "grey69": 145, + "light_steel_blue3": 146, + "light_steel_blue": 147, + "yellow3": 184, + "dark_sea_green2": 157, + "light_cyan3": 152, + "light_sky_blue1": 153, + "green_yellow": 154, + "dark_olive_green2": 155, + "dark_sea_green1": 193, + "pale_turquoise1": 159, + "deep_pink3": 162, + "magenta2": 200, + "hot_pink2": 169, + "orchid": 170, + "medium_orchid1": 207, + "orange3": 172, + "light_pink3": 174, + "pink3": 175, + "plum3": 176, + "violet": 177, + "light_goldenrod3": 179, + "tan": 180, + "misty_rose3": 181, + "thistle3": 182, + "plum2": 183, + "khaki3": 185, + "light_goldenrod2": 222, + "light_yellow3": 187, + "grey84": 188, + "light_steel_blue1": 189, + "yellow2": 190, + "dark_olive_green1": 192, + "honeydew2": 194, + "light_cyan1": 195, + "red1": 196, + "deep_pink2": 197, + "deep_pink1": 199, + "magenta1": 201, + "orange_red1": 202, + "indian_red1": 204, + "hot_pink": 206, + "dark_orange": 208, + "salmon1": 209, + "light_coral": 210, + "pale_violet_red1": 211, + "orchid2": 212, + "orchid1": 213, + "orange1": 214, + "sandy_brown": 215, + "light_salmon1": 216, + "light_pink1": 217, + "pink1": 218, + "plum1": 219, + "gold1": 220, + "navajo_white1": 223, + "misty_rose1": 224, + "thistle1": 225, + "yellow1": 226, + "light_goldenrod1": 227, + "khaki1": 228, + "wheat1": 229, + "cornsilk1": 230, + "grey100": 231, + "grey3": 232, + "grey7": 233, + "grey11": 234, + "grey15": 235, + "grey19": 236, + "grey23": 237, + "grey27": 238, + "grey30": 239, + "grey35": 240, + "grey39": 241, + "grey42": 242, + "grey46": 243, + "grey50": 244, + "grey54": 245, + "grey58": 246, + "grey62": 247, + "grey66": 248, + "grey70": 249, + "grey74": 250, + "grey78": 251, + "grey82": 252, + "grey85": 253, + "grey89": 254, + "grey93": 255, +} + + +class ColorParseError(Exception): + """The color could not be parsed.""" + + +RE_COLOR = re.compile( + r"""^ +\#([0-9a-f]{6})$| +color\(([0-9]{1,3})\)$| +rgb\(([\d\s,]+)\)$ +""", + re.VERBOSE, +) + + +class Color(NamedTuple): + """Terminal color definition.""" + + name: str + """The name of the color (typically the input to Color.parse).""" + type: ColorType + """The type of the color.""" + number: Optional[int] = None + """The color number, if a standard color, or None.""" + triplet: Optional[ColorTriplet] = None + """A triplet of color components, if an RGB color.""" + + def __repr__(self) -> str: + return f"" + + def __rich__(self) -> "Text": + """Dispays the actual color if Rich printed.""" + from .text import Text + from .style import Style + + return Text.assemble( + f"", + ) + + @property + def system(self) -> ColorSystem: + """Get the native color system for this color.""" + if self.type == ColorType.DEFAULT: + return ColorSystem.STANDARD + return ColorSystem(int(self.type)) + + @property + def is_system_defined(self) -> bool: + """Check if the color is ultimately defined by the system.""" + return self.system not in (ColorSystem.EIGHT_BIT, ColorSystem.TRUECOLOR) + + @property + def is_default(self) -> bool: + """Check if the color is a default color.""" + return self.type == ColorType.DEFAULT + + def get_truecolor( + self, theme: "TerminalTheme" = None, foreground=True + ) -> ColorTriplet: + """Get an equivalent color triplet for this color. + + Args: + theme (TerminalTheme, optional): Optional terminal theme, or None to use default. Defaults to None. + foreground (bool, optional): True for a foreground color, or False for background. Defaults to True. + + Returns: + ColorTriplet: A color triplet containing RGB components. + """ + + if theme is None: + theme = DEFAULT_TERMINAL_THEME + if self.type == ColorType.TRUECOLOR: + assert self.triplet is not None + return self.triplet + elif self.type == ColorType.EIGHT_BIT: + assert self.number is not None + return EIGHT_BIT_PALETTE[self.number] + elif self.type == ColorType.STANDARD: + assert self.number is not None + return theme.ansi_colors[self.number] + elif self.type == ColorType.WINDOWS: + assert self.number is not None + return STANDARD_PALETTE[self.number] + else: # self.type == ColorType.DEFAULT: + assert self.number is None + return theme.foreground_color if foreground else theme.background_color + + @classmethod + def from_ansi(cls, number: int) -> "Color": + """Create a Color number from it's 8-bit ansi number. + + Args: + number (int): A number between 0-255 inclusive. + + Returns: + Color: A new Color instance. + """ + return cls( + name=f"color({number})", + type=(ColorType.STANDARD if number < 16 else ColorType.EIGHT_BIT), + number=number, + ) + + @classmethod + def from_triplet(cls, triplet: "ColorTriplet") -> "Color": + """Create a truecolor RGB color from a triplet of values. + + Args: + triplet (ColorTriplet): A color triplet containing red, green and blue components. + + Returns: + Color: A new color object. + """ + return cls(name=triplet.hex, type=ColorType.TRUECOLOR, triplet=triplet) + + @classmethod + def from_rgb(cls, red: float, green: float, blue: float) -> "Color": + """Create a truecolor from three color components in the range(0->255). + + Args: + red (float): Red component in range 0-255. + green (float): Green component in range 0-255. + blue (float): Blue component in range 0-255. + + Returns: + Color: A new color object. + """ + return cls.from_triplet(ColorTriplet(int(red), int(green), int(blue))) + + @classmethod + def default(cls) -> "Color": + """Get a Color instance representing the default color. + + Returns: + Color: Default color. + """ + return cls(name="default", type=ColorType.DEFAULT) + + @classmethod + @lru_cache(maxsize=1024) + def parse(cls, color: str) -> "Color": + """Parse a color definition.""" + original_color = color + color = color.lower().strip() + + if color == "default": + return cls(color, type=ColorType.DEFAULT) + + color_number = ANSI_COLOR_NAMES.get(color) + if color_number is not None: + return cls( + color, + type=(ColorType.STANDARD if color_number < 16 else ColorType.EIGHT_BIT), + number=color_number, + ) + + color_match = RE_COLOR.match(color) + if color_match is None: + raise ColorParseError(f"{original_color!r} is not a valid color") + + color_24, color_8, color_rgb = color_match.groups() + if color_24: + triplet = ColorTriplet( + int(color_24[0:2], 16), int(color_24[2:4], 16), int(color_24[4:6], 16) + ) + return cls(color, ColorType.TRUECOLOR, triplet=triplet) + + elif color_8: + number = int(color_8) + if number > 255: + raise ColorParseError(f"color number must be <= 255 in {color!r}") + return cls( + color, + type=(ColorType.STANDARD if number < 16 else ColorType.EIGHT_BIT), + number=number, + ) + + else: # color_rgb: + components = color_rgb.split(",") + if len(components) != 3: + raise ColorParseError( + f"expected three components in {original_color!r}" + ) + red, green, blue = components + triplet = ColorTriplet(int(red), int(green), int(blue)) + if not all(component <= 255 for component in triplet): + raise ColorParseError( + f"color components must be <= 255 in {original_color!r}" + ) + return cls(color, ColorType.TRUECOLOR, triplet=triplet) + + @lru_cache(maxsize=1024) + def get_ansi_codes(self, foreground: bool = True) -> Tuple[str, ...]: + """Get the ANSI escape codes for this color.""" + _type = self.type + if _type == ColorType.DEFAULT: + return ("39" if foreground else "49",) + + elif _type == ColorType.WINDOWS: + number = self.number + assert number is not None + return (str(30 + number if foreground else 40 + number),) + + elif _type == ColorType.STANDARD: + number = self.number + assert number is not None + fore, back = (30, 40) if number < 8 else (82, 92) + return (str(fore + number if foreground else back + number),) + + elif _type == ColorType.EIGHT_BIT: + assert self.number is not None + return ("38" if foreground else "48", "5", str(self.number)) + + else: # self.standard == ColorStandard.TRUECOLOR: + assert self.triplet is not None + red, green, blue = self.triplet + return ("38" if foreground else "48", "2", str(red), str(green), str(blue)) + + @lru_cache(maxsize=1024) + def downgrade(self, system: ColorSystem) -> "Color": + """Downgrade a color system to a system with fewer colors.""" + + if self.type == ColorType.DEFAULT or self.type == system: + return self + # Convert to 8-bit color from truecolor color + if system == ColorSystem.EIGHT_BIT and self.system == ColorSystem.TRUECOLOR: + assert self.triplet is not None + red, green, blue = self.triplet.normalized + _h, l, s = rgb_to_hls(red, green, blue) + # If saturation is under 10% assume it is grayscale + if s < 0.1: + gray = round(l * 25.0) + if gray == 0: + color_number = 16 + elif gray == 25: + color_number = 231 + else: + color_number = 231 + gray + return Color(self.name, ColorType.EIGHT_BIT, number=color_number) + + color_number = ( + 16 + 36 * round(red * 5.0) + 6 * round(green * 5.0) + round(blue * 5.0) + ) + return Color(self.name, ColorType.EIGHT_BIT, number=color_number) + + # Convert to standard from truecolor or 8-bit + elif system == ColorSystem.STANDARD: + if self.system == ColorSystem.TRUECOLOR: + assert self.triplet is not None + triplet = self.triplet + else: # self.system == ColorSystem.EIGHT_BIT + assert self.number is not None + triplet = ColorTriplet(*EIGHT_BIT_PALETTE[self.number]) + + color_number = STANDARD_PALETTE.match(triplet) + return Color(self.name, ColorType.STANDARD, number=color_number) + + elif system == ColorSystem.WINDOWS: + if self.system == ColorSystem.TRUECOLOR: + assert self.triplet is not None + triplet = self.triplet + else: # self.system == ColorSystem.EIGHT_BIT + assert self.number is not None + if self.number < 8: + return Color(self.name, ColorType.WINDOWS, number=self.number) + elif self.number < 16: + return Color(self.name, ColorType.WINDOWS, number=self.number - 8) + triplet = ColorTriplet(*EIGHT_BIT_PALETTE[self.number]) + + color_number = WINDOWS_PALETTE.match(triplet) + return Color(self.name, ColorType.WINDOWS, number=color_number) + + return self + + +def parse_rgb_hex(hex_color: str) -> ColorTriplet: + """Parse six hex characters in to RGB triplet.""" + assert len(hex_color) == 6, "must be 6 characters" + color = ColorTriplet( + int(hex_color[0:2], 16), int(hex_color[2:4], 16), int(hex_color[4:6], 16) + ) + return color + + +def blend_rgb( + color1: ColorTriplet, color2: ColorTriplet, cross_fade: float = 0.5 +) -> ColorTriplet: + """Blend one RGB color in to another.""" + r1, g1, b1 = color1 + r2, g2, b2 = color2 + new_color = ColorTriplet( + int(r1 + (r2 - r1) * cross_fade), + int(g1 + (g2 - g1) * cross_fade), + int(b1 + (b2 - b1) * cross_fade), + ) + return new_color + + +if __name__ == "__main__": # pragma: no cover + + from .console import Console + from .table import Table + from .text import Text + from . import box + + console = Console() + + table = Table(show_footer=False, show_edge=True) + table.add_column("Color", width=10, overflow="ellipsis") + table.add_column("Number", justify="right", style="yellow") + table.add_column("Name", style="green") + table.add_column("Hex", style="blue") + table.add_column("RGB", style="magenta") + + colors = sorted((v, k) for k, v in ANSI_COLOR_NAMES.items()) + for color_number, name in colors: + color_cell = Text(" " * 10, style=f"on {name}") + if color_number < 16: + table.add_row(color_cell, f"{color_number}", Text(f'"{name}"')) + else: + color = EIGHT_BIT_PALETTE[color_number] # type: ignore + table.add_row( + color_cell, str(color_number), Text(f'"{name}"'), color.hex, color.rgb + ) + + console.print(table) diff --git a/testbed/Textualize__rich/rich/color_triplet.py b/testbed/Textualize__rich/rich/color_triplet.py new file mode 100644 index 0000000000000000000000000000000000000000..75c03d2aca35cecd201d96ab06b49e545a68892c --- /dev/null +++ b/testbed/Textualize__rich/rich/color_triplet.py @@ -0,0 +1,38 @@ +from typing import NamedTuple, Tuple + + +class ColorTriplet(NamedTuple): + """The red, green, and blue components of a color.""" + + red: int + """Red component in 0 to 255 range.""" + green: int + """Green component in 0 to 255 range.""" + blue: int + """Blue component in 0 to 255 range.""" + + @property + def hex(self) -> str: + """get the color triplet in CSS style.""" + red, green, blue = self + return f"#{red:02x}{green:02x}{blue:02x}" + + @property + def rgb(self) -> str: + """The color in RGB format. + + Returns: + str: An rgb color, e.g. ``"rgb(100,23,255)"``. + """ + red, green, blue = self + return f"rgb({red},{green},{blue})" + + @property + def normalized(self) -> Tuple[float, float, float]: + """Covert components in to floats between 0 and 1. + + Returns: + Tuple[float, float, float]: A tuple of three normalized colour components. + """ + red, green, blue = self + return red / 255.0, green / 255.0, blue / 255.0 diff --git a/testbed/Textualize__rich/rich/columns.py b/testbed/Textualize__rich/rich/columns.py new file mode 100644 index 0000000000000000000000000000000000000000..d152dcd2258781d9438a87fd27de9de92d81b85a --- /dev/null +++ b/testbed/Textualize__rich/rich/columns.py @@ -0,0 +1,189 @@ +from collections import defaultdict +from itertools import chain +from operator import itemgetter +from typing import Dict, Iterable, List, Optional, Tuple + +from .align import Align, AlignMethod +from .console import Console, ConsoleOptions, RenderableType, RenderResult +from .constrain import Constrain +from .measure import Measurement +from .padding import Padding, PaddingDimensions +from .table import Table +from .text import TextType +from .jupyter import JupyterMixin + + +class Columns(JupyterMixin): + """Display renderables in neat columns. + + Args: + renderables (Iterable[RenderableType]): Any number of Rich renderables (including str). + width (int, optional): The desired width of the columns, or None to auto detect. Defaults to None. + padding (PaddingDimensions, optional): Optional padding around cells. Defaults to (0, 1). + expand (bool, optional): Expand columns to full width. Defaults to False. + equal (bool, optional): Arrange in to equal sized columns. Defaults to False. + column_first (bool, optional): Align items from top to bottom (rather than left to right). Defaults to False. + right_to_left (bool, optional): Start column from right hand side. Defaults to False. + align (str, optional): Align value ("left", "right", or "center") or None for default. Defaults to None. + title (TextType, optional): Optional title for Columns. + """ + + def __init__( + self, + renderables: Iterable[RenderableType] = None, + padding: PaddingDimensions = (0, 1), + *, + width: int = None, + expand: bool = False, + equal: bool = False, + column_first: bool = False, + right_to_left: bool = False, + align: AlignMethod = None, + title: TextType = None, + ) -> None: + self.renderables = list(renderables or []) + self.width = width + self.padding = padding + self.expand = expand + self.equal = equal + self.column_first = column_first + self.right_to_left = right_to_left + self.align = align + self.title = title + + def add_renderable(self, renderable: RenderableType) -> None: + """Add a renderable to the columns. + + Args: + renderable (RenderableType): Any renderable object. + """ + self.renderables.append(renderable) + + def __rich_console__( + self, console: Console, options: ConsoleOptions + ) -> RenderResult: + render_str = console.render_str + renderables = [ + render_str(renderable) if isinstance(renderable, str) else renderable + for renderable in self.renderables + ] + if not renderables: + return + _top, right, _bottom, left = Padding.unpack(self.padding) + width_padding = max(left, right) + max_width = options.max_width + widths: Dict[int, int] = defaultdict(int) + column_count = len(renderables) + + get_measurement = Measurement.get + renderable_widths = [ + get_measurement(console, renderable, max_width).maximum + for renderable in renderables + ] + if self.equal: + renderable_widths = [max(renderable_widths)] * len(renderable_widths) + + def iter_renderables( + column_count: int, + ) -> Iterable[Tuple[int, Optional[RenderableType]]]: + item_count = len(renderables) + if self.column_first: + width_renderables = list(zip(renderable_widths, renderables)) + + column_lengths: List[int] = [item_count // column_count] * column_count + for col_no in range(item_count % column_count): + column_lengths[col_no] += 1 + + row_count = (item_count + column_count - 1) // column_count + cells = [[-1] * column_count for _ in range(row_count)] + row = col = 0 + for index in range(item_count): + cells[row][col] = index + column_lengths[col] -= 1 + if column_lengths[col]: + row += 1 + else: + col += 1 + row = 0 + for index in chain.from_iterable(cells): + if index == -1: + break + yield width_renderables[index] + else: + yield from zip(renderable_widths, renderables) + # Pad odd elements with spaces + if item_count % column_count: + for _ in range(column_count - (item_count % column_count)): + yield 0, None + + table = Table.grid(padding=self.padding, collapse_padding=True, pad_edge=False) + table.expand = self.expand + table.title = self.title + + if self.width is not None: + column_count = (max_width) // (self.width + width_padding) + for _ in range(column_count): + table.add_column(width=self.width) + else: + while column_count > 1: + widths.clear() + column_no = 0 + for renderable_width, _ in iter_renderables(column_count): + widths[column_no] = max(widths[column_no], renderable_width) + total_width = sum(widths.values()) + width_padding * ( + len(widths) - 1 + ) + if total_width > max_width: + column_count = len(widths) - 1 + break + else: + column_no = (column_no + 1) % column_count + else: + break + + get_renderable = itemgetter(1) + _renderables = [ + get_renderable(_renderable) + for _renderable in iter_renderables(column_count) + ] + if self.equal: + _renderables = [ + None + if renderable is None + else Constrain(renderable, renderable_widths[0]) + for renderable in _renderables + ] + if self.align: + align = self.align + _Align = Align + _renderables = [ + None if renderable is None else _Align(renderable, align) + for renderable in _renderables + ] + + right_to_left = self.right_to_left + add_row = table.add_row + for start in range(0, len(_renderables), column_count): + row = _renderables[start : start + column_count] + if right_to_left: + row = row[::-1] + add_row(*row) + yield table + + +if __name__ == "__main__": # pragma: no cover + import os + + console = Console() + + from rich.panel import Panel + + files = [f"{i} {s}" for i, s in enumerate(sorted(os.listdir()))] + columns = Columns(files, padding=(0, 1), expand=False, equal=False) + console.print(columns) + console.rule() + columns.column_first = True + console.print(columns) + columns.right_to_left = True + console.rule() + console.print(columns) diff --git a/testbed/Textualize__rich/rich/constrain.py b/testbed/Textualize__rich/rich/constrain.py new file mode 100644 index 0000000000000000000000000000000000000000..c96233ae1c7d3241ae89a6746ec34790aae586d0 --- /dev/null +++ b/testbed/Textualize__rich/rich/constrain.py @@ -0,0 +1,35 @@ +from typing import Optional, TYPE_CHECKING + +from .jupyter import JupyterMixin +from .measure import Measurement + +if TYPE_CHECKING: + from .console import Console, ConsoleOptions, RenderableType, RenderResult + + +class Constrain(JupyterMixin): + """Constrain the width of a renderable to a given number of characters. + + Args: + renderable (RenderableType): A renderable object. + width (int, optional): The maximum width (in characters) to render. Defaults to 80. + """ + + def __init__(self, renderable: "RenderableType", width: Optional[int] = 80) -> None: + self.renderable = renderable + self.width = width + + def __rich_console__( + self, console: "Console", options: "ConsoleOptions" + ) -> "RenderResult": + if self.width is None: + yield self.renderable + else: + child_options = options.update(width=min(self.width, options.max_width)) + yield from console.render(self.renderable, child_options) + + def __rich_measure__(self, console: "Console", max_width: int) -> "Measurement": + if self.width is not None: + max_width = min(self.width, max_width) + measurement = Measurement.get(console, self.renderable, max_width) + return measurement diff --git a/testbed/Textualize__rich/rich/containers.py b/testbed/Textualize__rich/rich/containers.py new file mode 100644 index 0000000000000000000000000000000000000000..d6c82491f79afba4ea91a2308f0fdd32ba683c66 --- /dev/null +++ b/testbed/Textualize__rich/rich/containers.py @@ -0,0 +1,158 @@ +from itertools import zip_longest +from typing import ( + Iterator, + Iterable, + List, + overload, + TypeVar, + TYPE_CHECKING, +) + +if TYPE_CHECKING: + from .console import ( + Console, + ConsoleOptions, + JustifyMethod, + OverflowMethod, + RenderResult, + RenderableType, + ) + from .text import Text + +from .cells import cell_len +from .measure import Measurement + +T = TypeVar("T") + + +class Renderables: + """A list subclass which renders its contents to the console.""" + + def __init__(self, renderables: Iterable["RenderableType"] = None) -> None: + self._renderables: List["RenderableType"] = ( + list(renderables) if renderables is not None else [] + ) + + def __rich_console__( + self, console: "Console", options: "ConsoleOptions" + ) -> "RenderResult": + """Console render method to insert line-breaks.""" + yield from self._renderables + + def __rich_measure__(self, console: "Console", max_width: int) -> "Measurement": + dimensions = [ + Measurement.get(console, renderable, max_width) + for renderable in self._renderables + ] + if not dimensions: + return Measurement(1, 1) + _min = max(dimension.minimum for dimension in dimensions) + _max = max(dimension.maximum for dimension in dimensions) + return Measurement(_min, _max) + + def append(self, renderable: "RenderableType") -> None: + self._renderables.append(renderable) + + def __iter__(self) -> Iterable["RenderableType"]: + return iter(self._renderables) + + +class Lines: + """A list subclass which can render to the console.""" + + def __init__(self, lines: Iterable["Text"] = ()) -> None: + self._lines: List["Text"] = list(lines) + + def __repr__(self) -> str: + return f"Lines({self._lines!r})" + + def __iter__(self) -> Iterator["Text"]: + return iter(self._lines) + + @overload + def __getitem__(self, index: int) -> "Text": + ... + + @overload + def __getitem__(self, index: slice) -> "Lines": + ... + + def __getitem__(self, index): + return self._lines[index] + + def __setitem__(self, index: int, value: "Text") -> "Lines": + self._lines[index] = value + return self + + def __len__(self) -> int: + return self._lines.__len__() + + def __rich_console__( + self, console: "Console", options: "ConsoleOptions" + ) -> "RenderResult": + """Console render method to insert line-breaks.""" + yield from self._lines + + def append(self, line: "Text") -> None: + self._lines.append(line) + + def extend(self, lines: Iterable["Text"]) -> None: + self._lines.extend(lines) + + def justify( + self, + console: "Console", + width: int, + justify: "JustifyMethod" = "left", + overflow: "OverflowMethod" = "fold", + ) -> None: + """Justify and overflow text to a given width. + + Args: + console (Console): Console instance. + width (int): Number of characters per line. + justify (str, optional): Default justify method for text: "left", "center", "full" or "right". Defaults to "left". + overflow (str, optional): Default overflow for text: "crop", "fold", or "ellipsis". Defaults to "fold". + + """ + from .text import Text + + if justify == "left": + for line in self._lines: + line.truncate(width, overflow=overflow, pad=True) + elif justify == "center": + for line in self._lines: + line.rstrip() + line.truncate(width, overflow=overflow) + line.pad_left((width - cell_len(line.plain)) // 2) + line.pad_right(width - cell_len(line.plain)) + elif justify == "right": + for line in self._lines: + line.rstrip() + line.truncate(width, overflow=overflow) + line.pad_left(width - cell_len(line.plain)) + elif justify == "full": + for line_index, line in enumerate(self._lines): + if line_index == len(self._lines) - 1: + break + words = line.split(" ") + words_size = sum(cell_len(word.plain) for word in words) + num_spaces = len(words) - 1 + spaces = [1 for _ in range(num_spaces)] + index = 0 + if spaces: + while words_size + num_spaces < width: + spaces[len(spaces) - index - 1] += 1 + num_spaces += 1 + index = (index + 1) % len(spaces) + tokens: List[Text] = [] + for index, (word, next_word) in enumerate( + zip_longest(words, words[1:]) + ): + tokens.append(word) + if index < len(spaces): + style = word.get_style_at_offset(console, -1) + next_style = next_word.get_style_at_offset(console, 0) + space_style = style if style == next_style else line.style + tokens.append(Text(" " * spaces[index], style=space_style)) + self[line_index] = Text("").join(tokens) diff --git a/testbed/Textualize__rich/rich/control.py b/testbed/Textualize__rich/rich/control.py new file mode 100644 index 0000000000000000000000000000000000000000..8b189de3b8a0caa411e21f349de9902b517515fb --- /dev/null +++ b/testbed/Textualize__rich/rich/control.py @@ -0,0 +1,52 @@ +from typing import TYPE_CHECKING + +from .segment import Segment + +if TYPE_CHECKING: + from .console import Console, ConsoleOptions, RenderResult + +STRIP_CONTROL_CODES = [ + 8, # Backspace + 11, # Vertical tab + 12, # Form feed + 13, # Carriage return +] +_CONTROL_TRANSLATE = {_codepoint: None for _codepoint in STRIP_CONTROL_CODES} + + +class Control: + """A renderable that inserts a control code (non printable but may move cursor). + + Args: + control_codes (str): A string containing control codes. + """ + + __slots__ = ["_control_codes"] + + def __init__(self, control_codes: str) -> None: + self._control_codes = Segment.control(control_codes) + + def __str__(self) -> str: + return self._control_codes.text + + def __rich_console__( + self, console: "Console", options: "ConsoleOptions" + ) -> "RenderResult": + yield self._control_codes + + +def strip_control_codes(text: str, _translate_table=_CONTROL_TRANSLATE) -> str: + """Remove control codes from text. + + Args: + text (str): A string possibly contain control codes. + + Returns: + str: String with control codes removed. + """ + return text.translate(_translate_table) + + +if __name__ == "__main__": # pragma: no cover + + print(strip_control_codes("hello\rWorld")) diff --git a/testbed/Textualize__rich/rich/default_styles.py b/testbed/Textualize__rich/rich/default_styles.py new file mode 100644 index 0000000000000000000000000000000000000000..ac0f5baddaaef1c8249e88080687cf8fe6ee61e2 --- /dev/null +++ b/testbed/Textualize__rich/rich/default_styles.py @@ -0,0 +1,154 @@ +from typing import Dict + +from .style import Style + +DEFAULT_STYLES: Dict[str, Style] = { + "none": Style.null(), + "reset": Style( + color="default", + bgcolor="default", + dim=False, + bold=False, + italic=False, + underline=False, + blink=False, + blink2=False, + reverse=False, + conceal=False, + strike=False, + ), + "dim": Style(dim=True), + "bright": Style(dim=False), + "bold": Style(bold=True), + "strong": Style(bold=True), + "code": Style(reverse=True, bold=True), + "italic": Style(italic=True), + "emphasize": Style(italic=True), + "underline": Style(underline=True), + "blink": Style(blink=True), + "blink2": Style(blink2=True), + "reverse": Style(reverse=True), + "strike": Style(strike=True), + "black": Style(color="black"), + "red": Style(color="red"), + "green": Style(color="green"), + "yellow": Style(color="yellow"), + "magenta": Style(color="magenta"), + "cyan": Style(color="cyan"), + "white": Style(color="white"), + "inspect.attr": Style(color="yellow", italic=True), + "inspect.attr.dunder": Style(color="yellow", italic=True, dim=True), + "inspect.callable": Style(bold=True, color="red"), + "inspect.def": Style(italic=True, color="bright_cyan"), + "inspect.error": Style(bold=True, color="red"), + "inspect.equals": Style(), + "inspect.help": Style(color="cyan"), + "inspect.doc": Style(dim=True), + "inspect.value.border": Style(color="green"), + "live.ellipsis": Style(bold=True, color="red"), + "logging.keyword": Style(bold=True, color="yellow"), + "logging.level.notset": Style(dim=True), + "logging.level.debug": Style(color="green"), + "logging.level.info": Style(color="blue"), + "logging.level.warning": Style(color="red"), + "logging.level.error": Style(color="red", bold=True), + "logging.level.critical": Style(color="red", bold=True, reverse=True), + "log.level": Style.null(), + "log.time": Style(color="cyan", dim=True), + "log.message": Style.null(), + "log.path": Style(dim=True), + "repr.ellipsis": Style(color="yellow"), + "repr.indent": Style(color="green", dim=True), + "repr.error": Style(color="red", bold=True), + "repr.str": Style(color="green", italic=False, bold=False), + "repr.brace": Style(bold=True), + "repr.comma": Style(bold=True), + "repr.ipv4": Style(bold=True, color="bright_green"), + "repr.ipv6": Style(bold=True, color="bright_green"), + "repr.eui48": Style(bold=True, color="bright_green"), + "repr.eui64": Style(bold=True, color="bright_green"), + "repr.tag_start": Style(bold=True), + "repr.tag_name": Style(color="bright_magenta", bold=True), + "repr.tag_contents": Style(color="default"), + "repr.tag_end": Style(bold=True), + "repr.attrib_name": Style(color="yellow", italic=False), + "repr.attrib_equal": Style(bold=True), + "repr.attrib_value": Style(color="magenta", italic=False), + "repr.number": Style(color="blue", bold=True, italic=False), + "repr.bool_true": Style(color="bright_green", italic=True), + "repr.bool_false": Style(color="bright_red", italic=True), + "repr.none": Style(color="magenta", italic=True), + "repr.url": Style(underline=True, color="bright_blue", italic=False, bold=False), + "repr.uuid": Style(color="bright_yellow", bold=False), + "rule.line": Style(color="bright_green"), + "rule.text": Style.null(), + "prompt": Style.null(), + "prompt.choices": Style(color="magenta", bold=True), + "prompt.default": Style(color="cyan", bold=True), + "prompt.invalid": Style(color="red"), + "prompt.invalid.choice": Style(color="red"), + "pretty": Style.null(), + "scope.border": Style(color="blue"), + "scope.key": Style(color="yellow", italic=True), + "scope.key.special": Style(color="yellow", italic=True, dim=True), + "scope.equals": Style(color="red"), + "repr.path": Style(color="magenta"), + "repr.filename": Style(color="bright_magenta"), + "table.header": Style(bold=True), + "table.footer": Style(bold=True), + "table.cell": Style.null(), + "table.title": Style(italic=True), + "table.caption": Style(italic=True, dim=True), + "traceback.error": Style(dim=True, color="red", bold=True), + "traceback.border.syntax_error": Style(color="bright_red"), + "traceback.border": Style(color="red"), + "traceback.text": Style.null(), + "traceback.title": Style(color="red", bold=True), + "traceback.exc_type": Style(color="bright_red", bold=True), + "traceback.exc_value": Style.null(), + "traceback.offset": Style(color="bright_red", bold=True), + "bar.back": Style(color="grey23"), + "bar.complete": Style(color="rgb(249,38,114)"), + "bar.finished": Style(color="rgb(114,156,31)"), + "bar.pulse": Style(color="rgb(249,38,114)"), + "progress.description": Style.null(), + "progress.filesize": Style(color="green"), + "progress.filesize.total": Style(color="green"), + "progress.download": Style(color="green"), + "progress.elapsed": Style(color="yellow"), + "progress.percentage": Style(color="magenta"), + "progress.remaining": Style(color="cyan"), + "progress.data.speed": Style(color="red"), + "progress.spinner": Style(color="green"), + "status.spinner": Style(color="green"), + "tree": Style(), + "tree.line": Style(), +} + +MARKDOWN_STYLES = { + "markdown.paragraph": Style(), + "markdown.text": Style(), + "markdown.emph": Style(italic=True), + "markdown.strong": Style(bold=True), + "markdown.code": Style(bgcolor="black", color="bright_white"), + "markdown.code_block": Style(dim=True, color="cyan", bgcolor="black"), + "markdown.block_quote": Style(color="magenta"), + "markdown.list": Style(color="cyan"), + "markdown.item": Style(), + "markdown.item.bullet": Style(color="yellow", bold=True), + "markdown.item.number": Style(color="yellow", bold=True), + "markdown.hr": Style(color="yellow"), + "markdown.h1.border": Style(), + "markdown.h1": Style(bold=True), + "markdown.h2": Style(bold=True, underline=True), + "markdown.h3": Style(bold=True), + "markdown.h4": Style(bold=True, dim=True), + "markdown.h5": Style(underline=True), + "markdown.h6": Style(italic=True), + "markdown.h7": Style(italic=True, dim=True), + "markdown.link": Style(color="bright_blue"), + "markdown.link_url": Style(color="blue"), +} + + +DEFAULT_STYLES.update(MARKDOWN_STYLES) diff --git a/testbed/Textualize__rich/rich/emoji.py b/testbed/Textualize__rich/rich/emoji.py new file mode 100644 index 0000000000000000000000000000000000000000..4c1e200c49237f8b924f0b9bd3266df2cf87896c --- /dev/null +++ b/testbed/Textualize__rich/rich/emoji.py @@ -0,0 +1,74 @@ +from typing import Union + +from .console import Console, ConsoleOptions, RenderResult +from .jupyter import JupyterMixin +from .segment import Segment +from .style import Style +from ._emoji_codes import EMOJI +from ._emoji_replace import _emoji_replace + + +class NoEmoji(Exception): + """No emoji by that name.""" + + +class Emoji(JupyterMixin): + __slots__ = ["name", "style", "_char"] + + def __init__(self, name: str, style: Union[str, Style] = "none") -> None: + """A single emoji character. + + Args: + name (str): Name of emoji. + style (Union[str, Style], optional): Optional style. Defaults to None. + + Raises: + NoEmoji: If the emoji doesn't exist. + """ + self.name = name + self.style = style + try: + self._char = EMOJI[name] + except KeyError: + raise NoEmoji(f"No emoji called {name!r}") + + @classmethod + def replace(cls, text: str) -> str: + """Replace emoji markup with corresponding unicode characters. + + Args: + text (str): A string with emojis codes, e.g. "Hello :smiley:!" + + Returns: + str: A string with emoji codes replaces with actual emoji. + """ + return _emoji_replace(text) + + def __repr__(self) -> str: + return f"" + + def __str__(self) -> str: + return self._char + + def __rich_console__( + self, console: Console, options: ConsoleOptions + ) -> RenderResult: + yield Segment(self._char, console.get_style(self.style)) + + +if __name__ == "__main__": # pragma: no cover + import sys + + from rich.columns import Columns + from rich.console import Console + + console = Console(record=True) + + columns = Columns( + (f":{name}: {name}" for name in sorted(EMOJI.keys()) if "\u200D" not in name), + column_first=True, + ) + + console.print(columns) + if len(sys.argv) > 1: + console.save_html(sys.argv[1]) diff --git a/testbed/Textualize__rich/rich/errors.py b/testbed/Textualize__rich/rich/errors.py new file mode 100644 index 0000000000000000000000000000000000000000..f37deec496403f496cd3c08f6ac0bbd7de0d7cdf --- /dev/null +++ b/testbed/Textualize__rich/rich/errors.py @@ -0,0 +1,26 @@ +class ConsoleError(Exception): + """An error in console operation.""" + + +class StyleError(Exception): + """An error in styles.""" + + +class StyleSyntaxError(ConsoleError): + """Style was badly formatted.""" + + +class MissingStyle(StyleError): + """No such style.""" + + +class StyleStackError(ConsoleError): + """Style stack is invalid.""" + + +class NotRenderableError(ConsoleError): + """Object is not renderable.""" + + +class MarkupError(ConsoleError): + """Markup was badly formatted.""" diff --git a/testbed/Textualize__rich/rich/file_proxy.py b/testbed/Textualize__rich/rich/file_proxy.py new file mode 100644 index 0000000000000000000000000000000000000000..99a6922cb4cda208ba56a4b71dc3babd71d7a3c6 --- /dev/null +++ b/testbed/Textualize__rich/rich/file_proxy.py @@ -0,0 +1,54 @@ +import io +from typing import List, Any, IO, TYPE_CHECKING + +from .ansi import AnsiDecoder +from .text import Text + +if TYPE_CHECKING: + from .console import Console + + +class FileProxy(io.TextIOBase): + """Wraps a file (e.g. sys.stdout) and redirects writes to a console.""" + + def __init__(self, console: "Console", file: IO[str]) -> None: + self.__console = console + self.__file = file + self.__buffer: List[str] = [] + self.__ansi_decoder = AnsiDecoder() + + @property + def rich_proxied_file(self) -> IO[str]: + """Get proxied file.""" + return self.__file + + def __getattr__(self, name: str) -> Any: + return getattr(self.__file, name) + + def write(self, text: str) -> int: + if not isinstance(text, str): + raise TypeError(f"write() argument must be str, not {type(text).__name__}") + buffer = self.__buffer + lines: List[str] = [] + while text: + line, new_line, text = text.partition("\n") + if new_line: + lines.append("".join(buffer) + line) + del buffer[:] + else: + buffer.append(line) + break + if lines: + console = self.__console + with console: + output = Text("\n").join( + self.__ansi_decoder.decode_line(line) for line in lines + ) + console.print(output, markup=False, emoji=False, highlight=False) + return len(text) + + def flush(self) -> None: + buffer = self.__buffer + if buffer: + self.__console.print("".join(buffer)) + del buffer[:] diff --git a/testbed/Textualize__rich/rich/filesize.py b/testbed/Textualize__rich/rich/filesize.py new file mode 100644 index 0000000000000000000000000000000000000000..48768233035340b5300e067d7348e0d950744818 --- /dev/null +++ b/testbed/Textualize__rich/rich/filesize.py @@ -0,0 +1,62 @@ +# coding: utf-8 +"""Functions for reporting filesizes. Borrowed from https://github.com/PyFilesystem/pyfilesystem2 + +The functions declared in this module should cover the different +usecases needed to generate a string representation of a file size +using several different units. Since there are many standards regarding +file size units, three different functions have been implemented. + +See Also: + * `Wikipedia: Binary prefix `_ + +""" + +__all__ = ["decimal"] + +from typing import Iterable, List, Tuple + + +def _to_str(size: int, suffixes: Iterable[str], base: int) -> str: + if size == 1: + return "1 byte" + elif size < base: + return "{:,} bytes".format(size) + + for i, suffix in enumerate(suffixes, 2): # noqa: B007 + unit = base ** i + if size < unit: + break + return "{:,.1f} {}".format((base * size / unit), suffix) + + +def pick_unit_and_suffix(size: int, suffixes: List[str], base: int) -> Tuple[int, str]: + """Pick a suffix and base for the given size.""" + for i, suffix in enumerate(suffixes): + unit = base ** i + if size < unit * base: + break + return unit, suffix + + +def decimal(size: int) -> str: + """Convert a filesize in to a string (powers of 1000, SI prefixes). + + In this convention, ``1000 B = 1 kB``. + + This is typically the format used to advertise the storage + capacity of USB flash drives and the like (*256 MB* meaning + actually a storage capacity of more than *256 000 000 B*), + or used by **Mac OS X** since v10.6 to report file sizes. + + Arguments: + int (size): A file size. + + Returns: + `str`: A string containing a abbreviated file size and units. + + Example: + >>> filesize.decimal(30000) + '30.0 kB' + + """ + return _to_str(size, ("kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"), 1000) diff --git a/testbed/Textualize__rich/rich/live.py b/testbed/Textualize__rich/rich/live.py new file mode 100644 index 0000000000000000000000000000000000000000..cd813741f01fc800e45fd300daa0e61511b9319a --- /dev/null +++ b/testbed/Textualize__rich/rich/live.py @@ -0,0 +1,383 @@ +import sys +from threading import Event, RLock, Thread +from typing import IO, Any, List, Optional + +from typing_extensions import Literal + +from .__init__ import get_console +from ._loop import loop_last +from .console import ( + Console, + ConsoleOptions, + ConsoleRenderable, + RenderableType, + RenderHook, + RenderResult, +) +from .control import Control +from .file_proxy import FileProxy +from .jupyter import JupyterMixin +from .live_render import LiveRender +from .segment import Segment +from .style import Style +from .text import Text + +VerticalOverflowMethod = Literal["crop", "ellipsis", "visible"] + + +class _RefreshThread(Thread): + """A thread that calls refresh() at regular intervals.""" + + def __init__(self, live: "Live", refresh_per_second: float) -> None: + self.live = live + self.refresh_per_second = refresh_per_second + self.done = Event() + super().__init__() + + def stop(self) -> None: + self.done.set() + + def run(self) -> None: + while not self.done.wait(1 / self.refresh_per_second): + with self.live._lock: + self.live.refresh() + + +class _LiveRender(LiveRender): + def __init__(self, live: "Live", renderable: RenderableType) -> None: + self._live = live + self.renderable = renderable + self._shape: Optional[Tuple[int, int]] = None + + def __rich_console__( + self, console: Console, options: ConsoleOptions + ) -> RenderResult: + with self._live._lock: + lines = console.render_lines(self.renderable, options, pad=False) + + shape = Segment.get_shape(lines) + _, height = shape + if height > console.size.height: + if self._live.vertical_overflow == "crop": + lines = lines[: console.size.height] + shape = Segment.get_shape(lines) + elif self._live.vertical_overflow == "ellipsis": + lines = lines[: (console.size.height - 1)] + lines.append( + list( + console.render( + Text( + "...", + overflow="crop", + justify="center", + end="", + style="live.ellipsis", + ) + ) + ) + ) + shape = Segment.get_shape(lines) + + self._shape = shape + + for last, line in loop_last(lines): + yield from line + if not last: + yield Segment.line() + + +class Live(JupyterMixin, RenderHook): + """Renders an auto-updating live display of any given renderable. + + Args: + renderable (RenderableType, optional): [The renderable to live display. Defaults to displaying nothing. + console (Console, optional): Optional Console instance. Default will an internal Console instance writing to stdout. + auto_refresh (bool, optional): Enable auto refresh. If disabled, you will need to call `refresh()` or `update()` with refresh flag. Defaults to True + refresh_per_second (float, optional): Number of times per second to refresh the live display. Defaults to 1. + transient (bool, optional): Clear the renderable on exit. Defaults to False. + redirect_stdout (bool, optional): Enable redirection of stdout, so ``print`` may be used. Defaults to True. + redirect_stderr (bool, optional): Enable redirection of stderr. Defaults to True. + vertical_overflow (VerticalOverflowMethod, optional): How to handle renderable when it is too tall for the console. Defaults to "ellipsis". + """ + + def __init__( + self, + renderable: RenderableType = "", + *, + console: Console = None, + auto_refresh: bool = True, + refresh_per_second: float = 4, + transient: bool = False, + redirect_stdout: bool = True, + redirect_stderr: bool = True, + vertical_overflow: VerticalOverflowMethod = "ellipsis", + ) -> None: + assert refresh_per_second > 0, "refresh_per_second must be > 0" + self.console = console if console is not None else get_console() + self._live_render = _LiveRender(self, renderable) + + self._redirect_stdout = redirect_stdout + self._redirect_stderr = redirect_stderr + self._restore_stdout: Optional[IO[str]] = None + self._restore_stderr: Optional[IO[str]] = None + + self._lock = RLock() + self.ipy_widget: Optional[Any] = None + self.auto_refresh = auto_refresh + self._started: bool = False + self.transient = transient + + self._refresh_thread: Optional[_RefreshThread] = None + self.refresh_per_second = refresh_per_second + + self.vertical_overflow = vertical_overflow + # cant store just clear_control as the live_render shape is lazily computed on render + + def start(self) -> None: + """Start live rendering display.""" + with self._lock: + if self._started: + return + + self.console.show_cursor(False) + self._enable_redirect_io() + self.console.push_render_hook(self) + self._started = True + + if self.auto_refresh: + self._refresh_thread = _RefreshThread(self, self.refresh_per_second) + self._refresh_thread.start() + + def stop(self) -> None: + """Stop live rendering display.""" + with self._lock: + if not self._started: + return + self._started = False + try: + if self.auto_refresh and self._refresh_thread is not None: + self._refresh_thread.stop() + self._refresh_thread.join() + self._refresh_thread = None + # allow it to fully render on the last even if overflow + self.vertical_overflow = "visible" + if not self.console.is_jupyter: + self.refresh() + if self.console.is_terminal: + self.console.line() + finally: + self._disable_redirect_io() + self.console.pop_render_hook() + self.console.show_cursor(True) + + if self.transient: + self.console.control(self._live_render.restore_cursor()) + if self.ipy_widget is not None: # pragma: no cover + if self.transient: + self.ipy_widget.close() + else: + # jupyter last refresh must occur after console pop render hook + # i am not sure why this is needed + self.refresh() + + def __enter__(self) -> "Live": + self.start() + return self + + def __exit__(self, exc_type, exc_val, exc_tb) -> None: + self.stop() + + def _enable_redirect_io(self): + """Enable redirecting of stdout / stderr.""" + if self.console.is_terminal: + if self._redirect_stdout: + self._restore_stdout = sys.stdout + sys.stdout = FileProxy(self.console, sys.stdout) + if self._redirect_stderr: + self._restore_stderr = sys.stderr + sys.stderr = FileProxy(self.console, sys.stderr) + + @property + def renderable(self) -> RenderableType: + """Get the renderable that is being displayed + + Returns: + RenderableType: Displayed renderable. + """ + with self._lock: + return self._live_render.renderable + + def update(self, renderable: RenderableType, *, refresh: bool = False) -> None: + """Update the renderable that is being displayed + + Args: + renderable (RenderableType): New renderable to use. + refresh (bool, optional): Refresh the display. Defaults to False. + """ + with self._lock: + self._live_render.set_renderable(renderable) + if refresh: + self.refresh() + + def refresh(self) -> None: + """Update the display of the Live Render.""" + if self.console.is_jupyter: # pragma: no cover + try: + from IPython.display import display + from ipywidgets import Output + except ImportError: + import warnings + + warnings.warn('install "ipywidgets" for Jupyter support') + else: + with self._lock: + if self.ipy_widget is None: + self.ipy_widget = Output() + display(self.ipy_widget) + + with self.ipy_widget: + self.ipy_widget.clear_output(wait=True) + self.console.print(self._live_render.renderable) + elif self.console.is_terminal and not self.console.is_dumb_terminal: + with self._lock, self.console: + self.console.print(Control("")) + elif ( + not self._started and not self.transient + ): # if it is finished allow files or dumb-terminals to see final result + with self.console: + self.console.print(Control("")) + + def _disable_redirect_io(self): + """Disable redirecting of stdout / stderr.""" + if self._restore_stdout: + sys.stdout = self._restore_stdout + self._restore_stdout = None + if self._restore_stderr: + sys.stderr = self._restore_stderr + self._restore_stderr = None + + def process_renderables( + self, renderables: List[ConsoleRenderable] + ) -> List[ConsoleRenderable]: + """Process renderables to restore cursor and display progress.""" + if self.console.is_terminal: + # lock needs acquiring as user can modify live_render renerable at any time unlike in Progress. + with self._lock: + # determine the control command needed to clear previous rendering + renderables = [ + self._live_render.position_cursor(), + *renderables, + self._live_render, + ] + elif ( + not self._started and not self.transient + ): # if it is finished render the final output for files or dumb_terminals + renderables = [*renderables, self._live_render] + + return renderables + + +if __name__ == "__main__": # pragma: no cover + import random + import time + from itertools import cycle + from typing import Dict, List, Tuple + + from .console import Console + from .live import Live + from .panel import Panel + from .rule import Rule + from .syntax import Syntax + from .table import Table + + console = Console() + + syntax = Syntax( + '''def loop_last(values: Iterable[T]) -> Iterable[Tuple[bool, T]]: + """Iterate and generate a tuple with a flag for last value.""" + iter_values = iter(values) + try: + previous_value = next(iter_values) + except StopIteration: + return + for value in iter_values: + yield False, previous_value + previous_value = value + yield True, previous_value''', + "python", + line_numbers=True, + ) + + table = Table("foo", "bar", "baz") + table.add_row("1", "2", "3") + + progress_renderables = [ + "You can make the terminal shorter and taller to see the live table hide" + "Text may be printed while the progress bars are rendering.", + Panel("In fact, [i]any[/i] renderable will work"), + "Such as [magenta]tables[/]...", + table, + "Pretty printed structures...", + {"type": "example", "text": "Pretty printed"}, + "Syntax...", + syntax, + Rule("Give it a try!"), + ] + + examples = cycle(progress_renderables) + + exchanges = [ + "SGD", + "MYR", + "EUR", + "USD", + "AUD", + "JPY", + "CNH", + "HKD", + "CAD", + "INR", + "DKK", + "GBP", + "RUB", + "NZD", + "MXN", + "IDR", + "TWD", + "THB", + "VND", + ] + with Live(console=console) as live_table: + exchange_rate_dict: Dict[Tuple[str, str], float] = {} + + for index in range(100): + select_exchange = exchanges[index % len(exchanges)] + + for exchange in exchanges: + if exchange == select_exchange: + continue + time.sleep(0.4) + if random.randint(0, 10) < 1: + console.log(next(examples)) + exchange_rate_dict[(select_exchange, exchange)] = 200 / ( + (random.random() * 320) + 1 + ) + if len(exchange_rate_dict) > len(exchanges) - 1: + exchange_rate_dict.pop(list(exchange_rate_dict.keys())[0]) + table = Table(title="Exchange Rates") + + table.add_column("Source Currency") + table.add_column("Destination Currency") + table.add_column("Exchange Rate") + + for ((soure, dest), exchange_rate) in exchange_rate_dict.items(): + table.add_row( + soure, + dest, + Text( + f"{exchange_rate:.4f}", + style="red" if exchange_rate < 1.0 else "green", + ), + ) + + live_table.update(table) diff --git a/testbed/Textualize__rich/rich/live_render.py b/testbed/Textualize__rich/rich/live_render.py new file mode 100644 index 0000000000000000000000000000000000000000..1c2a80194a07af91544a4da2d2b9e2cd3f0f6a01 --- /dev/null +++ b/testbed/Textualize__rich/rich/live_render.py @@ -0,0 +1,75 @@ +from typing import Optional, Tuple + +from .console import Console, ConsoleOptions, RenderableType, RenderResult +from .control import Control +from .segment import Segment +from .style import StyleType +from ._loop import loop_last + + +class LiveRender: + """Creates a renderable that may be updated. + + Args: + renderable (RenderableType): Any renderable object. + style (StyleType, optional): An optional style to apply to the renderable. Defaults to "". + """ + + def __init__(self, renderable: RenderableType, style: StyleType = "") -> None: + self.renderable = renderable + self.style = style + self._shape: Optional[Tuple[int, int]] = None + + def set_renderable(self, renderable: RenderableType) -> None: + """Set a new renderable. + + Args: + renderable (RenderableType): Any renderable object, including str. + """ + self.renderable = renderable + + def position_cursor(self) -> Control: + """Get control codes to move cursor to beginning of live render. + + Returns: + Control: A control instance that may be printed. + """ + if self._shape is not None: + _, height = self._shape + return Control("\r\x1b[2K" + "\x1b[1A\x1b[2K" * (height - 1)) + return Control("") + + def restore_cursor(self) -> Control: + """Get control codes to clear the render and restore the cursor to its previous position. + + Returns: + Control: A Control instance that may be printed. + """ + if self._shape is not None: + _, height = self._shape + return Control("\r" + "\x1b[1A\x1b[2K" * height) + return Control("") + + def __rich_console__( + self, console: Console, options: ConsoleOptions + ) -> RenderResult: + style = console.get_style(self.style) + lines = console.render_lines(self.renderable, options, style=style, pad=False) + _Segment = Segment + shape = _Segment.get_shape(lines) + if self._shape is None: + self._shape = shape + else: + width1, height1 = shape + width2, height2 = self._shape + self._shape = ( + max(width1, min(options.max_width, width2)), + max(height1, height2), + ) + + width, height = self._shape + lines = _Segment.set_shape(lines, width, height) + for last, line in loop_last(lines): + yield from _Segment.make_control(line) + if not last: + yield _Segment.line(is_control=True) diff --git a/testbed/Textualize__rich/rich/logging.py b/testbed/Textualize__rich/rich/logging.py new file mode 100644 index 0000000000000000000000000000000000000000..8d166fd53b95b14f629db2283775e0a2dd15c97b --- /dev/null +++ b/testbed/Textualize__rich/rich/logging.py @@ -0,0 +1,253 @@ +import logging +from datetime import datetime +from logging import Handler, LogRecord +from pathlib import Path +from typing import ClassVar, List, Optional, Type, Union + +from . import get_console +from ._log_render import LogRender +from .console import Console, ConsoleRenderable +from .highlighter import Highlighter, ReprHighlighter +from .text import Text +from .traceback import Traceback + + +class RichHandler(Handler): + """A logging handler that renders output with Rich. The time / level / message and file are displayed in columns. + The level is color coded, and the message is syntax highlighted. + + Note: + Be careful when enabling console markup in log messages if you have configured logging for libraries not + under your control. If a dependency writes messages containing square brackets, it may not produce the intended output. + + Args: + level (Union[int, str], optional): Log level. Defaults to logging.NOTSET. + console (:class:`~rich.console.Console`, optional): Optional console instance to write logs. + Default will use a global console instance writing to stdout. + show_time (bool, optional): Show a column for the time. Defaults to True. + show_level (bool, optional): Show a column for the level. Defaults to True. + show_path (bool, optional): Show the path to the original log call. Defaults to True. + enable_link_path (bool, optional): Enable terminal link of path column to file. Defaults to True. + highlighter (Highlighter, optional): Highlighter to style log messages, or None to use ReprHighlighter. Defaults to None. + markup (bool, optional): Enable console markup in log messages. Defaults to False. + rich_tracebacks (bool, optional): Enable rich tracebacks with syntax highlighting and formatting. Defaults to False. + tracebacks_width (Optional[int], optional): Number of characters used to render tracebacks, or None for full width. Defaults to None. + tracebacks_extra_lines (int, optional): Additional lines of code to render tracebacks, or None for full width. Defaults to None. + tracebacks_theme (str, optional): Override pygments theme used in traceback. + tracebacks_word_wrap (bool, optional): Enable word wrapping of long tracebacks lines. Defaults to False. + tracebacks_show_locals (bool, optional): Enable display of locals in tracebacks. Defaults to False. + locals_max_length (int, optional): Maximum length of containers before abbreviating, or None for no abbreviation. + Defaults to 10. + locals_max_string (int, optional): Maximum length of string before truncating, or None to disable. Defaults to 80. + """ + + KEYWORDS: ClassVar[Optional[List[str]]] = [ + "GET", + "POST", + "HEAD", + "PUT", + "DELETE", + "OPTIONS", + "TRACE", + "PATCH", + ] + HIGHLIGHTER_CLASS: ClassVar[Type[Highlighter]] = ReprHighlighter + + def __init__( + self, + level: Union[int, str] = logging.NOTSET, + console: Console = None, + *, + show_time: bool = True, + show_level: bool = True, + show_path: bool = True, + enable_link_path: bool = True, + highlighter: Highlighter = None, + markup: bool = False, + rich_tracebacks: bool = False, + tracebacks_width: Optional[int] = None, + tracebacks_extra_lines: int = 3, + tracebacks_theme: Optional[str] = None, + tracebacks_word_wrap: bool = True, + tracebacks_show_locals: bool = False, + locals_max_length: int = 10, + locals_max_string: int = 80, + ) -> None: + super().__init__(level=level) + self.console = console or get_console() + self.highlighter = highlighter or self.HIGHLIGHTER_CLASS() + self._log_render = LogRender( + show_time=show_time, + show_level=show_level, + show_path=show_path, + level_width=None, + ) + self.enable_link_path = enable_link_path + self.markup = markup + self.rich_tracebacks = rich_tracebacks + self.tracebacks_width = tracebacks_width + self.tracebacks_extra_lines = tracebacks_extra_lines + self.tracebacks_theme = tracebacks_theme + self.tracebacks_word_wrap = tracebacks_word_wrap + self.tracebacks_show_locals = tracebacks_show_locals + self.locals_max_length = locals_max_length + self.locals_max_string = locals_max_string + + def get_level_text(self, record: LogRecord) -> Text: + """Get the level name from the record. + + Args: + record (LogRecord): LogRecord instance. + + Returns: + Text: A tuple of the style and level name. + """ + level_name = record.levelname + level_text = Text.styled( + level_name.ljust(8), f"logging.level.{level_name.lower()}" + ) + return level_text + + def emit(self, record: LogRecord) -> None: + """Invoked by logging.""" + message = self.format(record) + + traceback = None + if ( + self.rich_tracebacks + and record.exc_info + and record.exc_info != (None, None, None) + ): + exc_type, exc_value, exc_traceback = record.exc_info + assert exc_type is not None + assert exc_value is not None + traceback = Traceback.from_exception( + exc_type, + exc_value, + exc_traceback, + width=self.tracebacks_width, + extra_lines=self.tracebacks_extra_lines, + theme=self.tracebacks_theme, + word_wrap=self.tracebacks_word_wrap, + show_locals=self.tracebacks_show_locals, + locals_max_length=self.locals_max_length, + locals_max_string=self.locals_max_string, + ) + message = record.getMessage() + + message_renderable = self.render_message(record, message) + log_renderable = self.render( + record=record, traceback=traceback, message_renderable=message_renderable + ) + self.console.print(log_renderable) + + def render_message(self, record: LogRecord, message: str) -> "ConsoleRenderable": + """Render message text in to Text. + + record (LogRecord): logging Record. + message (str): String cotaining log message. + + Returns: + ConsoleRenderable: Renderable to display log message. + """ + use_markup = ( + getattr(record, "markup") if hasattr(record, "markup") else self.markup + ) + message_text = Text.from_markup(message) if use_markup else Text(message) + if self.highlighter: + message_text = self.highlighter(message_text) + if self.KEYWORDS: + message_text.highlight_words(self.KEYWORDS, "logging.keyword") + return message_text + + def render( + self, + *, + record: LogRecord, + traceback: Optional[Traceback], + message_renderable: "ConsoleRenderable", + ) -> "ConsoleRenderable": + """Render log for display. + + Args: + record (LogRecord): logging Record. + traceback (Optional[Traceback]): Traceback instance or None for no Traceback. + message_renderable (ConsoleRenderable): Renderable (typically Text) containing log message contents. + + Returns: + ConsoleRenderable: Renderable to display log. + """ + path = Path(record.pathname).name + level = self.get_level_text(record) + time_format = None if self.formatter is None else self.formatter.datefmt + log_time = datetime.fromtimestamp(record.created) + + log_renderable = self._log_render( + self.console, + [message_renderable] if not traceback else [message_renderable, traceback], + log_time=log_time, + time_format=time_format, + level=level, + path=path, + line_no=record.lineno, + link_path=record.pathname if self.enable_link_path else None, + ) + return log_renderable + + +if __name__ == "__main__": # pragma: no cover + from time import sleep + + FORMAT = "%(message)s" + # FORMAT = "%(asctime)-15s - %(level) - %(message)s" + logging.basicConfig( + level="NOTSET", + format=FORMAT, + datefmt="[%X]", + handlers=[RichHandler(rich_tracebacks=True, tracebacks_show_locals=True)], + ) + log = logging.getLogger("rich") + + log.info("Server starting...") + log.info("Listening on http://127.0.0.1:8080") + sleep(1) + + log.info("GET /index.html 200 1298") + log.info("GET /imgs/backgrounds/back1.jpg 200 54386") + log.info("GET /css/styles.css 200 54386") + log.warning("GET /favicon.ico 404 242") + sleep(1) + + log.debug( + "JSONRPC request\n--> %r\n<-- %r", + { + "version": "1.1", + "method": "confirmFruitPurchase", + "params": [["apple", "orange", "mangoes", "pomelo"], 1.123], + "id": "194521489", + }, + {"version": "1.1", "result": True, "error": None, "id": "194521489"}, + ) + log.debug( + "Loading configuration file /adasd/asdasd/qeqwe/qwrqwrqwr/sdgsdgsdg/werwerwer/dfgerert/ertertert/ertetert/werwerwer" + ) + log.error("Unable to find 'pomelo' in database!") + log.info("POST /jsonrpc/ 200 65532") + log.info("POST /admin/ 401 42234") + log.warning("password was rejected for admin site.") + + def divide(): + number = 1 + divisor = 0 + foos = ["foo"] * 100 + log.debug("in divide") + try: + number / divisor + except: + log.exception("An error of some kind occurred!") + + divide() + sleep(1) + log.critical("Out of memory!") + log.info("Server exited with code=-1") + log.info("[bold]EXITING...[/bold]", extra=dict(markup=True)) diff --git a/testbed/Textualize__rich/rich/markup.py b/testbed/Textualize__rich/rich/markup.py new file mode 100644 index 0000000000000000000000000000000000000000..99d566314440018e99bc62a771664e639314435c --- /dev/null +++ b/testbed/Textualize__rich/rich/markup.py @@ -0,0 +1,179 @@ +import re +from typing import Iterable, List, Match, NamedTuple, Optional, Tuple, Union + +from .errors import MarkupError +from .style import Style +from .text import Span, Text +from ._emoji_replace import _emoji_replace + + +RE_TAGS = re.compile( + r"""((\\*)\[([a-z#\/].*?)\])""", + re.VERBOSE, +) + + +class Tag(NamedTuple): + """A tag in console markup.""" + + name: str + """The tag name. e.g. 'bold'.""" + parameters: Optional[str] + """Any additional parameters after the name.""" + + def __str__(self) -> str: + return ( + self.name if self.parameters is None else f"{self.name} {self.parameters}" + ) + + @property + def markup(self) -> str: + """Get the string representation of this tag.""" + return ( + f"[{self.name}]" + if self.parameters is None + else f"[{self.name}={self.parameters}]" + ) + + +def escape(markup: str, _escape=re.compile(r"(\\*)(\[[a-z#\/].*?\])").sub) -> str: + """Escapes text so that it won't be interpreted as markup. + + Args: + markup (str): Content to be inserted in to markup. + + Returns: + str: Markup with square brackets escaped. + """ + + def escape_backslashes(match: Match[str]) -> str: + """Called by re.sub replace matches.""" + backslashes, text = match.groups() + return f"{backslashes}{backslashes}\\{text}" + + markup = _escape(escape_backslashes, markup) + return markup + + +def _parse(markup: str) -> Iterable[Tuple[int, Optional[str], Optional[Tag]]]: + """Parse markup in to an iterable of tuples of (position, text, tag). + + Args: + markup (str): A string containing console markup + + """ + position = 0 + _divmod = divmod + _Tag = Tag + for match in RE_TAGS.finditer(markup): + full_text, escapes, tag_text = match.groups() + start, end = match.span() + if start > position: + yield start, markup[position:start], None + if escapes: + backslashes, escaped = _divmod(len(escapes), 2) + if backslashes: + # Literal backslashes + yield start, "\\" * backslashes, None + start += backslashes * 2 + if escaped: + # Escape of tag + yield start, full_text[len(escapes) :], None + position = end + continue + text, equals, parameters = tag_text.partition("=") + yield start, None, _Tag(text, parameters if equals else None) + position = end + if position < len(markup): + yield position, markup[position:], None + + +def render(markup: str, style: Union[str, Style] = "", emoji: bool = True) -> Text: + """Render console markup in to a Text instance. + + Args: + markup (str): A string containing console markup. + emoji (bool, optional): Also render emoji code. Defaults to True. + + Raises: + MarkupError: If there is a syntax error in the markup. + + Returns: + Text: A test instance. + """ + emoji_replace = _emoji_replace + if "[" not in markup: + return Text(emoji_replace(markup) if emoji else markup, style=style) + text = Text(style=style) + append = text.append + normalize = Style.normalize + + style_stack: List[Tuple[int, Tag]] = [] + pop = style_stack.pop + + spans: List[Span] = [] + append_span = spans.append + + _Span = Span + _Tag = Tag + + def pop_style(style_name: str) -> Tuple[int, Tag]: + """Pop tag matching given style name.""" + for index, (_, tag) in enumerate(reversed(style_stack), 1): + if tag.name == style_name: + return pop(-index) + raise KeyError(style_name) + + for position, plain_text, tag in _parse(markup): + if plain_text is not None: + append(emoji_replace(plain_text) if emoji else plain_text) + elif tag is not None: + if tag.name.startswith("/"): # Closing tag + style_name = tag.name[1:].strip() + if style_name: # explicit close + style_name = normalize(style_name) + try: + start, open_tag = pop_style(style_name) + except KeyError: + raise MarkupError( + f"closing tag '{tag.markup}' at position {position} doesn't match any open tag" + ) from None + else: # implicit close + try: + start, open_tag = pop() + except IndexError: + raise MarkupError( + f"closing tag '[/]' at position {position} has nothing to close" + ) from None + + append_span(_Span(start, len(text), str(open_tag))) + else: # Opening tag + normalized_tag = _Tag(normalize(tag.name), tag.parameters) + style_stack.append((len(text), normalized_tag)) + + text_length = len(text) + while style_stack: + start, tag = style_stack.pop() + append_span(_Span(start, text_length, str(tag))) + + text.spans = sorted(spans) + return text + + +if __name__ == "__main__": # pragma: no cover + + from rich.console import Console + from rich.text import Text + + console = Console(highlight=False) + + console.print("Hello [1], [1,2,3] ['hello']") + console.print("foo") + console.print("Hello [link=https://www.willmcgugan.com]W[b red]o[/]rld[/]!") + + from rich import print + + print(escape("[red]")) + print(escape(r"\[red]")) + print(escape(r"\\[red]")) + print(escape(r"\\\[red]")) diff --git a/testbed/Textualize__rich/rich/padding.py b/testbed/Textualize__rich/rich/padding.py new file mode 100644 index 0000000000000000000000000000000000000000..522c6cf8009372f34404dc49cb7f1ba6240b0f2b --- /dev/null +++ b/testbed/Textualize__rich/rich/padding.py @@ -0,0 +1,124 @@ +from typing import cast, Tuple, TYPE_CHECKING, Union + +if TYPE_CHECKING: + from .console import ( + Console, + ConsoleOptions, + RenderableType, + RenderResult, + ) +from .jupyter import JupyterMixin +from .measure import Measurement +from .style import Style +from .segment import Segment + + +PaddingDimensions = Union[int, Tuple[int], Tuple[int, int], Tuple[int, int, int, int]] + + +class Padding(JupyterMixin): + """Draw space around content. + + Example: + >>> print(Padding("Hello", (2, 4), style="on blue")) + + Args: + renderable (RenderableType): String or other renderable. + pad (Union[int, Tuple[int]]): Padding for top, right, bottom, and left borders. + May be specified with 1, 2, or 4 integers (CSS style). + style (Union[str, Style], optional): Style for padding characters. Defaults to "none". + expand (bool, optional): Expand padding to fit available width. Defaults to True. + """ + + def __init__( + self, + renderable: "RenderableType", + pad: "PaddingDimensions" = (0, 0, 0, 0), + *, + style: Union[str, Style] = "none", + expand: bool = True, + ): + self.renderable = renderable + self.top, self.right, self.bottom, self.left = self.unpack(pad) + self.style = style + self.expand = expand + + @classmethod + def indent(cls, renderable: "RenderableType", level: int) -> "Padding": + """Make padding instance to render an indent. + + Args: + renderable (RenderableType): String or other renderable. + level (int): Number of characters to indent. + + Returns: + Padding: A Padding instance. + """ + + return Padding(renderable, pad=(0, 0, 0, level), expand=False) + + @staticmethod + def unpack(pad: "PaddingDimensions") -> Tuple[int, int, int, int]: + """Unpack padding specified in CSS style.""" + if isinstance(pad, int): + return (pad, pad, pad, pad) + if len(pad) == 1: + _pad = pad[0] + return (_pad, _pad, _pad, _pad) + if len(pad) == 2: + pad_top, pad_right = cast(Tuple[int, int], pad) + return (pad_top, pad_right, pad_top, pad_right) + if len(pad) == 4: + top, right, bottom, left = cast(Tuple[int, int, int, int], pad) + return (top, right, bottom, left) + raise ValueError(f"1, 2 or 4 integers required for padding; {len(pad)} given") + + def __repr__(self) -> str: + return f"Padding({self.renderable!r}, ({self.top},{self.right},{self.bottom},{self.left}))" + + def __rich_console__( + self, console: "Console", options: "ConsoleOptions" + ) -> "RenderResult": + + style = console.get_style(self.style) + if self.expand: + width = options.max_width + else: + width = min( + Measurement.get(console, self.renderable, options.max_width).maximum + + self.left + + self.right, + options.max_width, + ) + child_options = options.update(width=width - self.left - self.right) + lines = console.render_lines( + self.renderable, child_options, style=style, pad=False + ) + lines = Segment.set_shape(lines, child_options.max_width, style=style) + + blank_line = Segment(" " * width + "\n", style) + top = [blank_line] * self.top + bottom = [blank_line] * self.bottom + left = Segment(" " * self.left, style) if self.left else None + right = Segment(" " * self.right, style) if self.right else None + new_line = Segment.line() + yield from top + for line in lines: + if left is not None: + yield left + yield from line + if right is not None: + yield right + yield new_line + yield from bottom + + def __rich_measure__(self, console: "Console", max_width: int) -> "Measurement": + extra_width = self.left + self.right + if max_width - extra_width < 1: + return Measurement(max_width, max_width) + measure_min, measure_max = Measurement.get( + console, self.renderable, max(0, max_width - extra_width) + ) + measurement = Measurement(measure_min + extra_width, measure_max + extra_width) + measurement = measurement.with_maximum(max_width) + return measurement diff --git a/testbed/Textualize__rich/rich/progress.py b/testbed/Textualize__rich/rich/progress.py new file mode 100644 index 0000000000000000000000000000000000000000..56e5541ef4ac86f78ac531e39730f4898e1d8c4e --- /dev/null +++ b/testbed/Textualize__rich/rich/progress.py @@ -0,0 +1,1099 @@ +import sys +from abc import ABC, abstractmethod +from collections import deque +from collections.abc import Sized +from dataclasses import dataclass, field +from datetime import timedelta +from math import ceil +from threading import Event, RLock, Thread +from typing import ( + IO, + Any, + Callable, + Deque, + Dict, + Iterable, + List, + NamedTuple, + NewType, + Optional, + Sequence, + Tuple, + TypeVar, + Union, +) + +from . import filesize, get_console +from .console import ( + Console, + ConsoleRenderable, + JustifyMethod, + RenderableType, + RenderGroup, + RenderHook, +) +from .control import Control +from .file_proxy import FileProxy +from .highlighter import Highlighter +from .jupyter import JupyterMixin +from .live_render import LiveRender +from .progress_bar import ProgressBar +from .spinner import Spinner +from .style import StyleType +from .table import Table +from .text import Text, TextType + +TaskID = NewType("TaskID", int) + +ProgressType = TypeVar("ProgressType") + +GetTimeCallable = Callable[[], float] + + +class _TrackThread(Thread): + """A thread to periodically update progress.""" + + def __init__(self, progress: "Progress", task_id: "TaskID", update_period: float): + self.progress = progress + self.task_id = task_id + self.update_period = update_period + self.done = Event() + + self.completed = 0 + super().__init__() + + def run(self) -> None: + task_id = self.task_id + advance = self.progress.advance + update_period = self.update_period + last_completed = 0 + wait = self.done.wait + while not wait(update_period): + completed = self.completed + if last_completed != completed: + advance(task_id, completed - last_completed) + last_completed = completed + + self.progress.update(self.task_id, completed=self.completed, refresh=True) + + def __enter__(self) -> "_TrackThread": + self.start() + return self + + def __exit__(self, exc_type, exc_val, exc_tb) -> None: + self.done.set() + self.join() + + +def track( + sequence: Union[Sequence[ProgressType], Iterable[ProgressType]], + description="Working...", + total: int = None, + auto_refresh=True, + console: Optional[Console] = None, + transient: bool = False, + get_time: Callable[[], float] = None, + refresh_per_second: float = None, + style: StyleType = "bar.back", + complete_style: StyleType = "bar.complete", + finished_style: StyleType = "bar.finished", + pulse_style: StyleType = "bar.pulse", + update_period: float = 0.1, + disable: bool = False, +) -> Iterable[ProgressType]: + """Track progress by iterating over a sequence. + + Args: + sequence (Iterable[ProgressType]): A sequence (must support "len") you wish to iterate over. + description (str, optional): Description of task show next to progress bar. Defaults to "Working". + total: (int, optional): Total number of steps. Default is len(sequence). + auto_refresh (bool, optional): Automatic refresh, disable to force a refresh after each iteration. Default is True. + transient: (bool, optional): Clear the progress on exit. Defaults to False. + console (Console, optional): Console to write to. Default creates internal Console instance. + refresh_per_second (Optional[float], optional): Number of times per second to refresh the progress information, or None to use default. Defaults to None. + style (StyleType, optional): Style for the bar background. Defaults to "bar.back". + complete_style (StyleType, optional): Style for the completed bar. Defaults to "bar.complete". + finished_style (StyleType, optional): Style for a finished bar. Defaults to "bar.done". + pulse_style (StyleType, optional): Style for pulsing bars. Defaults to "bar.pulse". + update_period (float, optional): Minimum time (in seconds) between calls to update(). Defaults to 0.1. + disable (bool, optional): Disable display of progress. + Returns: + Iterable[ProgressType]: An iterable of the values in the sequence. + + """ + + columns: List["ProgressColumn"] = ( + [TextColumn("[progress.description]{task.description}")] if description else [] + ) + columns.extend( + ( + BarColumn( + style=style, + complete_style=complete_style, + finished_style=finished_style, + pulse_style=pulse_style, + ), + TextColumn("[progress.percentage]{task.percentage:>3.0f}%"), + TimeRemainingColumn(), + ) + ) + progress = Progress( + *columns, + auto_refresh=auto_refresh, + console=console, + transient=transient, + get_time=get_time, + refresh_per_second=refresh_per_second, + disable=disable, + ) + + with progress: + yield from progress.track( + sequence, total=total, description=description, update_period=update_period + ) + + +class ProgressColumn(ABC): + """Base class for a widget to use in progress display.""" + + max_refresh: Optional[float] = None + + def __init__(self) -> None: + self._renderable_cache: Dict[TaskID, Tuple[float, RenderableType]] = {} + self._update_time: Optional[float] = None + + def __call__(self, task: "Task") -> RenderableType: + """Called by the Progress object to return a renderable for the given task. + + Args: + task (Task): An object containing information regarding the task. + + Returns: + RenderableType: Anything renderable (including str). + """ + current_time = task.get_time() # type: ignore + if self.max_refresh is not None and not task.completed: + try: + timestamp, renderable = self._renderable_cache[task.id] + except KeyError: + pass + else: + if timestamp + self.max_refresh > current_time: + return renderable + + renderable = self.render(task) + self._renderable_cache[task.id] = (current_time, renderable) + return renderable + + @abstractmethod + def render(self, task: "Task") -> RenderableType: + """Should return a renderable object.""" + + +class RenderableColumn(ProgressColumn): + """A column to insert an arbitrary column. + + Args: + renderable (RenderableType, optional): Any renderable. Defaults to empty string. + """ + + def __init__(self, renderable: RenderableType = ""): + self.renderable = renderable + super().__init__() + + def render(self, task: "Task") -> RenderableType: + return self.renderable + + +class SpinnerColumn(ProgressColumn): + """A column with a 'spinner' animation. + + Args: + spinner_name (str, optional): Name of spinner animation. Defaults to "dots". + style (StyleType, optional): Style of spinner. Defaults to "progress.spinner". + speed (float, optional): Speed factor of spinner. Defaults to 1.0. + finished_text (TextType, optional): Text used when task is finished. Defaults to " ". + """ + + def __init__( + self, + spinner_name: str = "dots", + style: Optional[StyleType] = "progress.spinner", + speed: float = 1.0, + finished_text: TextType = " ", + ): + self.spinner = Spinner(spinner_name, style=style, speed=speed) + self.finished_text = ( + Text.from_markup(finished_text) + if isinstance(finished_text, str) + else finished_text + ) + super().__init__() + + def set_spinner( + self, + spinner_name: str, + spinner_style: Optional[StyleType] = "progress.spinner", + speed: float = 1.0, + ): + """Set a new spinner. + + Args: + spinner_name (str): Spinner name, see python -m rich.spinner. + spinner_style (Optional[StyleType], optional): Spinner style. Defaults to "progress.spinner". + speed (float, optional): Speed factor of spinner. Defaults to 1.0. + """ + self.spinner = Spinner(spinner_name, style=spinner_style, speed=speed) + + def render(self, task: "Task") -> Text: + if task.finished: + return self.finished_text + text = self.spinner.render(task.get_time()) + return text + + +class TextColumn(ProgressColumn): + """A column containing text.""" + + def __init__( + self, + text_format: str, + style: StyleType = "none", + justify: JustifyMethod = "left", + markup: bool = True, + highlighter: Highlighter = None, + ) -> None: + self.text_format = text_format + self.justify = justify + self.style = style + self.markup = markup + self.highlighter = highlighter + super().__init__() + + def render(self, task: "Task") -> Text: + _text = self.text_format.format(task=task) + if self.markup: + text = Text.from_markup(_text, style=self.style, justify=self.justify) + else: + text = Text(_text, style=self.style, justify=self.justify) + if self.highlighter: + self.highlighter.highlight(text) + return text + + +class BarColumn(ProgressColumn): + """Renders a visual progress bar. + + Args: + bar_width (Optional[int], optional): Width of bar or None for full width. Defaults to 40. + style (StyleType, optional): Style for the bar background. Defaults to "bar.back". + complete_style (StyleType, optional): Style for the completed bar. Defaults to "bar.complete". + finished_style (StyleType, optional): Style for a finished bar. Defaults to "bar.done". + pulse_style (StyleType, optional): Style for pulsing bars. Defaults to "bar.pulse". + """ + + def __init__( + self, + bar_width: Optional[int] = 40, + style: StyleType = "bar.back", + complete_style: StyleType = "bar.complete", + finished_style: StyleType = "bar.finished", + pulse_style: StyleType = "bar.pulse", + ) -> None: + self.bar_width = bar_width + self.style = style + self.complete_style = complete_style + self.finished_style = finished_style + self.pulse_style = pulse_style + super().__init__() + + def render(self, task: "Task") -> ProgressBar: + """Gets a progress bar widget for a task.""" + return ProgressBar( + total=max(0, task.total), + completed=max(0, task.completed), + width=None if self.bar_width is None else max(1, self.bar_width), + pulse=not task.started, + animation_time=task.get_time(), + style=self.style, + complete_style=self.complete_style, + finished_style=self.finished_style, + pulse_style=self.pulse_style, + ) + + +class TimeElapsedColumn(ProgressColumn): + """Renders time elapsed.""" + + def render(self, task: "Task") -> Text: + """Show time remaining.""" + elapsed = task.finished_time if task.finished else task.elapsed + if elapsed is None: + return Text("-:--:--", style="progress.elapsed") + delta = timedelta(seconds=int(elapsed)) + return Text(str(delta), style="progress.elapsed") + + +class TimeRemainingColumn(ProgressColumn): + """Renders estimated time remaining.""" + + # Only refresh twice a second to prevent jitter + max_refresh = 0.5 + + def render(self, task: "Task") -> Text: + """Show time remaining.""" + remaining = task.time_remaining + if remaining is None: + return Text("-:--:--", style="progress.remaining") + remaining_delta = timedelta(seconds=int(remaining)) + return Text(str(remaining_delta), style="progress.remaining") + + +class FileSizeColumn(ProgressColumn): + """Renders completed filesize.""" + + def render(self, task: "Task") -> Text: + """Show data completed.""" + data_size = filesize.decimal(int(task.completed)) + return Text(data_size, style="progress.filesize") + + +class TotalFileSizeColumn(ProgressColumn): + """Renders total filesize.""" + + def render(self, task: "Task") -> Text: + """Show data completed.""" + data_size = filesize.decimal(int(task.total)) + return Text(data_size, style="progress.filesize.total") + + +class DownloadColumn(ProgressColumn): + """Renders file size downloaded and total, e.g. '0.5/2.3 GB'. + + Args: + binary_units (bool, optional): Use binary units, KiB, MiB etc. Defaults to False. + """ + + def __init__(self, binary_units: bool = False) -> None: + self.binary_units = binary_units + super().__init__() + + def render(self, task: "Task") -> Text: + """Calculate common unit for completed and total.""" + completed = int(task.completed) + total = int(task.total) + if self.binary_units: + unit, suffix = filesize.pick_unit_and_suffix( + total, + ["bytes", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"], + 1024, + ) + else: + unit, suffix = filesize.pick_unit_and_suffix( + total, ["bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], 1000 + ) + completed_ratio = completed / unit + total_ratio = total / unit + precision = 0 if unit == 1 else 1 + completed_str = f"{completed_ratio:,.{precision}f}" + total_str = f"{total_ratio:,.{precision}f}" + download_status = f"{completed_str}/{total_str} {suffix}" + download_text = Text(download_status, style="progress.download") + return download_text + + +class TransferSpeedColumn(ProgressColumn): + """Renders human readable transfer speed.""" + + def render(self, task: "Task") -> Text: + """Show data transfer speed.""" + speed = task.speed + if speed is None: + return Text("?", style="progress.data.speed") + data_speed = filesize.decimal(int(speed)) + return Text(f"{data_speed}/s", style="progress.data.speed") + + +class ProgressSample(NamedTuple): + """Sample of progress for a given time.""" + + timestamp: float + """Timestamp of sample.""" + completed: float + """Number of steps completed.""" + + +@dataclass +class Task: + """Information regarding a progress task. + + This object should be considered read-only outside of the :class:`~Progress` class. + + """ + + id: TaskID + """Task ID associated with this task (used in Progress methods).""" + + description: str + """str: Description of the task.""" + + total: float + """str: Total number of steps in this task.""" + + completed: float + """float: Number of steps completed""" + + _get_time: GetTimeCallable + """Callable to get the current time.""" + + finished_time: Optional[float] = None + """float: Time task was finished.""" + + visible: bool = True + """bool: Indicates if this task is visible in the progress display.""" + + fields: Dict[str, Any] = field(default_factory=dict) + """dict: Arbitrary fields passed in via Progress.update.""" + + start_time: Optional[float] = field(default=None, init=False, repr=False) + """Optional[float]: Time this task was started, or None if not started.""" + + stop_time: Optional[float] = field(default=None, init=False, repr=False) + """Optional[float]: Time this task was stopped, or None if not stopped.""" + + _progress: Deque[ProgressSample] = field( + default_factory=deque, init=False, repr=False + ) + + def get_time(self) -> float: + """float: Get the current time, in seconds.""" + return self._get_time() # type: ignore + + @property + def started(self) -> bool: + """bool: Check if the task as started.""" + return self.start_time is not None + + @property + def remaining(self) -> float: + """float: Get the number of steps remaining.""" + return self.total - self.completed + + @property + def elapsed(self) -> Optional[float]: + """Optional[float]: Time elapsed since task was started, or ``None`` if the task hasn't started.""" + if self.start_time is None: + return None + if self.stop_time is not None: + return self.stop_time - self.start_time + return self.get_time() - self.start_time + + @property + def finished(self) -> bool: + """Check if the task has finished.""" + return self.finished_time is not None + + @property + def percentage(self) -> float: + """float: Get progress of task as a percentage.""" + if not self.total: + return 0.0 + completed = (self.completed / self.total) * 100.0 + completed = min(100.0, max(0.0, completed)) + return completed + + @property + def speed(self) -> Optional[float]: + """Optional[float]: Get the estimated speed in steps per second.""" + if self.start_time is None: + return None + progress = self._progress + if not progress: + return None + total_time = progress[-1].timestamp - progress[0].timestamp + if total_time == 0: + return None + iter_progress = iter(progress) + next(iter_progress) + total_completed = sum(sample.completed for sample in iter_progress) + speed = total_completed / total_time + return speed + + @property + def time_remaining(self) -> Optional[float]: + """Optional[float]: Get estimated time to completion, or ``None`` if no data.""" + if self.finished: + return 0.0 + speed = self.speed + if not speed: + return None + estimate = ceil(self.remaining / speed) + return estimate + + def _reset(self) -> None: + """Reset progress.""" + self._progress.clear() + self.finished_time = None + + +class _RefreshThread(Thread): + """A thread that calls refresh() on the Process object at regular intervals.""" + + def __init__(self, progress: "Progress", refresh_per_second: float = 10) -> None: + self.progress = progress + self.refresh_per_second = refresh_per_second + self.done = Event() + super().__init__() + + def stop(self) -> None: + self.done.set() + + def run(self) -> None: + while not self.done.wait(1.0 / self.refresh_per_second): + self.progress.refresh() + + +class Progress(JupyterMixin, RenderHook): + """Renders an auto-updating progress bar(s). + + Args: + console (Console, optional): Optional Console instance. Default will an internal Console instance writing to stdout. + auto_refresh (bool, optional): Enable auto refresh. If disabled, you will need to call `refresh()`. + refresh_per_second (Optional[float], optional): Number of times per second to refresh the progress information or None to use default (10). Defaults to None. + speed_estimate_period: (float, optional): Period (in seconds) used to calculate the speed estimate. Defaults to 30. + transient: (bool, optional): Clear the progress on exit. Defaults to False. + redirect_stdout: (bool, optional): Enable redirection of stdout, so ``print`` may be used. Defaults to True. + redirect_stderr: (bool, optional): Enable redirection of stderr. Defaults to True. + get_time: (Callable, optional): A callable that gets the current time, or None to use Console.get_time. Defaults to None. + disable (bool, optional): Disable progress display. Defaults to False + """ + + def __init__( + self, + *columns: Union[str, ProgressColumn], + console: Console = None, + auto_refresh: bool = True, + refresh_per_second: float = None, + speed_estimate_period: float = 30.0, + transient: bool = False, + redirect_stdout: bool = True, + redirect_stderr: bool = True, + get_time: GetTimeCallable = None, + disable: bool = False, + ) -> None: + assert ( + refresh_per_second is None or refresh_per_second > 0 + ), "refresh_per_second must be > 0" + self._lock = RLock() + self.columns = columns or ( + TextColumn("[progress.description]{task.description}"), + BarColumn(), + TextColumn("[progress.percentage]{task.percentage:>3.0f}%"), + TimeRemainingColumn(), + ) + self.console = console or get_console() + self.auto_refresh = auto_refresh and not self.console.is_jupyter + self.refresh_per_second = refresh_per_second or 10 + self.speed_estimate_period = speed_estimate_period + self.transient = transient + self._redirect_stdout = redirect_stdout + self._redirect_stderr = redirect_stderr + self.get_time = get_time or self.console.get_time + self.disable = disable + self._tasks: Dict[TaskID, Task] = {} + self._live_render = LiveRender(self.get_renderable()) + self._task_index: TaskID = TaskID(0) + self._refresh_thread: Optional[_RefreshThread] = None + self._started = False + self.print = self.console.print + self.log = self.console.log + self._restore_stdout: Optional[IO[str]] = None + self._restore_stderr: Optional[IO[str]] = None + self.ipy_widget: Optional[Any] = None + + @property + def tasks(self) -> List[Task]: + """Get a list of Task instances.""" + with self._lock: + return list(self._tasks.values()) + + @property + def task_ids(self) -> List[TaskID]: + """A list of task IDs.""" + with self._lock: + return list(self._tasks.keys()) + + @property + def finished(self) -> bool: + """Check if all tasks have been completed.""" + with self._lock: + if not self._tasks: + return True + return all(task.finished for task in self._tasks.values()) + + def _enable_redirect_io(self): + """Enable redirecting of stdout / stderr.""" + if self.console.is_terminal: + if self._redirect_stdout: + self._restore_stdout = sys.stdout + sys.stdout = FileProxy(self.console, sys.stdout) + if self._redirect_stderr: + self._restore_stderr = sys.stderr + sys.stderr = FileProxy(self.console, sys.stderr) + + def _disable_redirect_io(self): + """Disable redirecting of stdout / stderr.""" + if self._restore_stdout: + sys.stdout = self._restore_stdout + self._restore_stdout = None + if self._restore_stderr: + sys.stderr = self._restore_stderr + self._restore_stderr = None + + def start(self) -> None: + """Start the progress display.""" + with self._lock: + if self._started: + return + self._started = True + self.console.show_cursor(False) + self._enable_redirect_io() + self.console.push_render_hook(self) + self.refresh() + if self.auto_refresh: + self._refresh_thread = _RefreshThread(self, self.refresh_per_second) + self._refresh_thread.start() + + def stop(self) -> None: + """Stop the progress display.""" + with self._lock: + if not self._started: + return + self._started = False + try: + if self.auto_refresh and self._refresh_thread is not None: + self._refresh_thread.stop() + self.refresh() + if self.console.is_terminal: + self.console.line() + finally: + self.console.show_cursor(True) + self._disable_redirect_io() + self.console.pop_render_hook() + if self._refresh_thread is not None: + self._refresh_thread.join() + self._refresh_thread = None + if self.transient: + self.console.control(self._live_render.restore_cursor()) + if self.ipy_widget is not None and self.transient: # pragma: no cover + self.ipy_widget.clear_output() + self.ipy_widget.close() + + def __enter__(self) -> "Progress": + self.start() + return self + + def __exit__(self, exc_type, exc_val, exc_tb) -> None: + self.stop() + + def track( + self, + sequence: Union[Iterable[ProgressType], Sequence[ProgressType]], + total: int = None, + task_id: Optional[TaskID] = None, + description="Working...", + update_period: float = 0.1, + ) -> Iterable[ProgressType]: + """Track progress by iterating over a sequence. + + Args: + sequence (Sequence[ProgressType]): A sequence of values you want to iterate over and track progress. + total: (int, optional): Total number of steps. Default is len(sequence). + task_id: (TaskID): Task to track. Default is new task. + description: (str, optional): Description of task, if new task is created. + update_period (float, optional): Minimum time (in seconds) between calls to update(). Defaults to 0.1. + + Returns: + Iterable[ProgressType]: An iterable of values taken from the provided sequence. + """ + if total is None: + if isinstance(sequence, Sized): + task_total = len(sequence) + else: + raise ValueError( + f"unable to get size of {sequence!r}, please specify 'total'" + ) + else: + task_total = total + + if task_id is None: + task_id = self.add_task(description, total=task_total) + else: + self.update(task_id, total=task_total) + + if self.auto_refresh: + with _TrackThread(self, task_id, update_period) as track_thread: + for value in sequence: + yield value + track_thread.completed += 1 + else: + advance = self.advance + refresh = self.refresh + for value in sequence: + yield value + advance(task_id, 1) + refresh() + + def start_task(self, task_id: TaskID) -> None: + """Start a task. + + Starts a task (used when calculating elapsed time). You may need to call this manually, + if you called ``add_task`` with ``start=False``. + + Args: + task_id (TaskID): ID of task. + """ + with self._lock: + task = self._tasks[task_id] + if task.start_time is None: + task.start_time = self.get_time() + + def stop_task(self, task_id: TaskID) -> None: + """Stop a task. + + This will freeze the elapsed time on the task. + + Args: + task_id (TaskID): ID of task. + """ + with self._lock: + task = self._tasks[task_id] + current_time = self.get_time() + if task.start_time is None: + task.start_time = current_time + task.stop_time = current_time + + def update( + self, + task_id: TaskID, + *, + total: float = None, + completed: float = None, + advance: float = None, + description: str = None, + visible: bool = None, + refresh: bool = False, + **fields: Any, + ) -> None: + """Update information associated with a task. + + Args: + task_id (TaskID): Task id (returned by add_task). + total (float, optional): Updates task.total if not None. + completed (float, optional): Updates task.completed if not None. + advance (float, optional): Add a value to task.completed if not None. + description (str, optional): Change task description if not None. + visible (bool, optional): Set visible flag if not None. + refresh (bool): Force a refresh of progress information. Default is False. + **fields (Any): Additional data fields required for rendering. + """ + with self._lock: + task = self._tasks[task_id] + completed_start = task.completed + + if total is not None: + task.total = total + task._reset() + if advance is not None: + task.completed += advance + if completed is not None: + task.completed = completed + if description is not None: + task.description = description + if visible is not None: + task.visible = visible + task.fields.update(fields) + update_completed = task.completed - completed_start + + if refresh: + self.refresh() + + current_time = self.get_time() + old_sample_time = current_time - self.speed_estimate_period + _progress = task._progress + + popleft = _progress.popleft + while _progress and _progress[0].timestamp < old_sample_time: + popleft() + while len(_progress) > 1000: + popleft() + if update_completed > 0: + _progress.append(ProgressSample(current_time, update_completed)) + if task.completed >= task.total and task.finished_time is None: + task.finished_time = task.elapsed + + def reset( + self, + task_id: TaskID, + *, + start: bool = True, + total: Optional[int] = None, + completed: int = 0, + visible: Optional[bool] = None, + description: Optional[str] = None, + **fields: Any, + ) -> None: + """Reset a task so completed is 0 and the clock is reset. + + Args: + task_id (TaskID): ID of task. + start (bool, optional): Start the task after reset. Defaults to True. + total (int, optional): New total steps in task, or None to use current total. Defaults to None. + completed (int, optional): Number of steps completed. Defaults to 0. + **fields (str): Additional data fields required for rendering. + """ + current_time = self.get_time() + with self._lock: + task = self._tasks[task_id] + task._reset() + task.start_time = current_time if start else None + if total is not None: + task.total = total + task.completed = completed + if visible is not None: + task.visible = visible + if fields: + task.fields = fields + if description is not None: + task.description = description + task.finished_time = None + self.refresh() + + def advance(self, task_id: TaskID, advance: float = 1) -> None: + """Advance task by a number of steps. + + Args: + task_id (TaskID): ID of task. + advance (float): Number of steps to advance. Default is 1. + """ + current_time = self.get_time() + with self._lock: + task = self._tasks[task_id] + completed_start = task.completed + task.completed += advance + update_completed = task.completed - completed_start + old_sample_time = current_time - self.speed_estimate_period + _progress = task._progress + + popleft = _progress.popleft + while _progress and _progress[0].timestamp < old_sample_time: + popleft() + while len(_progress) > 1000: + popleft() + _progress.append(ProgressSample(current_time, update_completed)) + if task.completed >= task.total and task.finished_time is None: + task.finished_time = task.elapsed + + def refresh(self) -> None: + """Refresh (render) the progress information.""" + if not self.disable: + if self.console.is_jupyter: # pragma: no cover + try: + from IPython.display import display + from ipywidgets import Output + except ImportError: + import warnings + + warnings.warn('install "ipywidgets" for Jupyter support') + else: + with self._lock: + if self.ipy_widget is None: + self.ipy_widget = Output() + display(self.ipy_widget) + + with self.ipy_widget: + self.ipy_widget.clear_output(wait=True) + self.console.print(self.get_renderable()) + + elif self.console.is_terminal and not self.console.is_dumb_terminal: + with self._lock: + self._live_render.set_renderable(self.get_renderable()) + with self.console: + self.console.print(Control("")) + + def get_renderable(self) -> RenderableType: + """Get a renderable for the progress display.""" + renderable = RenderGroup(*self.get_renderables()) + return renderable + + def get_renderables(self) -> Iterable[RenderableType]: + """Get a number of renderables for the progress display.""" + table = self.make_tasks_table(self.tasks) + yield table + + def make_tasks_table(self, tasks: Iterable[Task]) -> Table: + """Get a table to render the Progress display. + + Args: + tasks (Iterable[Task]): An iterable of Task instances, one per row of the table. + + Returns: + Table: A table instance. + """ + + table = Table.grid(padding=(0, 1)) + for _ in self.columns: + table.add_column() + for task in tasks: + if task.visible: + row: List[RenderableType] = [] + append = row.append + for index, column in enumerate(self.columns): + if isinstance(column, str): + append(column.format(task=task)) + table.columns[index].no_wrap = True + else: + widget = column(task) + append(widget) + if isinstance(widget, (str, Text)): + table.columns[index].no_wrap = True + table.add_row(*row) + return table + + def add_task( + self, + description: str, + start: bool = True, + total: int = 100, + completed: int = 0, + visible: bool = True, + **fields: Any, + ) -> TaskID: + """Add a new 'task' to the Progress display. + + Args: + description (str): A description of the task. + start (bool, optional): Start the task immediately (to calculate elapsed time). If set to False, + you will need to call `start` manually. Defaults to True. + total (int, optional): Number of total steps in the progress if know. Defaults to 100. + completed (int, optional): Number of steps completed so far.. Defaults to 0. + visible (bool, optional): Enable display of the task. Defaults to True. + **fields (str): Additional data fields required for rendering. + + Returns: + TaskID: An ID you can use when calling `update`. + """ + with self._lock: + task = Task( + self._task_index, + description, + total, + completed, + visible=visible, + fields=fields, + _get_time=self.get_time, + ) + self._tasks[self._task_index] = task + if start: + self.start_task(self._task_index) + self.refresh() + try: + return self._task_index + finally: + self._task_index = TaskID(int(self._task_index) + 1) + + def remove_task(self, task_id: TaskID) -> None: + """Delete a task if it exists. + + Args: + task_id (TaskID): A task ID. + + """ + with self._lock: + del self._tasks[task_id] + + def process_renderables( + self, renderables: List[ConsoleRenderable] + ) -> List[ConsoleRenderable]: + """Process renderables to restore cursor and display progress.""" + if self.console.is_terminal: + renderables = [ + self._live_render.position_cursor(), + *renderables, + self._live_render, + ] + return renderables + + +if __name__ == "__main__": # pragma: no coverage + + import random + import time + + from .panel import Panel + from .rule import Rule + from .syntax import Syntax + from .table import Table + + syntax = Syntax( + '''def loop_last(values: Iterable[T]) -> Iterable[Tuple[bool, T]]: + """Iterate and generate a tuple with a flag for last value.""" + iter_values = iter(values) + try: + previous_value = next(iter_values) + except StopIteration: + return + for value in iter_values: + yield False, previous_value + previous_value = value + yield True, previous_value''', + "python", + line_numbers=True, + ) + + table = Table("foo", "bar", "baz") + table.add_row("1", "2", "3") + + progress_renderables = [ + "Text may be printed while the progress bars are rendering.", + Panel("In fact, [i]any[/i] renderable will work"), + "Such as [magenta]tables[/]...", + table, + "Pretty printed structures...", + {"type": "example", "text": "Pretty printed"}, + "Syntax...", + syntax, + Rule("Give it a try!"), + ] + + from itertools import cycle + + examples = cycle(progress_renderables) + + console = Console(record=True) + try: + with Progress( + SpinnerColumn(), + TextColumn("[progress.description]{task.description}"), + BarColumn(), + TextColumn("[progress.percentage]{task.percentage:>3.0f}%"), + TimeRemainingColumn(), + TimeElapsedColumn(), + console=console, + transient=True, + ) as progress: + + task1 = progress.add_task("[red]Downloading", total=1000) + task2 = progress.add_task("[green]Processing", total=1000) + task3 = progress.add_task("[yellow]Thinking", total=1000, start=False) + + while not progress.finished: + progress.update(task1, advance=0.5) + progress.update(task2, advance=0.3) + time.sleep(0.01) + if random.randint(0, 100) < 1: + progress.log(next(examples)) + except: + console.save_html("progress.html") + print("wrote progress.html") + raise diff --git a/testbed/Textualize__rich/rich/protocol.py b/testbed/Textualize__rich/rich/protocol.py new file mode 100644 index 0000000000000000000000000000000000000000..6468e5316928608228025551fc1eb802b7476f04 --- /dev/null +++ b/testbed/Textualize__rich/rich/protocol.py @@ -0,0 +1,8 @@ +from typing import Any + +from .abc import RichRenderable + + +def is_renderable(check_object: Any) -> bool: + """Check if an object may be rendered by Rich.""" + return isinstance(check_object, str) or isinstance(check_object, RichRenderable) diff --git a/testbed/Textualize__rich/rich/py.typed b/testbed/Textualize__rich/rich/py.typed new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/testbed/Textualize__rich/rich/themes.py b/testbed/Textualize__rich/rich/themes.py new file mode 100644 index 0000000000000000000000000000000000000000..bf6db104a2c4fd4f3dc699e85f2b262c3d31e9a0 --- /dev/null +++ b/testbed/Textualize__rich/rich/themes.py @@ -0,0 +1,5 @@ +from .default_styles import DEFAULT_STYLES +from .theme import Theme + + +DEFAULT = Theme(DEFAULT_STYLES) diff --git a/testbed/Textualize__rich/setup.py b/testbed/Textualize__rich/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..43a929cc7b202064ad312e88b9168f3e275deb38 --- /dev/null +++ b/testbed/Textualize__rich/setup.py @@ -0,0 +1,8 @@ +#!/usr/bin/env python + +# This is a shim to hopefully allow Github to detect the package, build is done with poetry + +import setuptools + +if __name__ == "__main__": + setuptools.setup(name="rich") diff --git a/testbed/Textualize__rich/tox.ini b/testbed/Textualize__rich/tox.ini new file mode 100644 index 0000000000000000000000000000000000000000..24e44a220365afe83d85c92509af8da02a4260cf --- /dev/null +++ b/testbed/Textualize__rich/tox.ini @@ -0,0 +1,45 @@ +[tox] +minversion = 3.9.0 +envlist = + lint + docs + py{36,37,38,39} +isolated_build = True + +[testenv] +description = Run unit-testing +# develop temporary disabled as project packaging does not work with it yet: +# https://github.com/willmcgugan/rich/issues/345 +usedevelop = False +deps = + -r requirements-dev.txt +# do not put * in passenv as it may break builds due to reduced isolation +passenv = + CI + GITHUB_* + HOME + PYTEST_* + SSH_AUTH_SOCK + TERM +setenv = + PYTHONDONTWRITEBYTECODE=1 + PYTHONUNBUFFERED=1 +commands = + # failsafe as older pip may install incompatible dependencies + pip check + pytest --cov-report term-missing --cov=rich tests/ {posargs} + +[testenv:lint] +description = Runs all linting tasks +commands = + black . + mypy -p rich --ignore-missing-imports --warn-unreachable +skip_install = true + +[testenv:docs] +description = Builds documentation +changedir = docs +deps = + -r docs/requirements.txt +commands = + sphinx-build -M html source build diff --git a/testbed/Textualize__textual/.github/FUNDING.yml b/testbed/Textualize__textual/.github/FUNDING.yml new file mode 100644 index 0000000000000000000000000000000000000000..49163173ca206409c134356b01a19c7a7010d77c --- /dev/null +++ b/testbed/Textualize__textual/.github/FUNDING.yml @@ -0,0 +1,4 @@ +# These are supported funding model platforms + +github: willmcgugan +ko_fi: willmcgugan diff --git a/testbed/Textualize__textual/.github/ISSUE_TEMPLATE/bug_report.md b/testbed/Textualize__textual/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000000000000000000000000000000000000..2f07049913efc45696b14f771b0127018773eeab --- /dev/null +++ b/testbed/Textualize__textual/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,12 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +Textual is currently in active development. I will try to keep the sample functional, but I make no guarantee anything will run right now. + +Unless this is a blatant bug, you might want to open a discussion for now. diff --git a/testbed/Textualize__textual/.github/ISSUE_TEMPLATE/task.md b/testbed/Textualize__textual/.github/ISSUE_TEMPLATE/task.md new file mode 100644 index 0000000000000000000000000000000000000000..91b36de1d901924f4a1fe5a6b4a9b0274670e1da --- /dev/null +++ b/testbed/Textualize__textual/.github/ISSUE_TEMPLATE/task.md @@ -0,0 +1,10 @@ +--- +name: Task +about: An outstanding feature that needs to be implemented +title: '' +labels: '' +assignees: '' + +--- + +To be added by @willmcgugan diff --git a/testbed/Textualize__textual/.github/workflows/comment.yml b/testbed/Textualize__textual/.github/workflows/comment.yml new file mode 100644 index 0000000000000000000000000000000000000000..f465b791d429e3129e37ba4092cabf38b57a4b2b --- /dev/null +++ b/testbed/Textualize__textual/.github/workflows/comment.yml @@ -0,0 +1,22 @@ +name: issues +on: + issues: + types: [closed] +jobs: + add-comment: + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - name: Did I solve your problem? + uses: peter-evans/create-or-update-comment@a35cf36e5301d70b76f316e867e7788a55a31dae + with: + issue-number: ${{ github.event.issue.number }} + body: | + Did I solve your problem? + + Consider [sponsoring my work](https://github.com/sponsors/willmcgugan) on Textual with a monthly donation. + + Or buy me a [coffee](https://ko-fi.com/willmcgugan) to say thanks. + + – [Will McGugan](https://twitter.com/willmcgugan) diff --git a/testbed/Textualize__textual/.github/workflows/pythonpackage.yml b/testbed/Textualize__textual/.github/workflows/pythonpackage.yml new file mode 100644 index 0000000000000000000000000000000000000000..b9edee5e0312bc48d6d8ccd84f0a9d6d839d6165 --- /dev/null +++ b/testbed/Textualize__textual/.github/workflows/pythonpackage.yml @@ -0,0 +1,51 @@ +name: Test Textual module + +on: [pull_request] + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: ["3.7", "3.8", "3.9", "3.10"] + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@v1 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + architecture: x64 + - name: Install and configure Poetry + uses: snok/install-poetry@v1.1.6 + with: + version: 1.1.6 + virtualenvs-in-project: true + - name: Install dependencies + run: poetry install --extras "dev" + if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' + - name: Format check with black + run: | + source $VENV + make format-check +# - name: Typecheck with mypy +# run: | +# source $VENV +# make typecheck + - name: Test with pytest + run: | + source $VENV + pytest tests -v --cov=./src/textual --cov-report=xml:./coverage.xml --cov-report term-missing + - name: Quick e2e smoke test + run: | + source $VENV + python e2e_tests/sandbox_basic_test.py basic 2.0 + - name: Upload snapshot report + if: always() + uses: actions/upload-artifact@v3 + with: + name: snapshot-report-textual + path: tests/snapshot_tests/output/snapshot_report.html diff --git a/testbed/Textualize__textual/docs/events/blur.md b/testbed/Textualize__textual/docs/events/blur.md new file mode 100644 index 0000000000000000000000000000000000000000..067e7bde9dbb7d47747536887ff0799710ac65a6 --- /dev/null +++ b/testbed/Textualize__textual/docs/events/blur.md @@ -0,0 +1,14 @@ +# Blur + +The `Blur` event is sent to a widget when it loses focus. + +- [ ] Bubbles +- [ ] Verbose + +## Attributes + +_No other attributes_ + +## Code + +::: textual.events.Blur diff --git a/testbed/Textualize__textual/docs/events/click.md b/testbed/Textualize__textual/docs/events/click.md new file mode 100644 index 0000000000000000000000000000000000000000..8be36002f540b8ec1bd441ce8951bf51e5f141be --- /dev/null +++ b/testbed/Textualize__textual/docs/events/click.md @@ -0,0 +1,25 @@ +# Click + +The `Click` event is sent to a widget when the user clicks a mouse button. + +- [x] Bubbles +- [ ] Verbose + +## Attributes + +| attribute | type | purpose | +|------------|------|-------------------------------------------| +| `x` | int | Mouse x coordinate, relative to Widget | +| `y` | int | Mouse y coordinate, relative to Widget | +| `delta_x` | int | Change in x since last mouse event | +| `delta_y` | int | Change in y since last mouse event | +| `button` | int | Index of mouse button | +| `shift` | bool | Shift key pressed if True | +| `meta` | bool | Meta key pressed if True | +| `ctrl` | bool | Ctrl key pressed if True | +| `screen_x` | int | Mouse x coordinate relative to the screen | +| `screen_y` | int | Mouse y coordinate relative to the screen | + +## Code + +::: textual.events.Click diff --git a/testbed/Textualize__textual/docs/events/descendant_blur.md b/testbed/Textualize__textual/docs/events/descendant_blur.md new file mode 100644 index 0000000000000000000000000000000000000000..bfe0799f68b1b304fdf6652bbc4a5308ac15fba2 --- /dev/null +++ b/testbed/Textualize__textual/docs/events/descendant_blur.md @@ -0,0 +1,14 @@ +# DescendantBlur + +The `DescendantBlur` event is sent to a widget when one of its children loses focus. + +- [x] Bubbles +- [x] Verbose + +## Attributes + +_No other attributes_ + +## Code + +::: textual.events.DescendantBlur diff --git a/testbed/Textualize__textual/docs/events/descendant_focus.md b/testbed/Textualize__textual/docs/events/descendant_focus.md new file mode 100644 index 0000000000000000000000000000000000000000..9090cd65d4ca4c20b4a67802b46b79696b2fcf21 --- /dev/null +++ b/testbed/Textualize__textual/docs/events/descendant_focus.md @@ -0,0 +1,14 @@ +# DescendantFocus + +The `DescendantFocus` event is sent to a widget when one of its descendants receives focus. + +- [x] Bubbles +- [x] Verbose + +## Attributes + +_No other attributes_ + +## Code + +::: textual.events.DescendantFocus diff --git a/testbed/Textualize__textual/docs/events/enter.md b/testbed/Textualize__textual/docs/events/enter.md new file mode 100644 index 0000000000000000000000000000000000000000..5fbcda7277a7ffb131083a27aa4d3c9ae785fce2 --- /dev/null +++ b/testbed/Textualize__textual/docs/events/enter.md @@ -0,0 +1,14 @@ +# Enter + +The `Enter` event is sent to a widget when the mouse pointer first moves over a widget. + +- [ ] Bubbles +- [x] Verbose + +## Attributes + +_No other attributes_ + +## Code + +::: textual.events.Enter diff --git a/testbed/Textualize__textual/docs/events/focus.md b/testbed/Textualize__textual/docs/events/focus.md new file mode 100644 index 0000000000000000000000000000000000000000..54f4b2a4864da9e02c4f3a935713e0209b20d4c2 --- /dev/null +++ b/testbed/Textualize__textual/docs/events/focus.md @@ -0,0 +1,14 @@ +# Focus + +The `Focus` event is sent to a widget when it receives input focus. + +- [ ] Bubbles +- [ ] Verbose + +## Attributes + +_No other attributes_ + +## Code + +::: textual.events.Focus diff --git a/testbed/Textualize__textual/docs/events/hide.md b/testbed/Textualize__textual/docs/events/hide.md new file mode 100644 index 0000000000000000000000000000000000000000..e4b4d9108aed1b5a8ef1e6814cec7993b387edba --- /dev/null +++ b/testbed/Textualize__textual/docs/events/hide.md @@ -0,0 +1,14 @@ +# Show + +The `Hide` event is sent to a widget when it is hidden from view. + +- [ ] Bubbles +- [ ] Verbose + +## Attributes + +_No additional attributes_ + +## Code + +::: textual.events.Hide diff --git a/testbed/Textualize__textual/docs/events/index.md b/testbed/Textualize__textual/docs/events/index.md new file mode 100644 index 0000000000000000000000000000000000000000..5b3430c34e7b4799cefbee336f1fd28a4cec47ba --- /dev/null +++ b/testbed/Textualize__textual/docs/events/index.md @@ -0,0 +1,3 @@ +# Events + +A reference to Textual [events](../guide/events.md). diff --git a/testbed/Textualize__textual/docs/events/key.md b/testbed/Textualize__textual/docs/events/key.md new file mode 100644 index 0000000000000000000000000000000000000000..ae7e33250b6c4ece30ad04b9e07eb4e050f26be8 --- /dev/null +++ b/testbed/Textualize__textual/docs/events/key.md @@ -0,0 +1,17 @@ +# Key + +The `Key` event is sent to a widget when the user presses a key on the keyboard. + +- [x] Bubbles +- [ ] Verbose + +## Attributes + +| attribute | type | purpose | +| --------- | ----------- | ----------------------------------------------------------- | +| `key` | str | Name of the key that was pressed. | +| `char` | str or None | The character that was pressed, or None it isn't printable. | + +## Code + +::: textual.events.Key diff --git a/testbed/Textualize__textual/docs/events/leave.md b/testbed/Textualize__textual/docs/events/leave.md new file mode 100644 index 0000000000000000000000000000000000000000..5a72463a972aa1c8f575a41ee7bb9b59e710f1e9 --- /dev/null +++ b/testbed/Textualize__textual/docs/events/leave.md @@ -0,0 +1,14 @@ +# Leave + +The `Leave` event is sent to a widget when the mouse pointer moves off a widget. + +- [ ] Bubbles +- [x] Verbose + +## Attributes + +_No other attributes_ + +## Code + +::: textual.events.Leave diff --git a/testbed/Textualize__textual/docs/events/load.md b/testbed/Textualize__textual/docs/events/load.md new file mode 100644 index 0000000000000000000000000000000000000000..2702a790627b22fa17ec43f8d0264ea25f517e89 --- /dev/null +++ b/testbed/Textualize__textual/docs/events/load.md @@ -0,0 +1,16 @@ +# Load + +The `Load` event is sent to the app prior to switching the terminal to application mode. + +The load event is typically used to do any setup actions required by the app that don't change the display. + +- [ ] Bubbles +- [ ] Verbose + +## Attributes + +_No additional attributes_ + +## Code + +::: textual.events.Load diff --git a/testbed/Textualize__textual/docs/events/mount.md b/testbed/Textualize__textual/docs/events/mount.md new file mode 100644 index 0000000000000000000000000000000000000000..1b2377b77c93d2bddf4db9418eee70a90a0b4ed6 --- /dev/null +++ b/testbed/Textualize__textual/docs/events/mount.md @@ -0,0 +1,16 @@ +# Mount + +The `Mount` event is sent to a widget and Application when it is first mounted. + +The mount event is typically used to set the initial state of a widget or to add new children widgets. + +- [ ] Bubbles +- [x] Verbose + +## Attributes + +_No additional attributes_ + +## Code + +::: textual.events.Mount diff --git a/testbed/Textualize__textual/docs/events/mouse_capture.md b/testbed/Textualize__textual/docs/events/mouse_capture.md new file mode 100644 index 0000000000000000000000000000000000000000..167478636fb55346343b976fbb014f7578fbb9bc --- /dev/null +++ b/testbed/Textualize__textual/docs/events/mouse_capture.md @@ -0,0 +1,16 @@ +# MouseCapture + +The `MouseCapture` event is sent to a widget when it is capturing mouse events from outside of its borders on the screen. + +- [ ] Bubbles +- [ ] Verbose + +## Attributes + +| attribute | type | purpose | +| ---------------- | ------ | --------------------------------------------- | +| `mouse_position` | Offset | Mouse coordinates when the mouse was captured | + +## Code + +::: textual.events.MouseCapture diff --git a/testbed/Textualize__textual/docs/events/mouse_down.md b/testbed/Textualize__textual/docs/events/mouse_down.md new file mode 100644 index 0000000000000000000000000000000000000000..69ed3ca2fd9cafb0ad92cebfd99cc47a5bc88cc9 --- /dev/null +++ b/testbed/Textualize__textual/docs/events/mouse_down.md @@ -0,0 +1,25 @@ +# MouseDown + +The `MouseDown` event is sent to a widget when a mouse button is pressed. + +- [x] Bubbles +- [x] Verbose + +## Attributes + +| attribute | type | purpose | +| ---------- | ---- | ----------------------------------------- | +| `x` | int | Mouse x coordinate, relative to Widget | +| `y` | int | Mouse y coordinate, relative to Widget | +| `delta_x` | int | Change in x since last mouse event | +| `delta_y` | int | Change in y since last mouse event | +| `button` | int | Index of mouse button | +| `shift` | bool | Shift key pressed if True | +| `meta` | bool | Meta key pressed if True | +| `ctrl` | bool | Ctrl key pressed if True | +| `screen_x` | int | Mouse x coordinate relative to the screen | +| `screen_y` | int | Mouse y coordinate relative to the screen | + +## Code + +::: textual.events.MouseDown diff --git a/testbed/Textualize__textual/docs/events/mouse_move.md b/testbed/Textualize__textual/docs/events/mouse_move.md new file mode 100644 index 0000000000000000000000000000000000000000..12cdca5f9a40f652a86c3d5b7ad04a89f7c4c2f3 --- /dev/null +++ b/testbed/Textualize__textual/docs/events/mouse_move.md @@ -0,0 +1,25 @@ +# MouseMove + +The `MouseMove` event is sent to a widget when the mouse pointer is moved over a widget. + +- [ ] Bubbles +- [x] Verbose + +## Attributes + +| attribute | type | purpose | +|------------|------|-------------------------------------------| +| `x` | int | Mouse x coordinate, relative to Widget | +| `y` | int | Mouse y coordinate, relative to Widget | +| `delta_x` | int | Change in x since last mouse event | +| `delta_y` | int | Change in y since last mouse event | +| `button` | int | Index of mouse button | +| `shift` | bool | Shift key pressed if True | +| `meta` | bool | Meta key pressed if True | +| `ctrl` | bool | Ctrl key pressed if True | +| `screen_x` | int | Mouse x coordinate relative to the screen | +| `screen_y` | int | Mouse y coordinate relative to the screen | + +## Code + +::: textual.events.MouseMove diff --git a/testbed/Textualize__textual/docs/events/mouse_release.md b/testbed/Textualize__textual/docs/events/mouse_release.md new file mode 100644 index 0000000000000000000000000000000000000000..89d1fe4ed1de34bf2c3ebc28929cfb80b7d30cea --- /dev/null +++ b/testbed/Textualize__textual/docs/events/mouse_release.md @@ -0,0 +1,16 @@ +# MouseRelease + +The `MouseRelease` event is sent to a widget when it is no longer receiving mouse events outside of its borders. + +- [ ] Bubbles +- [ ] Verbose + +## Attributes + +| attribute | type | purpose | +|------------------|--------|-----------------------------------------------| +| `mouse_position` | Offset | Mouse coordinates when the mouse was released | + +## Code + +::: textual.events.MouseRelease diff --git a/testbed/Textualize__textual/docs/events/mouse_scroll_down.md b/testbed/Textualize__textual/docs/events/mouse_scroll_down.md new file mode 100644 index 0000000000000000000000000000000000000000..7228cc0bbaa806d202c3d1ef86a93fe7597fdaf1 --- /dev/null +++ b/testbed/Textualize__textual/docs/events/mouse_scroll_down.md @@ -0,0 +1,17 @@ +# MouseScrollDown + +The `MouseScrollDown` event is sent to a widget when the scroll wheel (or trackpad equivalent) is moved _down_. + +- [x] Bubbles +- [x] Verbose + +## Attributes + +| attribute | type | purpose | +|-----------|------|----------------------------------------| +| `x` | int | Mouse x coordinate, relative to Widget | +| `y` | int | Mouse y coordinate, relative to Widget | + +## Code + +::: textual.events.MouseScrollDown diff --git a/testbed/Textualize__textual/docs/events/mouse_scroll_up.md b/testbed/Textualize__textual/docs/events/mouse_scroll_up.md new file mode 100644 index 0000000000000000000000000000000000000000..2114b5f4108876b5148b0213541cf6f96f08cbd9 --- /dev/null +++ b/testbed/Textualize__textual/docs/events/mouse_scroll_up.md @@ -0,0 +1,17 @@ +# MouseScrollUp + +The `MouseScrollUp` event is sent to a widget when the scroll wheel (or trackpad equivalent) is moved _up_. + +- [x] Bubbles +- [x] Verbose + +## Attributes + +| attribute | type | purpose | +|-----------|------|----------------------------------------| +| `x` | int | Mouse x coordinate, relative to Widget | +| `y` | int | Mouse y coordinate, relative to Widget | + +## Code + +::: textual.events.MouseScrollUp diff --git a/testbed/Textualize__textual/docs/events/mouse_up.md b/testbed/Textualize__textual/docs/events/mouse_up.md new file mode 100644 index 0000000000000000000000000000000000000000..5b965132e8b1df876149253fb9d0607f3bd7c8c7 --- /dev/null +++ b/testbed/Textualize__textual/docs/events/mouse_up.md @@ -0,0 +1,25 @@ +# MouseUp + +The `MouseUp` event is sent to a widget when the user releases a mouse button. + +- [x] Bubbles +- [x] Verbose + +## Attributes + +| attribute | type | purpose | +|------------|------|-------------------------------------------| +| `x` | int | Mouse x coordinate, relative to Widget | +| `y` | int | Mouse y coordinate, relative to Widget | +| `delta_x` | int | Change in x since last mouse event | +| `delta_y` | int | Change in y since last mouse event | +| `button` | int | Index of mouse button | +| `shift` | bool | Shift key pressed if True | +| `meta` | bool | Meta key pressed if True | +| `ctrl` | bool | Ctrl key pressed if True | +| `screen_x` | int | Mouse x coordinate relative to the screen | +| `screen_y` | int | Mouse y coordinate relative to the screen | + +## Code + +::: textual.events.MouseUp diff --git a/testbed/Textualize__textual/docs/events/paste.md b/testbed/Textualize__textual/docs/events/paste.md new file mode 100644 index 0000000000000000000000000000000000000000..fdae43e5ccd4995d26205531684de7026eee7a48 --- /dev/null +++ b/testbed/Textualize__textual/docs/events/paste.md @@ -0,0 +1,16 @@ +# Paste + +The `Paste` event is sent to a widget when the user pastes text. + +- [ ] Bubbles +- [ ] Verbose + +## Attributes + +| attribute | type | purpose | +|-----------|------|--------------------------| +| `text` | str | The text that was pasted | + +## Code + +::: textual.events.Paste diff --git a/testbed/Textualize__textual/docs/events/resize.md b/testbed/Textualize__textual/docs/events/resize.md new file mode 100644 index 0000000000000000000000000000000000000000..2ffe554afa14e378d990e827374529300e55d1de --- /dev/null +++ b/testbed/Textualize__textual/docs/events/resize.md @@ -0,0 +1,18 @@ +# Resize + +The `Resize` event is sent to a widget when its size changes and when it is first made visible. + +- [x] Bubbles +- [ ] Verbose + +## Attributes + +| attribute | type | purpose | +|------------------|------|--------------------------------------------------| +| `size` | Size | The new size of the Widget | +| `virtual_size` | Size | The virtual size (scrollable area) of the Widget | +| `container_size` | Size | The size of the container (parent widget) | + +## Code + +::: textual.events.Resize diff --git a/testbed/Textualize__textual/docs/events/screen_resume.md b/testbed/Textualize__textual/docs/events/screen_resume.md new file mode 100644 index 0000000000000000000000000000000000000000..4852149a19647bdb0b1081ac55146fc3bc4cb9eb --- /dev/null +++ b/testbed/Textualize__textual/docs/events/screen_resume.md @@ -0,0 +1,14 @@ +# ScreenResume + +The `ScreenResume` event is sent to a **Screen** when it becomes current. + +- [ ] Bubbles +- [ ] Verbose + +## Attributes + +_No other attributes_ + +## Code + +::: textual.events.ScreenResume diff --git a/testbed/Textualize__textual/docs/events/screen_suspend.md b/testbed/Textualize__textual/docs/events/screen_suspend.md new file mode 100644 index 0000000000000000000000000000000000000000..b716832eddf532a7109107a213d90af422952e04 --- /dev/null +++ b/testbed/Textualize__textual/docs/events/screen_suspend.md @@ -0,0 +1,14 @@ +# ScreenSuspend + +The `ScreenSuspend` event is sent to a **Screen** when it is replaced by another screen. + +- [ ] Bubbles +- [ ] Verbose + +## Attributes + +_No other attributes_ + +## Code + +::: textual.events.ScreenSuspend diff --git a/testbed/Textualize__textual/docs/events/show.md b/testbed/Textualize__textual/docs/events/show.md new file mode 100644 index 0000000000000000000000000000000000000000..b669430ccdf8ccb33c1d757a12663f37a62b357a --- /dev/null +++ b/testbed/Textualize__textual/docs/events/show.md @@ -0,0 +1,14 @@ +# Show + +The `Show` event is sent to a widget when it becomes visible. + +- [ ] Bubbles +- [ ] Verbose + +## Attributes + +_No additional attributes_ + +## Code + +::: textual.events.Show diff --git a/testbed/Textualize__textual/docs/examples/app/event01.py b/testbed/Textualize__textual/docs/examples/app/event01.py new file mode 100644 index 0000000000000000000000000000000000000000..0f3bc3cdca177e0ffedfd5f6ffd896ebd90abc2c --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/app/event01.py @@ -0,0 +1,30 @@ +from textual.app import App +from textual import events + + +class EventApp(App): + + COLORS = [ + "white", + "maroon", + "red", + "purple", + "fuchsia", + "olive", + "yellow", + "navy", + "teal", + "aqua", + ] + + def on_mount(self) -> None: + self.screen.styles.background = "darkblue" + + def on_key(self, event: events.Key) -> None: + if event.key.isdecimal(): + self.screen.styles.background = self.COLORS[int(event.key)] + + +if __name__ == "__main__": + app = EventApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/app/question01.py b/testbed/Textualize__textual/docs/examples/app/question01.py new file mode 100644 index 0000000000000000000000000000000000000000..e61fba393edb42cee140ed36724b07e171001365 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/app/question01.py @@ -0,0 +1,18 @@ +from textual.app import App, ComposeResult +from textual.widgets import Static, Button + + +class QuestionApp(App[str]): + def compose(self) -> ComposeResult: + yield Static("Do you love Textual?") + yield Button("Yes", id="yes", variant="primary") + yield Button("No", id="no", variant="error") + + def on_button_pressed(self, event: Button.Pressed) -> None: + self.exit(event.button.id) + + +if __name__ == "__main__": + app = QuestionApp() + reply = app.run() + print(reply) diff --git a/testbed/Textualize__textual/docs/examples/app/question02.css b/testbed/Textualize__textual/docs/examples/app/question02.css new file mode 100644 index 0000000000000000000000000000000000000000..1f1a3b84bd5d80420f14b99dc6bc6614f410f634 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/app/question02.css @@ -0,0 +1,17 @@ +Screen { + layout: grid; + grid-size: 2; + grid-gutter: 2; + padding: 2; +} +#question { + width: 100%; + height: 100%; + column-span: 2; + content-align: center bottom; + text-style: bold; +} + +Button { + width: 100%; +} diff --git a/testbed/Textualize__textual/docs/examples/app/question02.py b/testbed/Textualize__textual/docs/examples/app/question02.py new file mode 100644 index 0000000000000000000000000000000000000000..36b23722b7a40be8002fefab5c1a0750aacd833c --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/app/question02.py @@ -0,0 +1,20 @@ +from textual.app import App, ComposeResult +from textual.widgets import Static, Button + + +class QuestionApp(App[str]): + CSS_PATH = "question02.css" + + def compose(self) -> ComposeResult: + yield Static("Do you love Textual?", id="question") + yield Button("Yes", id="yes", variant="primary") + yield Button("No", id="no", variant="error") + + def on_button_pressed(self, event: Button.Pressed) -> None: + self.exit(event.button.id) + + +if __name__ == "__main__": + app = QuestionApp() + reply = app.run() + print(reply) diff --git a/testbed/Textualize__textual/docs/examples/app/question03.py b/testbed/Textualize__textual/docs/examples/app/question03.py new file mode 100644 index 0000000000000000000000000000000000000000..777e5a9ebb4fa3c47db6f2157576a7dfdac1b224 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/app/question03.py @@ -0,0 +1,38 @@ +from textual.app import App, ComposeResult +from textual.widgets import Static, Button + + +class QuestionApp(App[str]): + CSS = """ + Screen { + layout: grid; + grid-size: 2; + grid-gutter: 2; + padding: 2; + } + #question { + width: 100%; + height: 100%; + column-span: 2; + content-align: center bottom; + text-style: bold; + } + + Button { + width: 100%; + } + """ + + def compose(self) -> ComposeResult: + yield Static("Do you love Textual?", id="question") + yield Button("Yes", id="yes", variant="primary") + yield Button("No", id="no", variant="error") + + def on_button_pressed(self, event: Button.Pressed) -> None: + self.exit(event.button.id) + + +if __name__ == "__main__": + app = QuestionApp() + reply = app.run() + print(reply) diff --git a/testbed/Textualize__textual/docs/examples/app/simple01.py b/testbed/Textualize__textual/docs/examples/app/simple01.py new file mode 100644 index 0000000000000000000000000000000000000000..03a13218e8e0fb05c22ca57e0d66a220b7786f23 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/app/simple01.py @@ -0,0 +1,5 @@ +from textual.app import App + + +class MyApp(App): + pass diff --git a/testbed/Textualize__textual/docs/examples/app/simple02.py b/testbed/Textualize__textual/docs/examples/app/simple02.py new file mode 100644 index 0000000000000000000000000000000000000000..e087ac2d20a61cb5cd3be605c5e46b6f72627685 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/app/simple02.py @@ -0,0 +1,10 @@ +from textual.app import App + + +class MyApp(App): + pass + + +if __name__ == "__main__": + app = MyApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/app/widgets01.py b/testbed/Textualize__textual/docs/examples/app/widgets01.py new file mode 100644 index 0000000000000000000000000000000000000000..c8abd8f4825ba16fe0a6a2e53facf7e0cbbb4a80 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/app/widgets01.py @@ -0,0 +1,15 @@ +from textual.app import App, ComposeResult +from textual.widgets import Welcome + + +class WelcomeApp(App): + def compose(self) -> ComposeResult: + yield Welcome() + + def on_button_pressed(self) -> None: + self.exit() + + +if __name__ == "__main__": + app = WelcomeApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/app/widgets02.py b/testbed/Textualize__textual/docs/examples/app/widgets02.py new file mode 100644 index 0000000000000000000000000000000000000000..43a3bf047b7caffdae3fbe39ae7ae520feaf3f12 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/app/widgets02.py @@ -0,0 +1,15 @@ +from textual.app import App +from textual.widgets import Welcome + + +class WelcomeApp(App): + def on_key(self) -> None: + self.mount(Welcome()) + + def on_button_pressed(self) -> None: + self.exit() + + +if __name__ == "__main__": + app = WelcomeApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/events/custom01.py b/testbed/Textualize__textual/docs/examples/events/custom01.py new file mode 100644 index 0000000000000000000000000000000000000000..043b32ffc2088232b3ca6630da1e266c4abdcc73 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/events/custom01.py @@ -0,0 +1,48 @@ +from textual.app import App, ComposeResult +from textual.color import Color +from textual.message import Message, MessageTarget +from textual.widgets import Static + + +class ColorButton(Static): + """A color button.""" + + class Selected(Message): + """Color selected message.""" + + def __init__(self, sender: MessageTarget, color: Color) -> None: + self.color = color + super().__init__(sender) + + def __init__(self, color: Color) -> None: + self.color = color + super().__init__() + + def on_mount(self) -> None: + self.styles.margin = (1, 2) + self.styles.content_align = ("center", "middle") + self.styles.background = Color.parse("#ffffff33") + self.styles.border = ("tall", self.color) + + async def on_click(self) -> None: + # The emit method sends an event to a widget's parent + await self.emit(self.Selected(self, self.color)) + + def render(self) -> str: + return str(self.color) + + +class ColorApp(App): + def compose(self) -> ComposeResult: + yield ColorButton(Color.parse("#008080")) + yield ColorButton(Color.parse("#808000")) + yield ColorButton(Color.parse("#E9967A")) + yield ColorButton(Color.parse("#121212")) + + def on_color_button_selected(self, message: ColorButton.Selected) -> None: + self.screen.styles.animate("background", message.color, duration=0.5) + + +if __name__ == "__main__": + app = ColorApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/events/dictionary.css b/testbed/Textualize__textual/docs/examples/events/dictionary.css new file mode 100644 index 0000000000000000000000000000000000000000..9b5e489adb383d5ee001d3c28193c907e7c69d8f --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/events/dictionary.css @@ -0,0 +1,23 @@ +Screen { + background: $panel; +} + +Input { + dock: top; + width: 100%; + height: 1; + padding: 0 1; + margin: 1 1 0 1; +} + +#results { + width: auto; + min-height: 100%; +} + +#results-container { + background: $background 50%; + overflow: auto; + margin: 1 2; + height: 100%; +} diff --git a/testbed/Textualize__textual/docs/examples/events/dictionary.py b/testbed/Textualize__textual/docs/examples/events/dictionary.py new file mode 100644 index 0000000000000000000000000000000000000000..24544c39e8dfdadd8df9f0bea247be00d5ffe269 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/events/dictionary.py @@ -0,0 +1,44 @@ +import asyncio + +try: + import httpx +except ImportError: + raise ImportError("Please install httpx with 'pip install httpx' ") + +from rich.json import JSON +from textual.app import App, ComposeResult +from textual.containers import Vertical +from textual.widgets import Static, Input + + +class DictionaryApp(App): + """Searches ab dictionary API as-you-type.""" + + CSS_PATH = "dictionary.css" + + def compose(self) -> ComposeResult: + yield Input(placeholder="Search for a word") + yield Vertical(Static(id="results"), id="results-container") + + async def on_input_changed(self, message: Input.Changed) -> None: + """A coroutine to handle a text changed message.""" + if message.value: + # Look up the word in the background + asyncio.create_task(self.lookup_word(message.value)) + else: + # Clear the results + self.query_one("#results", Static).update() + + async def lookup_word(self, word: str) -> None: + """Looks up a word.""" + url = f"https://api.dictionaryapi.dev/api/v2/entries/en/{word}" + async with httpx.AsyncClient() as client: + results = (await client.get(url)).text + + if word == self.query_one(Input).value: + self.query_one("#results", Static).update(JSON(results)) + + +if __name__ == "__main__": + app = DictionaryApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/getting_started/console.py b/testbed/Textualize__textual/docs/examples/getting_started/console.py new file mode 100644 index 0000000000000000000000000000000000000000..051632d9f07a846b52696b07dcef32f44a17bc95 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/getting_started/console.py @@ -0,0 +1,18 @@ +""" +Simulates a screenshot of the Textual devtools + +""" + +from textual.app import App + +from textual.devtools.renderables import DevConsoleHeader +from textual.widgets import Static + + +class ConsoleApp(App): + def compose(self): + self.dark = True + yield Static(DevConsoleHeader()) + + +app = ConsoleApp() diff --git a/testbed/Textualize__textual/docs/examples/guide/actions/actions01.py b/testbed/Textualize__textual/docs/examples/guide/actions/actions01.py new file mode 100644 index 0000000000000000000000000000000000000000..03d83530ef529349461ff9234bbc35cce6d95556 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/actions/actions01.py @@ -0,0 +1,17 @@ +from textual.app import App +from textual import events + + +class ActionsApp(App): + def action_set_background(self, color: str) -> None: + self.screen.styles.background = color + self.bell() + + def on_key(self, event: events.Key) -> None: + if event.key == "r": + self.action_set_background("red") + + +if __name__ == "__main__": + app = ActionsApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/actions/actions02.py b/testbed/Textualize__textual/docs/examples/guide/actions/actions02.py new file mode 100644 index 0000000000000000000000000000000000000000..b322b6aa880838e226640e3d97ba77865f005fca --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/actions/actions02.py @@ -0,0 +1,17 @@ +from textual.app import App +from textual import events + + +class ActionsApp(App): + def action_set_background(self, color: str) -> None: + self.screen.styles.background = color + self.bell() + + async def on_key(self, event: events.Key) -> None: + if event.key == "r": + await self.action("set_background('red')") + + +if __name__ == "__main__": + app = ActionsApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/actions/actions03.py b/testbed/Textualize__textual/docs/examples/guide/actions/actions03.py new file mode 100644 index 0000000000000000000000000000000000000000..22ccf57aaee270d3ac8bd768c39bd85ad01b4586 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/actions/actions03.py @@ -0,0 +1,23 @@ +from textual.app import App, ComposeResult +from textual.widgets import Static + +TEXT = """ +[b]Set your background[/b] +[@click=set_background('red')]Red[/] +[@click=set_background('green')]Green[/] +[@click=set_background('blue')]Blue[/] +""" + + +class ActionsApp(App): + def compose(self) -> ComposeResult: + yield Static(TEXT) + + def action_set_background(self, color: str) -> None: + self.screen.styles.background = color + self.bell() + + +if __name__ == "__main__": + app = ActionsApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/actions/actions04.py b/testbed/Textualize__textual/docs/examples/guide/actions/actions04.py new file mode 100644 index 0000000000000000000000000000000000000000..6a1ac9d466f676627c17af4efff8a3366e622856 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/actions/actions04.py @@ -0,0 +1,29 @@ +from textual.app import App, ComposeResult +from textual.widgets import Static + +TEXT = """ +[b]Set your background[/b] +[@click=set_background('red')]Red[/] +[@click=set_background('green')]Green[/] +[@click=set_background('blue')]Blue[/] +""" + + +class ActionsApp(App): + BINDINGS = [ + ("r", "set_background('red')", "Red"), + ("g", "set_background('green')", "Green"), + ("b", "set_background('blue')", "Blue"), + ] + + def compose(self) -> ComposeResult: + yield Static(TEXT) + + def action_set_background(self, color: str) -> None: + self.screen.styles.background = color + self.bell() + + +if __name__ == "__main__": + app = ActionsApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/actions/actions05.css b/testbed/Textualize__textual/docs/examples/guide/actions/actions05.css new file mode 100644 index 0000000000000000000000000000000000000000..3306d8a8833d5b453f1ba3545175a7aa7f1a1135 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/actions/actions05.css @@ -0,0 +1,11 @@ +Screen { + layout: grid; + grid-size: 1; + grid-gutter: 2 4; + grid-rows: 1fr; +} + +ColorSwitcher { + height: 100%; + margin: 2 4; +} diff --git a/testbed/Textualize__textual/docs/examples/guide/actions/actions05.py b/testbed/Textualize__textual/docs/examples/guide/actions/actions05.py new file mode 100644 index 0000000000000000000000000000000000000000..a73ccfd21ad6bbabccb2e2954eab6a5c048379a3 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/actions/actions05.py @@ -0,0 +1,36 @@ +from textual.app import App, ComposeResult +from textual.widgets import Static + +TEXT = """ +[b]Set your background[/b] +[@click=set_background('cyan')]Cyan[/] +[@click=set_background('magenta')]Magenta[/] +[@click=set_background('yellow')]Yellow[/] +""" + + +class ColorSwitcher(Static): + def action_set_background(self, color: str) -> None: + self.styles.background = color + + +class ActionsApp(App): + CSS_PATH = "actions05.css" + BINDINGS = [ + ("r", "set_background('red')", "Red"), + ("g", "set_background('green')", "Green"), + ("b", "set_background('blue')", "Blue"), + ] + + def compose(self) -> ComposeResult: + yield ColorSwitcher(TEXT) + yield ColorSwitcher(TEXT) + + def action_set_background(self, color: str) -> None: + self.screen.styles.background = color + self.bell() + + +if __name__ == "__main__": + app = ActionsApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/animator/animation01.py b/testbed/Textualize__textual/docs/examples/guide/animator/animation01.py new file mode 100644 index 0000000000000000000000000000000000000000..d4a5047263ecd4d00e355ebcd7e074a96b39dd15 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/animator/animation01.py @@ -0,0 +1,19 @@ +from textual.app import App, ComposeResult +from textual.widgets import Static + + +class AnimationApp(App): + def compose(self) -> ComposeResult: + self.box = Static("Hello, World!") + self.box.styles.background = "red" + self.box.styles.color = "black" + self.box.styles.padding = (1, 2) + yield self.box + + def on_mount(self): + self.box.styles.animate("opacity", value=0.0, duration=2.0) + + +if __name__ == "__main__": + app = AnimationApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/animator/animation01_static.py b/testbed/Textualize__textual/docs/examples/guide/animator/animation01_static.py new file mode 100644 index 0000000000000000000000000000000000000000..fde4b6e621f5a09a749bab7177d0d76b880fb9f5 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/animator/animation01_static.py @@ -0,0 +1,16 @@ +from textual.app import App, ComposeResult +from textual.widgets import Static + + +class AnimationApp(App): + def compose(self) -> ComposeResult: + self.box = Static("Hello, World!") + self.box.styles.background = "red" + self.box.styles.color = "black" + self.box.styles.padding = (1, 2) + yield self.box + + +if __name__ == "__main__": + app = AnimationApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/dom1.py b/testbed/Textualize__textual/docs/examples/guide/dom1.py new file mode 100644 index 0000000000000000000000000000000000000000..b45ebdb8c7b9bffd7ba4d60c41e7ad583bb33b77 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/dom1.py @@ -0,0 +1,10 @@ +from textual.app import App + + +class ExampleApp(App): + pass + + +if __name__ == "__main__": + app = ExampleApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/dom2.py b/testbed/Textualize__textual/docs/examples/guide/dom2.py new file mode 100644 index 0000000000000000000000000000000000000000..35b670327855ae4aca200e742d49bd0a36544674 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/dom2.py @@ -0,0 +1,13 @@ +from textual.app import App, ComposeResult +from textual.widgets import Header, Footer + + +class ExampleApp(App): + def compose(self) -> ComposeResult: + yield Header() + yield Footer() + + +if __name__ == "__main__": + app = ExampleApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/dom3.py b/testbed/Textualize__textual/docs/examples/guide/dom3.py new file mode 100644 index 0000000000000000000000000000000000000000..bd68f24b47ca453556d00754a6c87bfb9b97c5d2 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/dom3.py @@ -0,0 +1,25 @@ +from textual.app import App, ComposeResult +from textual.containers import Container, Horizontal +from textual.widgets import Button, Footer, Header, Static + +QUESTION = "Do you want to learn about Textual CSS?" + + +class ExampleApp(App): + def compose(self) -> ComposeResult: + yield Header() + yield Footer() + yield Container( + Static(QUESTION, classes="question"), + Horizontal( + Button("Yes", variant="success"), + Button("No", variant="error"), + classes="buttons", + ), + id="dialog", + ) + + +if __name__ == "__main__": + app = ExampleApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/dom4.css b/testbed/Textualize__textual/docs/examples/guide/dom4.css new file mode 100644 index 0000000000000000000000000000000000000000..d9169ee17861aab9fffb9333adb8b93b51300f3d --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/dom4.css @@ -0,0 +1,30 @@ + +/* The top level dialog (a Container) */ +#dialog { + margin: 4 8; + background: $panel; + color: $text; + border: tall $background; + padding: 1 2; +} + +/* The button class */ +Button { + width: 1fr; +} + +/* Matches the question text */ +.question { + text-style: bold; + height: 100%; + content-align: center middle; +} + +/* Matches the button container */ +.buttons { + width: 100%; + height: auto; + dock: bottom; +} + + diff --git a/testbed/Textualize__textual/docs/examples/guide/dom4.py b/testbed/Textualize__textual/docs/examples/guide/dom4.py new file mode 100644 index 0000000000000000000000000000000000000000..3191138d4c80e7b9fbddd841a674101d2d4fb047 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/dom4.py @@ -0,0 +1,27 @@ +from textual.app import App, ComposeResult +from textual.containers import Container, Horizontal +from textual.widgets import Header, Footer, Static, Button + +QUESTION = "Do you want to learn about Textual CSS?" + + +class ExampleApp(App): + CSS_PATH = "dom4.css" + + def compose(self) -> ComposeResult: + yield Header() + yield Footer() + yield Container( + Static(QUESTION, classes="question"), + Horizontal( + Button("Yes", variant="success"), + Button("No", variant="error"), + classes="buttons", + ), + id="dialog", + ) + + +if __name__ == "__main__": + app = ExampleApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/input/binding01.css b/testbed/Textualize__textual/docs/examples/guide/input/binding01.css new file mode 100644 index 0000000000000000000000000000000000000000..9c8b6390fd6034faef96847b72dbe06300b634e6 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/input/binding01.css @@ -0,0 +1,7 @@ +Bar { + height: 5; + content-align: center middle; + text-style: bold; + margin: 1 2; + color: $text; +} diff --git a/testbed/Textualize__textual/docs/examples/guide/input/binding01.py b/testbed/Textualize__textual/docs/examples/guide/input/binding01.py new file mode 100644 index 0000000000000000000000000000000000000000..12711f6376c3cf32834e2c6385496ed5ec3e7517 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/input/binding01.py @@ -0,0 +1,31 @@ +from textual.app import App, ComposeResult +from textual.color import Color +from textual.widgets import Footer, Static + + +class Bar(Static): + pass + + +class BindingApp(App): + + CSS_PATH = "binding01.css" + BINDINGS = [ + ("r", "add_bar('red')", "Add Red"), + ("g", "add_bar('green')", "Add Green"), + ("b", "add_bar('blue')", "Add Blue"), + ] + + def compose(self) -> ComposeResult: + yield Footer() + + def action_add_bar(self, color: str) -> None: + bar = Bar(color) + bar.styles.background = Color.parse(color).with_alpha(0.5) + self.mount(bar) + self.call_later(self.screen.scroll_end, animate=False) + + +if __name__ == "__main__": + app = BindingApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/input/key01.py b/testbed/Textualize__textual/docs/examples/guide/input/key01.py new file mode 100644 index 0000000000000000000000000000000000000000..c04a7cd269ae5bc4d2fc879f7ef3b3be9c3615a5 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/input/key01.py @@ -0,0 +1,21 @@ +from textual.app import App, ComposeResult +from textual.widgets import TextLog +from textual import events + + +class InputApp(App): + """App to display key events.""" + + def compose(self) -> ComposeResult: + yield TextLog() + + def on_key(self, event: events.Key) -> None: + self.query_one(TextLog).write(event) + + def key_space(self) -> None: + self.bell() + + +if __name__ == "__main__": + app = InputApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/input/key02.py b/testbed/Textualize__textual/docs/examples/guide/input/key02.py new file mode 100644 index 0000000000000000000000000000000000000000..c04a7cd269ae5bc4d2fc879f7ef3b3be9c3615a5 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/input/key02.py @@ -0,0 +1,21 @@ +from textual.app import App, ComposeResult +from textual.widgets import TextLog +from textual import events + + +class InputApp(App): + """App to display key events.""" + + def compose(self) -> ComposeResult: + yield TextLog() + + def on_key(self, event: events.Key) -> None: + self.query_one(TextLog).write(event) + + def key_space(self) -> None: + self.bell() + + +if __name__ == "__main__": + app = InputApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/input/key03.css b/testbed/Textualize__textual/docs/examples/guide/input/key03.css new file mode 100644 index 0000000000000000000000000000000000000000..601612492e463c8883e3a14f9fa6f04b5b287b5d --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/input/key03.css @@ -0,0 +1,17 @@ +Screen { + layout: grid; + grid-size: 2 2; + grid-columns: 1fr; +} + +KeyLogger { + border: blank; +} + +KeyLogger:hover { + border: wide $secondary; +} + +KeyLogger:focus { + border: wide $accent; +} diff --git a/testbed/Textualize__textual/docs/examples/guide/input/key03.py b/testbed/Textualize__textual/docs/examples/guide/input/key03.py new file mode 100644 index 0000000000000000000000000000000000000000..0b4f8ea044a01f5158f5e80a3883efea379ea4b3 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/input/key03.py @@ -0,0 +1,25 @@ +from textual.app import App, ComposeResult +from textual.widgets import TextLog +from textual import events + + +class KeyLogger(TextLog): + def on_key(self, event: events.Key) -> None: + self.write(event) + + +class InputApp(App): + """App to display key events.""" + + CSS_PATH = "key03.css" + + def compose(self) -> ComposeResult: + yield KeyLogger() + yield KeyLogger() + yield KeyLogger() + yield KeyLogger() + + +if __name__ == "__main__": + app = InputApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/input/mouse01.css b/testbed/Textualize__textual/docs/examples/guide/input/mouse01.css new file mode 100644 index 0000000000000000000000000000000000000000..95685d023ce6045da3fd925d2da636e73d5ab595 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/input/mouse01.css @@ -0,0 +1,24 @@ +Screen { + layers: log ball; +} + +TextLog { + layer: log; +} + +PlayArea { + background: transparent; + layer: ball; + +} +Ball { + layer: ball; + width: auto; + height: 1; + background: $secondary; + border: tall $secondary; + color: $background; + box-sizing: content-box; + text-style: bold; + padding: 0 4; +} diff --git a/testbed/Textualize__textual/docs/examples/guide/input/mouse01.py b/testbed/Textualize__textual/docs/examples/guide/input/mouse01.py new file mode 100644 index 0000000000000000000000000000000000000000..cd2b3621be022af0b17f633c8dbda36095813f38 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/input/mouse01.py @@ -0,0 +1,30 @@ +from textual import events +from textual.app import App, ComposeResult +from textual.containers import Container +from textual.widgets import Static, TextLog + + +class PlayArea(Container): + def on_mount(self) -> None: + self.capture_mouse() + + def on_mouse_move(self, event: events.MouseMove) -> None: + self.screen.query_one(TextLog).write(event) + self.query_one(Ball).offset = event.offset - (8, 2) + + +class Ball(Static): + pass + + +class MouseApp(App): + CSS_PATH = "mouse01.css" + + def compose(self) -> ComposeResult: + yield TextLog() + yield PlayArea(Ball("Textual")) + + +if __name__ == "__main__": + app = MouseApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/layout/combining_layouts.css b/testbed/Textualize__textual/docs/examples/guide/layout/combining_layouts.css new file mode 100644 index 0000000000000000000000000000000000000000..0681bb2fb43523b90729b830a6acbfb1ea65bd61 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/layout/combining_layouts.css @@ -0,0 +1,50 @@ +#app-grid { + layout: grid; + grid-size: 2; /* two columns */ + grid-columns: 1fr; + grid-rows: 1fr; +} + +#left-pane > Static { + background: $boost; + color: auto; + margin-bottom: 1; + padding: 1; +} + +#left-pane { + row-span: 2; + background: $panel; + border: dodgerblue; +} + +#top-right { + background: $panel; + border: mediumvioletred; +} + +#top-right > Static { + width: auto; + height: 100%; + margin-right: 1; + background: $boost; +} + +#bottom-right { + layout: grid; + grid-size: 3; + grid-columns: 1fr; + grid-rows: 1fr; + grid-gutter: 1; + background: $panel; + border: greenyellow; +} + +#bottom-right-final { + column-span: 2; +} + +#bottom-right > Static { + height: 100%; + background: $boost; +} diff --git a/testbed/Textualize__textual/docs/examples/guide/layout/combining_layouts.py b/testbed/Textualize__textual/docs/examples/guide/layout/combining_layouts.py new file mode 100644 index 0000000000000000000000000000000000000000..d832bd6286bca1f66dc0a4986b64f0cb1473f6ed --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/layout/combining_layouts.py @@ -0,0 +1,37 @@ +from textual.containers import Container, Horizontal, Vertical +from textual.app import ComposeResult, App +from textual.widgets import Static, Header + + +class CombiningLayoutsExample(App): + CSS_PATH = "combining_layouts.css" + + def compose(self) -> ComposeResult: + yield Header() + yield Container( + Vertical( + *[Static(f"Vertical layout, child {number}") for number in range(15)], + id="left-pane", + ), + Horizontal( + Static("Horizontally"), + Static("Positioned"), + Static("Children"), + Static("Here"), + id="top-right", + ), + Container( + Static("This"), + Static("panel"), + Static("is"), + Static("using"), + Static("grid layout!", id="bottom-right-final"), + id="bottom-right", + ), + id="app-grid", + ) + + +if __name__ == "__main__": + app = CombiningLayoutsExample() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/layout/dock_layout1_sidebar.css b/testbed/Textualize__textual/docs/examples/guide/layout/dock_layout1_sidebar.css new file mode 100644 index 0000000000000000000000000000000000000000..2d8d1e29986cb898cbf60bad923dcd86bde66b8f --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/layout/dock_layout1_sidebar.css @@ -0,0 +1,7 @@ +#sidebar { + dock: left; + width: 15; + height: 100%; + color: #0f2b41; + background: dodgerblue; +} diff --git a/testbed/Textualize__textual/docs/examples/guide/layout/dock_layout1_sidebar.py b/testbed/Textualize__textual/docs/examples/guide/layout/dock_layout1_sidebar.py new file mode 100644 index 0000000000000000000000000000000000000000..81eb948056d886d0632a63c9c080fcfe80af2d27 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/layout/dock_layout1_sidebar.py @@ -0,0 +1,22 @@ +from textual.app import App, ComposeResult +from textual.widgets import Static + +TEXT = """\ +Docking a widget removes it from the layout and fixes its position, aligned to either the top, right, bottom, or left edges of a container. + +Docked widgets will not scroll out of view, making them ideal for sticky headers, footers, and sidebars. + +""" + + +class DockLayoutExample(App): + CSS_PATH = "dock_layout1_sidebar.css" + + def compose(self) -> ComposeResult: + yield Static("Sidebar", id="sidebar") + yield Static(TEXT * 10, id="body") + + +if __name__ == "__main__": + app = DockLayoutExample() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/layout/dock_layout2_sidebar.css b/testbed/Textualize__textual/docs/examples/guide/layout/dock_layout2_sidebar.css new file mode 100644 index 0000000000000000000000000000000000000000..b90fa8cd7a5ff609264c5d7df55eaf21ec91d219 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/layout/dock_layout2_sidebar.css @@ -0,0 +1,14 @@ +#another-sidebar { + dock: left; + width: 30; + height: 100%; + background: deeppink; +} + +#sidebar { + dock: left; + width: 15; + height: 100%; + color: #0f2b41; + background: dodgerblue; +} diff --git a/testbed/Textualize__textual/docs/examples/guide/layout/dock_layout2_sidebar.py b/testbed/Textualize__textual/docs/examples/guide/layout/dock_layout2_sidebar.py new file mode 100644 index 0000000000000000000000000000000000000000..0da8f78c39a743109e2168ef6e6d30b8c0506888 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/layout/dock_layout2_sidebar.py @@ -0,0 +1,23 @@ +from textual.app import App, ComposeResult +from textual.widgets import Static + +TEXT = """\ +Docking a widget removes it from the layout and fixes its position, aligned to either the top, right, bottom, or left edges of a container. + +Docked widgets will not scroll out of view, making them ideal for sticky headers, footers, and sidebars. + +""" + + +class DockLayoutExample(App): + CSS_PATH = "dock_layout2_sidebar.css" + + def compose(self) -> ComposeResult: + yield Static("Sidebar2", id="another-sidebar") + yield Static("Sidebar1", id="sidebar") + yield Static(TEXT * 10, id="body") + + +app = DockLayoutExample() +if __name__ == "__main__": + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/layout/dock_layout3_sidebar_header.css b/testbed/Textualize__textual/docs/examples/guide/layout/dock_layout3_sidebar_header.css new file mode 100644 index 0000000000000000000000000000000000000000..2d8d1e29986cb898cbf60bad923dcd86bde66b8f --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/layout/dock_layout3_sidebar_header.css @@ -0,0 +1,7 @@ +#sidebar { + dock: left; + width: 15; + height: 100%; + color: #0f2b41; + background: dodgerblue; +} diff --git a/testbed/Textualize__textual/docs/examples/guide/layout/dock_layout3_sidebar_header.py b/testbed/Textualize__textual/docs/examples/guide/layout/dock_layout3_sidebar_header.py new file mode 100644 index 0000000000000000000000000000000000000000..5967bda7f5a36262b499ea9470e202d062202e3d --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/layout/dock_layout3_sidebar_header.py @@ -0,0 +1,23 @@ +from textual.app import App, ComposeResult +from textual.widgets import Static, Header + +TEXT = """\ +Docking a widget removes it from the layout and fixes its position, aligned to either the top, right, bottom, or left edges of a container. + +Docked widgets will not scroll out of view, making them ideal for sticky headers, footers, and sidebars. + +""" + + +class DockLayoutExample(App): + CSS_PATH = "dock_layout3_sidebar_header.css" + + def compose(self) -> ComposeResult: + yield Header(id="header") + yield Static("Sidebar1", id="sidebar") + yield Static(TEXT * 10, id="body") + + +if __name__ == "__main__": + app = DockLayoutExample() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout1.css b/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout1.css new file mode 100644 index 0000000000000000000000000000000000000000..3324c740056bd003b0547a1dd2e0ec58d26e9e05 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout1.css @@ -0,0 +1,9 @@ +Screen { + layout: grid; + grid-size: 3 2; +} + +.box { + height: 100%; + border: solid green; +} diff --git a/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout1.py b/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout1.py new file mode 100644 index 0000000000000000000000000000000000000000..943f18cb789937f44bdd5bd786344433baea28f7 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout1.py @@ -0,0 +1,19 @@ +from textual.app import App, ComposeResult +from textual.widgets import Static + + +class GridLayoutExample(App): + CSS_PATH = "grid_layout1.css" + + def compose(self) -> ComposeResult: + yield Static("One", classes="box") + yield Static("Two", classes="box") + yield Static("Three", classes="box") + yield Static("Four", classes="box") + yield Static("Five", classes="box") + yield Static("Six", classes="box") + + +if __name__ == "__main__": + app = GridLayoutExample() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout2.css b/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout2.css new file mode 100644 index 0000000000000000000000000000000000000000..1749a75c293e8f9068e32aeaebc4c6cd67759b01 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout2.css @@ -0,0 +1,9 @@ +Screen { + layout: grid; + grid-size: 3; +} + +.box { + height: 100%; + border: solid green; +} diff --git a/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout2.py b/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout2.py new file mode 100644 index 0000000000000000000000000000000000000000..407c081e11a2d4d4b2421b7c39ce1931176093eb --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout2.py @@ -0,0 +1,20 @@ +from textual.app import App, ComposeResult +from textual.widgets import Static + + +class GridLayoutExample(App): + CSS_PATH = "grid_layout2.css" + + def compose(self) -> ComposeResult: + yield Static("One", classes="box") + yield Static("Two", classes="box") + yield Static("Three", classes="box") + yield Static("Four", classes="box") + yield Static("Five", classes="box") + yield Static("Six", classes="box") + yield Static("Seven", classes="box") + + +if __name__ == "__main__": + app = GridLayoutExample() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout3_row_col_adjust.css b/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout3_row_col_adjust.css new file mode 100644 index 0000000000000000000000000000000000000000..af01d51378e302249f94c85bef0661b96b69d23d --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout3_row_col_adjust.css @@ -0,0 +1,10 @@ +Screen { + layout: grid; + grid-size: 3; + grid-columns: 2fr 1fr 1fr; +} + +.box { + height: 100%; + border: solid green; +} diff --git a/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout3_row_col_adjust.py b/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout3_row_col_adjust.py new file mode 100644 index 0000000000000000000000000000000000000000..c75a58da1e92c6073b544da4f7bc23c75cdb5019 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout3_row_col_adjust.py @@ -0,0 +1,19 @@ +from textual.app import App, ComposeResult +from textual.widgets import Static + + +class GridLayoutExample(App): + CSS_PATH = "grid_layout3_row_col_adjust.css" + + def compose(self) -> ComposeResult: + yield Static("One", classes="box") + yield Static("Two", classes="box") + yield Static("Three", classes="box") + yield Static("Four", classes="box") + yield Static("Five", classes="box") + yield Static("Six", classes="box") + + +if __name__ == "__main__": + app = GridLayoutExample() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout4_row_col_adjust.css b/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout4_row_col_adjust.css new file mode 100644 index 0000000000000000000000000000000000000000..7e377c9410ab2112d18b96ee51d7a0833cfc8ad5 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout4_row_col_adjust.css @@ -0,0 +1,11 @@ +Screen { + layout: grid; + grid-size: 3; + grid-columns: 2fr 1fr 1fr; + grid-rows: 25% 75%; +} + +.box { + height: 100%; + border: solid green; +} diff --git a/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout4_row_col_adjust.py b/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout4_row_col_adjust.py new file mode 100644 index 0000000000000000000000000000000000000000..f11a2d5b0dae72b72e22389aa11fd587b41fd21f --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout4_row_col_adjust.py @@ -0,0 +1,19 @@ +from textual.app import App, ComposeResult +from textual.widgets import Static + + +class GridLayoutExample(App): + CSS_PATH = "grid_layout4_row_col_adjust.css" + + def compose(self) -> ComposeResult: + yield Static("One", classes="box") + yield Static("Two", classes="box") + yield Static("Three", classes="box") + yield Static("Four", classes="box") + yield Static("Five", classes="box") + yield Static("Six", classes="box") + + +if __name__ == "__main__": + app = GridLayoutExample() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout5_col_span.css b/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout5_col_span.css new file mode 100644 index 0000000000000000000000000000000000000000..0c78063f6847b4116d0a0bdadedeee1384692ec4 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout5_col_span.css @@ -0,0 +1,14 @@ +Screen { + layout: grid; + grid-size: 3; +} + +#two { + column-span: 2; + tint: magenta 40%; +} + +.box { + height: 100%; + border: solid green; +} diff --git a/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout5_col_span.py b/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout5_col_span.py new file mode 100644 index 0000000000000000000000000000000000000000..d7fe1cb83ab485ab859c311a9f5900ed66453353 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout5_col_span.py @@ -0,0 +1,19 @@ +from textual.app import App, ComposeResult +from textual.widgets import Static + + +class GridLayoutExample(App): + CSS_PATH = "grid_layout5_col_span.css" + + def compose(self) -> ComposeResult: + yield Static("One", classes="box") + yield Static("Two [b](column-span: 2)", classes="box", id="two") + yield Static("Three", classes="box") + yield Static("Four", classes="box") + yield Static("Five", classes="box") + yield Static("Six", classes="box") + + +if __name__ == "__main__": + app = GridLayoutExample() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout6_row_span.css b/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout6_row_span.css new file mode 100644 index 0000000000000000000000000000000000000000..43084fedcb4671b6a5ecbe55c8144c0402b8fce0 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout6_row_span.css @@ -0,0 +1,15 @@ +Screen { + layout: grid; + grid-size: 3; +} + +#two { + column-span: 2; + row-span: 2; + tint: magenta 40%; +} + +.box { + height: 100%; + border: solid green; +} diff --git a/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout6_row_span.py b/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout6_row_span.py new file mode 100644 index 0000000000000000000000000000000000000000..54630b081ba0271cc3756ca131a9314b0e34da86 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout6_row_span.py @@ -0,0 +1,19 @@ +from textual.app import App, ComposeResult +from textual.widgets import Static + + +class GridLayoutExample(App): + CSS_PATH = "grid_layout6_row_span.css" + + def compose(self) -> ComposeResult: + yield Static("One", classes="box") + yield Static("Two [b](column-span: 2 and row-span: 2)", classes="box", id="two") + yield Static("Three", classes="box") + yield Static("Four", classes="box") + yield Static("Five", classes="box") + yield Static("Six", classes="box") + + +app = GridLayoutExample() +if __name__ == "__main__": + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout7_gutter.css b/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout7_gutter.css new file mode 100644 index 0000000000000000000000000000000000000000..a495b26422262764563a37e62b13b2e664ac0338 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout7_gutter.css @@ -0,0 +1,11 @@ +Screen { + layout: grid; + grid-size: 3; + grid-gutter: 1; + background: lightgreen; +} + +.box { + background: darkmagenta; + height: 100%; +} diff --git a/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout7_gutter.py b/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout7_gutter.py new file mode 100644 index 0000000000000000000000000000000000000000..db916858c054d9ca4291b2d98606f9e2f296bea9 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/layout/grid_layout7_gutter.py @@ -0,0 +1,19 @@ +from textual.app import App, ComposeResult +from textual.widgets import Static + + +class GridLayoutExample(App): + CSS_PATH = "grid_layout7_gutter.css" + + def compose(self) -> ComposeResult: + yield Static("One", classes="box") + yield Static("Two", classes="box") + yield Static("Three", classes="box") + yield Static("Four", classes="box") + yield Static("Five", classes="box") + yield Static("Six", classes="box") + + +if __name__ == "__main__": + app = GridLayoutExample() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/layout/horizontal_layout.css b/testbed/Textualize__textual/docs/examples/guide/layout/horizontal_layout.css new file mode 100644 index 0000000000000000000000000000000000000000..3ea0c4e20473716fc4b5a2c09affe93f1a4746c0 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/layout/horizontal_layout.css @@ -0,0 +1,9 @@ +Screen { + layout: horizontal; +} + +.box { + height: 100%; + width: 1fr; + border: solid green; +} diff --git a/testbed/Textualize__textual/docs/examples/guide/layout/horizontal_layout.py b/testbed/Textualize__textual/docs/examples/guide/layout/horizontal_layout.py new file mode 100644 index 0000000000000000000000000000000000000000..40997293f4a7e1b8308984e2a858050cdb726c9f --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/layout/horizontal_layout.py @@ -0,0 +1,16 @@ +from textual.app import App, ComposeResult +from textual.widgets import Static + + +class HorizontalLayoutExample(App): + CSS_PATH = "horizontal_layout.css" + + def compose(self) -> ComposeResult: + yield Static("One", classes="box") + yield Static("Two", classes="box") + yield Static("Three", classes="box") + + +if __name__ == "__main__": + app = HorizontalLayoutExample() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/layout/horizontal_layout_overflow.css b/testbed/Textualize__textual/docs/examples/guide/layout/horizontal_layout_overflow.css new file mode 100644 index 0000000000000000000000000000000000000000..6d52aa1f63156a9b65e52deb34c326d6dc262a57 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/layout/horizontal_layout_overflow.css @@ -0,0 +1,9 @@ +Screen { + layout: horizontal; + overflow-x: auto; +} + +.box { + height: 100%; + border: solid green; +} diff --git a/testbed/Textualize__textual/docs/examples/guide/layout/horizontal_layout_overflow.py b/testbed/Textualize__textual/docs/examples/guide/layout/horizontal_layout_overflow.py new file mode 100644 index 0000000000000000000000000000000000000000..b5be0e96df7ecc719968b9b83b79cd868e6ac2f5 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/layout/horizontal_layout_overflow.py @@ -0,0 +1,16 @@ +from textual.app import App, ComposeResult +from textual.widgets import Static + + +class HorizontalLayoutExample(App): + CSS_PATH = "horizontal_layout_overflow.css" + + def compose(self) -> ComposeResult: + yield Static("One", classes="box") + yield Static("Two", classes="box") + yield Static("Three", classes="box") + + +if __name__ == "__main__": + app = HorizontalLayoutExample() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/layout/layers.css b/testbed/Textualize__textual/docs/examples/guide/layout/layers.css new file mode 100644 index 0000000000000000000000000000000000000000..4465b2d91c6f88e4d57040c718463585864a8d55 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/layout/layers.css @@ -0,0 +1,22 @@ +Screen { + align: center middle; + layers: below above; +} + +Static { + width: 28; + height: 8; + color: auto; + content-align: center middle; +} + +#box1 { + background: darkcyan; + layer: above; +} + +#box2 { + layer: below; + background: orange; + offset: 12 6; +} diff --git a/testbed/Textualize__textual/docs/examples/guide/layout/layers.py b/testbed/Textualize__textual/docs/examples/guide/layout/layers.py new file mode 100644 index 0000000000000000000000000000000000000000..06afbd29aa8cadd757be74d138e9e762098148de --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/layout/layers.py @@ -0,0 +1,15 @@ +from textual.app import App, ComposeResult +from textual.widgets import Static + + +class LayersExample(App): + CSS_PATH = "layers.css" + + def compose(self) -> ComposeResult: + yield Static("box1 (layer = above)", id="box1") + yield Static("box2 (layer = below)", id="box2") + + +if __name__ == "__main__": + app = LayersExample() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/layout/utility_containers.css b/testbed/Textualize__textual/docs/examples/guide/layout/utility_containers.css new file mode 100644 index 0000000000000000000000000000000000000000..006604130a3311f7bc5c490ced1066e0ebb4a3fc --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/layout/utility_containers.css @@ -0,0 +1,10 @@ +Static { + content-align: center middle; + background: crimson; + border: solid darkred; + height: 1fr; +} + +.column { + width: 1fr; +} diff --git a/testbed/Textualize__textual/docs/examples/guide/layout/utility_containers.py b/testbed/Textualize__textual/docs/examples/guide/layout/utility_containers.py new file mode 100644 index 0000000000000000000000000000000000000000..eadf58b4c605e5bba92fd535ebf3706bdcbc91ba --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/layout/utility_containers.py @@ -0,0 +1,26 @@ +from textual.app import App, ComposeResult +from textual.containers import Horizontal, Vertical +from textual.widgets import Static + + +class UtilityContainersExample(App): + CSS_PATH = "utility_containers.css" + + def compose(self) -> ComposeResult: + yield Horizontal( + Vertical( + Static("One"), + Static("Two"), + classes="column", + ), + Vertical( + Static("Three"), + Static("Four"), + classes="column", + ), + ) + + +if __name__ == "__main__": + app = UtilityContainersExample() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/layout/vertical_layout.css b/testbed/Textualize__textual/docs/examples/guide/layout/vertical_layout.css new file mode 100644 index 0000000000000000000000000000000000000000..30d557c60918a0d8b63c67e15f608ba52b168b6f --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/layout/vertical_layout.css @@ -0,0 +1,8 @@ +Screen { + layout: vertical; +} + +.box { + height: 1fr; + border: solid green; +} diff --git a/testbed/Textualize__textual/docs/examples/guide/layout/vertical_layout.py b/testbed/Textualize__textual/docs/examples/guide/layout/vertical_layout.py new file mode 100644 index 0000000000000000000000000000000000000000..233407ac32a0e624a61d82d356572c50ab6840b6 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/layout/vertical_layout.py @@ -0,0 +1,16 @@ +from textual.app import App, ComposeResult +from textual.widgets import Static + + +class VerticalLayoutExample(App): + CSS_PATH = "vertical_layout.css" + + def compose(self) -> ComposeResult: + yield Static("One", classes="box") + yield Static("Two", classes="box") + yield Static("Three", classes="box") + + +if __name__ == "__main__": + app = VerticalLayoutExample() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/layout/vertical_layout_scrolled.css b/testbed/Textualize__textual/docs/examples/guide/layout/vertical_layout_scrolled.css new file mode 100644 index 0000000000000000000000000000000000000000..3dafcd616c6339f8a7d3755b5946ab9589172d48 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/layout/vertical_layout_scrolled.css @@ -0,0 +1,8 @@ +Screen { + layout: vertical; +} + +.box { + height: 14; + border: solid green; +} diff --git a/testbed/Textualize__textual/docs/examples/guide/layout/vertical_layout_scrolled.py b/testbed/Textualize__textual/docs/examples/guide/layout/vertical_layout_scrolled.py new file mode 100644 index 0000000000000000000000000000000000000000..984040ef7f3d325c6a092df446b6a009f47fdac9 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/layout/vertical_layout_scrolled.py @@ -0,0 +1,16 @@ +from textual.app import App, ComposeResult +from textual.widgets import Static + + +class VerticalLayoutScrolledExample(App): + CSS_PATH = "vertical_layout_scrolled.css" + + def compose(self) -> ComposeResult: + yield Static("One", classes="box") + yield Static("Two", classes="box") + yield Static("Three", classes="box") + + +if __name__ == "__main__": + app = VerticalLayoutScrolledExample() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/reactivity/computed01.css b/testbed/Textualize__textual/docs/examples/guide/reactivity/computed01.css new file mode 100644 index 0000000000000000000000000000000000000000..7d1ca274005b8ded84b9a58434797a50f2bf1b40 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/reactivity/computed01.css @@ -0,0 +1,13 @@ +#color-inputs { + dock: top; + height: auto; +} + +Input { + width: 1fr; +} + +#color { + height: 100%; + border: tall $secondary; +} diff --git a/testbed/Textualize__textual/docs/examples/guide/reactivity/computed01.py b/testbed/Textualize__textual/docs/examples/guide/reactivity/computed01.py new file mode 100644 index 0000000000000000000000000000000000000000..dcef731ff439121798df90bc3483886a29547d04 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/reactivity/computed01.py @@ -0,0 +1,47 @@ +from textual.app import App, ComposeResult +from textual.color import Color +from textual.containers import Horizontal +from textual.reactive import reactive +from textual.widgets import Input, Static + + +class ComputedApp(App): + CSS_PATH = "computed01.css" + + red = reactive(0) + green = reactive(0) + blue = reactive(0) + color = reactive(Color.parse("transparent")) + + def compose(self) -> ComposeResult: + yield Horizontal( + Input("0", placeholder="Enter red 0-255", id="red"), + Input("0", placeholder="Enter green 0-255", id="green"), + Input("0", placeholder="Enter blue 0-255", id="blue"), + id="color-inputs", + ) + yield Static(id="color") + + def compute_color(self) -> Color: # (1)! + return Color(self.red, self.green, self.blue).clamped + + def watch_color(self, color: Color) -> None: # (2) + self.query_one("#color").styles.background = color + + def on_input_changed(self, event: Input.Changed) -> None: + try: + component = int(event.value) + except ValueError: + self.bell() + else: + if event.input.id == "red": + self.red = component + elif event.input.id == "green": + self.green = component + else: + self.blue = component + + +if __name__ == "__main__": + app = ComputedApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/reactivity/refresh01.css b/testbed/Textualize__textual/docs/examples/guide/reactivity/refresh01.css new file mode 100644 index 0000000000000000000000000000000000000000..08cd17d9105b52e13cb629f03c34e4071249f0e4 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/reactivity/refresh01.css @@ -0,0 +1,9 @@ +Input { + dock: top; + margin-top: 1; +} + +Name { + height: 100%; + content-align: center middle; +} diff --git a/testbed/Textualize__textual/docs/examples/guide/reactivity/refresh01.py b/testbed/Textualize__textual/docs/examples/guide/reactivity/refresh01.py new file mode 100644 index 0000000000000000000000000000000000000000..d01e1031c61cb8c8f61d8a2dc78ccf262d3fbf2d --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/reactivity/refresh01.py @@ -0,0 +1,29 @@ +from textual.app import App, ComposeResult +from textual.reactive import reactive +from textual.widget import Widget +from textual.widgets import Input + + +class Name(Widget): + """Generates a greeting.""" + + who = reactive("name") + + def render(self) -> str: + return f"Hello, {self.who}!" + + +class WatchApp(App): + CSS_PATH = "refresh01.css" + + def compose(self) -> ComposeResult: + yield Input(placeholder="Enter your name") + yield Name() + + def on_input_changed(self, event: Input.Changed) -> None: + self.query_one(Name).who = event.value + + +if __name__ == "__main__": + app = WatchApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/reactivity/refresh02.css b/testbed/Textualize__textual/docs/examples/guide/reactivity/refresh02.css new file mode 100644 index 0000000000000000000000000000000000000000..55ba7f0f8e23de9af34f351ca834e674fe4f0484 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/reactivity/refresh02.css @@ -0,0 +1,10 @@ +Input { + dock: top; + margin-top: 1; +} + +Name { + width: auto; + height: auto; + border: heavy $secondary; +} diff --git a/testbed/Textualize__textual/docs/examples/guide/reactivity/refresh02.py b/testbed/Textualize__textual/docs/examples/guide/reactivity/refresh02.py new file mode 100644 index 0000000000000000000000000000000000000000..28da2549c1e984753b31ae2c1763c88664719d23 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/reactivity/refresh02.py @@ -0,0 +1,29 @@ +from textual.app import App, ComposeResult +from textual.reactive import reactive +from textual.widget import Widget +from textual.widgets import Input + + +class Name(Widget): + """Generates a greeting.""" + + who = reactive("name", layout=True) # (1)! + + def render(self) -> str: + return f"Hello, {self.who}!" + + +class WatchApp(App): + CSS_PATH = "refresh02.css" + + def compose(self) -> ComposeResult: + yield Input(placeholder="Enter your name") + yield Name() + + def on_input_changed(self, event: Input.Changed) -> None: + self.query_one(Name).who = event.value + + +if __name__ == "__main__": + app = WatchApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/reactivity/validate01.css b/testbed/Textualize__textual/docs/examples/guide/reactivity/validate01.css new file mode 100644 index 0000000000000000000000000000000000000000..5bb65cbc83d22a9f7983909871f874ffdd182e0c --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/reactivity/validate01.css @@ -0,0 +1,4 @@ +#buttons { + dock: top; + height: auto; +} diff --git a/testbed/Textualize__textual/docs/examples/guide/reactivity/validate01.py b/testbed/Textualize__textual/docs/examples/guide/reactivity/validate01.py new file mode 100644 index 0000000000000000000000000000000000000000..348a9f1d8df42a21da556afaf72871c3a5fe7abb --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/reactivity/validate01.py @@ -0,0 +1,38 @@ +from textual.app import App, ComposeResult +from textual.containers import Horizontal +from textual.reactive import reactive +from textual.widgets import Button, TextLog + + +class ValidateApp(App): + CSS_PATH = "validate01.css" + + count = reactive(0) + + def validate_count(self, count: int) -> int: + """Validate value.""" + if count < 0: + count = 0 + elif count > 10: + count = 10 + return count + + def compose(self) -> ComposeResult: + yield Horizontal( + Button("+1", id="plus", variant="success"), + Button("-1", id="minus", variant="error"), + id="buttons", + ) + yield TextLog(highlight=True) + + def on_button_pressed(self, event: Button.Pressed) -> None: + if event.button.id == "plus": + self.count += 1 + else: + self.count -= 1 + self.query_one(TextLog).write(f"{self.count=}") + + +if __name__ == "__main__": + app = ValidateApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/reactivity/watch01.css b/testbed/Textualize__textual/docs/examples/guide/reactivity/watch01.css new file mode 100644 index 0000000000000000000000000000000000000000..1b1fce667d059c5077c893c0eac097cb49f9388e --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/reactivity/watch01.css @@ -0,0 +1,21 @@ +Input { + dock: top; + margin-top: 1; +} + +#colors { + grid-size: 2 1; + grid-gutter: 2 4; + grid-columns: 1fr; + margin: 0 1; +} + +#old { + height: 100%; + border: wide $secondary; +} + +#new { + height: 100%; + border: wide $secondary; +} diff --git a/testbed/Textualize__textual/docs/examples/guide/reactivity/watch01.py b/testbed/Textualize__textual/docs/examples/guide/reactivity/watch01.py new file mode 100644 index 0000000000000000000000000000000000000000..5d2cacffd4295546a22f5eae73c760a48a062e43 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/reactivity/watch01.py @@ -0,0 +1,33 @@ +from textual.app import App, ComposeResult +from textual.color import Color, ColorParseError +from textual.containers import Grid +from textual.reactive import reactive +from textual.widgets import Input, Static + + +class WatchApp(App): + CSS_PATH = "watch01.css" + + color = reactive(Color.parse("transparent")) # (1)! + + def compose(self) -> ComposeResult: + yield Input(placeholder="Enter a color") + yield Grid(Static(id="old"), Static(id="new"), id="colors") + + def watch_color(self, old_color: Color, new_color: Color) -> None: # (2)! + self.query_one("#old").styles.background = old_color + self.query_one("#new").styles.background = new_color + + def on_input_submitted(self, event: Input.Submitted) -> None: + try: + input_color = Color.parse(event.value) + except ColorParseError: + pass + else: + self.query_one(Input).value = "" + self.color = input_color # (3)! + + +if __name__ == "__main__": + app = WatchApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/screens/modal01.css b/testbed/Textualize__textual/docs/examples/guide/screens/modal01.css new file mode 100644 index 0000000000000000000000000000000000000000..8c7bea071d80f0223da43becee7ca44d03804229 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/screens/modal01.css @@ -0,0 +1,16 @@ +#dialog { + grid-size: 2; + grid-gutter: 1 2; + margin: 1 2; +} + +#question { + column-span: 2; + content-align: center bottom; + width: 100%; + height: 100%; +} + +Button { + width: 100%; +} diff --git a/testbed/Textualize__textual/docs/examples/guide/screens/modal01.py b/testbed/Textualize__textual/docs/examples/guide/screens/modal01.py new file mode 100644 index 0000000000000000000000000000000000000000..2ae1dd990a72f86b4b8b7d6514fd41ee02007bbb --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/screens/modal01.py @@ -0,0 +1,37 @@ +from textual.app import App, ComposeResult +from textual.containers import Grid +from textual.screen import Screen +from textual.widgets import Static, Header, Footer, Button + + +class QuitScreen(Screen): + def compose(self) -> ComposeResult: + yield Grid( + Static("Are you sure you want to quit?", id="question"), + Button("Quit", variant="error", id="quit"), + Button("Cancel", variant="primary", id="cancel"), + id="dialog", + ) + + def on_button_pressed(self, event: Button.Pressed) -> None: + if event.button.id == "quit": + self.app.exit() + else: + self.app.pop_screen() + + +class ModalApp(App): + CSS_PATH = "modal01.css" + BINDINGS = [("q", "request_quit", "Quit")] + + def compose(self) -> ComposeResult: + yield Header() + yield Footer() + + def action_request_quit(self) -> None: + self.push_screen(QuitScreen()) + + +if __name__ == "__main__": + app = ModalApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/screens/screen01.css b/testbed/Textualize__textual/docs/examples/guide/screens/screen01.css new file mode 100644 index 0000000000000000000000000000000000000000..0ee028ebe77f4fc48c2089cb9732379dabca7adc --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/screens/screen01.css @@ -0,0 +1,18 @@ +BSOD { + align: center middle; + background: blue; + color: white; +} + +BSOD>Static { + width: 70; +} + +#title { + content-align-horizontal: center; + text-style: reverse; +} + +#any-key { + content-align-horizontal: center; +} diff --git a/testbed/Textualize__textual/docs/examples/guide/screens/screen01.py b/testbed/Textualize__textual/docs/examples/guide/screens/screen01.py new file mode 100644 index 0000000000000000000000000000000000000000..63a24fd4ed092fb84efe53e718bff16b7c989a9c --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/screens/screen01.py @@ -0,0 +1,34 @@ +from textual.app import App, Screen, ComposeResult +from textual.widgets import Static + + +ERROR_TEXT = """ +An error has occurred. To continue: + +Press Enter to return to Windows, or + +Press CTRL+ALT+DEL to restart your computer. If you do this, +you will lose any unsaved information in all open applications. + +Error: 0E : 016F : BFF9B3D4 +""" + + +class BSOD(Screen): + BINDINGS = [("escape", "app.pop_screen", "Pop screen")] + + def compose(self) -> ComposeResult: + yield Static(" Windows ", id="title") + yield Static(ERROR_TEXT) + yield Static("Press any key to continue [blink]_[/]", id="any-key") + + +class BSODApp(App): + CSS_PATH = "screen01.css" + SCREENS = {"bsod": BSOD()} + BINDINGS = [("b", "push_screen('bsod')", "BSOD")] + + +if __name__ == "__main__": + app = BSODApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/screens/screen02.css b/testbed/Textualize__textual/docs/examples/guide/screens/screen02.css new file mode 100644 index 0000000000000000000000000000000000000000..0ee028ebe77f4fc48c2089cb9732379dabca7adc --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/screens/screen02.css @@ -0,0 +1,18 @@ +BSOD { + align: center middle; + background: blue; + color: white; +} + +BSOD>Static { + width: 70; +} + +#title { + content-align-horizontal: center; + text-style: reverse; +} + +#any-key { + content-align-horizontal: center; +} diff --git a/testbed/Textualize__textual/docs/examples/guide/screens/screen02.py b/testbed/Textualize__textual/docs/examples/guide/screens/screen02.py new file mode 100644 index 0000000000000000000000000000000000000000..0d5d01e46b9bc91b3d0e20cb69c8cbaefa95e809 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/screens/screen02.py @@ -0,0 +1,36 @@ +from textual.app import App, Screen, ComposeResult +from textual.widgets import Static + + +ERROR_TEXT = """ +An error has occurred. To continue: + +Press Enter to return to Windows, or + +Press CTRL+ALT+DEL to restart your computer. If you do this, +you will lose any unsaved information in all open applications. + +Error: 0E : 016F : BFF9B3D4 +""" + + +class BSOD(Screen): + BINDINGS = [("escape", "app.pop_screen", "Pop screen")] + + def compose(self) -> ComposeResult: + yield Static(" Windows ", id="title") + yield Static(ERROR_TEXT) + yield Static("Press any key to continue [blink]_[/]", id="any-key") + + +class BSODApp(App): + CSS_PATH = "screen02.css" + BINDINGS = [("b", "push_screen('bsod')", "BSOD")] + + def on_mount(self) -> None: + self.install_screen(BSOD(), name="bsod") + + +if __name__ == "__main__": + app = BSODApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/structure.py b/testbed/Textualize__textual/docs/examples/guide/structure.py new file mode 100644 index 0000000000000000000000000000000000000000..fe1d3dea698376ecb38d985e4521c4bf5c6a6f95 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/structure.py @@ -0,0 +1,30 @@ +from datetime import datetime + +from textual.app import App +from textual.widget import Widget + + +class Clock(Widget): + """A clock app.""" + + DEFAULT_CSS = """ + Clock { + content-align: center middle; + } + """ + + def on_mount(self): + self.set_interval(1, self.refresh) + + def render(self): + return datetime.now().strftime("%c") + + +class ClockApp(App): + def compose(self): + yield Clock() + + +if __name__ == "__main__": + app = ClockApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/styles/border01.py b/testbed/Textualize__textual/docs/examples/guide/styles/border01.py new file mode 100644 index 0000000000000000000000000000000000000000..6cc5aada5f2a5e6dc637d0c9c8e5afd2e5171678 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/styles/border01.py @@ -0,0 +1,27 @@ +from textual.app import App, ComposeResult +from textual.widgets import Static + + +TEXT = """I must not fear. +Fear is the mind-killer. +Fear is the little-death that brings total obliteration. +I will face my fear. +I will permit it to pass over me and through me. +And when it has gone past, I will turn the inner eye to see its path. +Where the fear has gone there will be nothing. Only I will remain.""" + + +class BorderApp(App): + def compose(self) -> ComposeResult: + self.widget = Static(TEXT) + yield self.widget + + def on_mount(self) -> None: + self.widget.styles.background = "darkblue" + self.widget.styles.width = "50%" + self.widget.styles.border = ("heavy", "yellow") + + +if __name__ == "__main__": + app = BorderApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/styles/box_sizing01.py b/testbed/Textualize__textual/docs/examples/guide/styles/box_sizing01.py new file mode 100644 index 0000000000000000000000000000000000000000..af1e5ef62f4930932a89d5ac3fd0b08945fa6bb3 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/styles/box_sizing01.py @@ -0,0 +1,38 @@ +from textual.app import App, ComposeResult +from textual.widgets import Static + + +TEXT = """I must not fear. +Fear is the mind-killer. +Fear is the little-death that brings total obliteration. +I will face my fear. +I will permit it to pass over me and through me. +And when it has gone past, I will turn the inner eye to see its path. +Where the fear has gone there will be nothing. Only I will remain.""" + + +class BoxSizing(App): + def compose(self) -> ComposeResult: + self.widget1 = Static(TEXT) + yield self.widget1 + self.widget2 = Static(TEXT) + yield self.widget2 + + def on_mount(self) -> None: + self.widget1.styles.background = "purple" + self.widget2.styles.background = "darkgreen" + self.widget1.styles.width = 30 + self.widget2.styles.width = 30 + self.widget2.styles.height = 6 + self.widget1.styles.height = 6 + self.widget2.styles.height = 6 + self.widget1.styles.border = ("heavy", "white") + self.widget2.styles.border = ("heavy", "white") + self.widget1.styles.padding = 1 + self.widget2.styles.padding = 1 + self.widget2.styles.box_sizing = "content-box" + + +if __name__ == "__main__": + app = BoxSizing() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/styles/colors.py b/testbed/Textualize__textual/docs/examples/guide/styles/colors.py new file mode 100644 index 0000000000000000000000000000000000000000..5abfaf8611b67f84d38628f1947a43a3517525a6 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/styles/colors.py @@ -0,0 +1,17 @@ +from textual.app import App, ComposeResult +from textual.widgets import Static + + +class WidgetApp(App): + def compose(self) -> ComposeResult: + self.widget = Static("Textual") + yield self.widget + + def on_mount(self) -> None: + self.widget.styles.background = "darkblue" + self.widget.styles.border = ("heavy", "white") + + +if __name__ == "__main__": + app = WidgetApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/styles/colors01.py b/testbed/Textualize__textual/docs/examples/guide/styles/colors01.py new file mode 100644 index 0000000000000000000000000000000000000000..401f9becbe4d1b3f61003158ef4066b2e0ba8710 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/styles/colors01.py @@ -0,0 +1,24 @@ +from textual.app import App, ComposeResult +from textual.color import Color +from textual.widgets import Static + + +class ColorApp(App): + def compose(self) -> ComposeResult: + self.widget1 = Static("Textual One") + yield self.widget1 + self.widget2 = Static("Textual Two") + yield self.widget2 + self.widget3 = Static("Textual Three") + yield self.widget3 + + def on_mount(self) -> None: + self.widget1.styles.background = "#9932CC" + self.widget2.styles.background = "hsl(150,42.9%,49.4%)" + self.widget2.styles.color = "blue" + self.widget3.styles.background = Color(191, 78, 96) + + +if __name__ == "__main__": + app = ColorApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/styles/colors02.py b/testbed/Textualize__textual/docs/examples/guide/styles/colors02.py new file mode 100644 index 0000000000000000000000000000000000000000..80b480e4e83c3b05920b020b69aa6a504c5977e1 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/styles/colors02.py @@ -0,0 +1,20 @@ +from textual.app import App, ComposeResult +from textual.color import Color +from textual.widgets import Static + + +class ColorApp(App): + def compose(self) -> ComposeResult: + self.widgets = [Static("") for n in range(10)] + yield from self.widgets + + def on_mount(self) -> None: + for index, widget in enumerate(self.widgets, 1): + alpha = index * 0.1 + widget.update(f"alpha={alpha:.1f}") + widget.styles.background = Color(191, 78, 96, a=alpha) + + +if __name__ == "__main__": + app = ColorApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/styles/dimensions01.py b/testbed/Textualize__textual/docs/examples/guide/styles/dimensions01.py new file mode 100644 index 0000000000000000000000000000000000000000..ed479f0f34f390de3bde60f07084734b3bccb452 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/styles/dimensions01.py @@ -0,0 +1,27 @@ +from textual.app import App, ComposeResult +from textual.widgets import Static + + +TEXT = """I must not fear. +Fear is the mind-killer. +Fear is the little-death that brings total obliteration. +I will face my fear. +I will permit it to pass over me and through me. +And when it has gone past, I will turn the inner eye to see its path. +Where the fear has gone there will be nothing. Only I will remain.""" + + +class DimensionsApp(App): + def compose(self) -> ComposeResult: + self.widget = Static(TEXT) + yield self.widget + + def on_mount(self) -> None: + self.widget.styles.background = "purple" + self.widget.styles.width = 30 + self.widget.styles.height = 10 + + +if __name__ == "__main__": + app = DimensionsApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/styles/dimensions02.py b/testbed/Textualize__textual/docs/examples/guide/styles/dimensions02.py new file mode 100644 index 0000000000000000000000000000000000000000..339aade9955423bfabc26233d66d13764114b79b --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/styles/dimensions02.py @@ -0,0 +1,27 @@ +from textual.app import App, ComposeResult +from textual.widgets import Static + + +TEXT = """I must not fear. +Fear is the mind-killer. +Fear is the little-death that brings total obliteration. +I will face my fear. +I will permit it to pass over me and through me. +And when it has gone past, I will turn the inner eye to see its path. +Where the fear has gone there will be nothing. Only I will remain.""" + + +class DimensionsApp(App): + def compose(self) -> ComposeResult: + self.widget = Static(TEXT) + yield self.widget + + def on_mount(self) -> None: + self.widget.styles.background = "purple" + self.widget.styles.width = 30 + self.widget.styles.height = "auto" + + +if __name__ == "__main__": + app = DimensionsApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/styles/dimensions03.py b/testbed/Textualize__textual/docs/examples/guide/styles/dimensions03.py new file mode 100644 index 0000000000000000000000000000000000000000..4d361227e45f6bcac7a2a172ed526ce8444499bb --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/styles/dimensions03.py @@ -0,0 +1,27 @@ +from textual.app import App, ComposeResult +from textual.widgets import Static + + +TEXT = """I must not fear. +Fear is the mind-killer. +Fear is the little-death that brings total obliteration. +I will face my fear. +I will permit it to pass over me and through me. +And when it has gone past, I will turn the inner eye to see its path. +Where the fear has gone there will be nothing. Only I will remain.""" + + +class DimensionsApp(App): + def compose(self) -> ComposeResult: + self.widget = Static(TEXT) + yield self.widget + + def on_mount(self) -> None: + self.widget.styles.background = "purple" + self.widget.styles.width = "50%" + self.widget.styles.height = "80%" + + +if __name__ == "__main__": + app = DimensionsApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/styles/dimensions04.py b/testbed/Textualize__textual/docs/examples/guide/styles/dimensions04.py new file mode 100644 index 0000000000000000000000000000000000000000..405b5545e97ba7de9c65ecc78596ff3d4bacc104 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/styles/dimensions04.py @@ -0,0 +1,30 @@ +from textual.app import App, ComposeResult +from textual.widgets import Static + + +TEXT = """I must not fear. +Fear is the mind-killer. +Fear is the little-death that brings total obliteration. +I will face my fear. +I will permit it to pass over me and through me. +And when it has gone past, I will turn the inner eye to see its path. +Where the fear has gone there will be nothing. Only I will remain.""" + + +class DimensionsApp(App): + def compose(self) -> ComposeResult: + self.widget1 = Static(TEXT) + yield self.widget1 + self.widget2 = Static(TEXT) + yield self.widget2 + + def on_mount(self) -> None: + self.widget1.styles.background = "purple" + self.widget2.styles.background = "darkgreen" + self.widget1.styles.height = "2fr" + self.widget2.styles.height = "1fr" + + +if __name__ == "__main__": + app = DimensionsApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/styles/margin01.py b/testbed/Textualize__textual/docs/examples/guide/styles/margin01.py new file mode 100644 index 0000000000000000000000000000000000000000..7036cb725728f464d6423768c0ad81cb5ad26129 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/styles/margin01.py @@ -0,0 +1,32 @@ +from textual.app import App, ComposeResult +from textual.widgets import Static + + +TEXT = """I must not fear. +Fear is the mind-killer. +Fear is the little-death that brings total obliteration. +I will face my fear. +I will permit it to pass over me and through me. +And when it has gone past, I will turn the inner eye to see its path. +Where the fear has gone there will be nothing. Only I will remain.""" + + +class MarginApp(App): + def compose(self) -> ComposeResult: + self.widget1 = Static(TEXT) + yield self.widget1 + self.widget2 = Static(TEXT) + yield self.widget2 + + def on_mount(self) -> None: + self.widget1.styles.background = "purple" + self.widget2.styles.background = "darkgreen" + self.widget1.styles.border = ("heavy", "white") + self.widget2.styles.border = ("heavy", "white") + self.widget1.styles.margin = 2 + self.widget2.styles.margin = 2 + + +if __name__ == "__main__": + app = MarginApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/styles/outline01.py b/testbed/Textualize__textual/docs/examples/guide/styles/outline01.py new file mode 100644 index 0000000000000000000000000000000000000000..cd77d0b8c60c059f2aaba4eb273ed45d5804a4d6 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/styles/outline01.py @@ -0,0 +1,27 @@ +from textual.app import App, ComposeResult +from textual.widgets import Static + + +TEXT = """I must not fear. +Fear is the mind-killer. +Fear is the little-death that brings total obliteration. +I will face my fear. +I will permit it to pass over me and through me. +And when it has gone past, I will turn the inner eye to see its path. +Where the fear has gone there will be nothing. Only I will remain.""" + + +class OutlineApp(App): + def compose(self) -> ComposeResult: + self.widget = Static(TEXT) + yield self.widget + + def on_mount(self) -> None: + self.widget.styles.background = "darkblue" + self.widget.styles.width = "50%" + self.widget.styles.outline = ("heavy", "yellow") + + +if __name__ == "__main__": + app = OutlineApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/styles/padding01.py b/testbed/Textualize__textual/docs/examples/guide/styles/padding01.py new file mode 100644 index 0000000000000000000000000000000000000000..92c68948aa9f5f89f6f126523e79cb5d8119aefa --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/styles/padding01.py @@ -0,0 +1,27 @@ +from textual.app import App, ComposeResult +from textual.widgets import Static + + +TEXT = """I must not fear. +Fear is the mind-killer. +Fear is the little-death that brings total obliteration. +I will face my fear. +I will permit it to pass over me and through me. +And when it has gone past, I will turn the inner eye to see its path. +Where the fear has gone there will be nothing. Only I will remain.""" + + +class PaddingApp(App): + def compose(self) -> ComposeResult: + self.widget = Static(TEXT) + yield self.widget + + def on_mount(self) -> None: + self.widget.styles.background = "purple" + self.widget.styles.width = 30 + self.widget.styles.padding = 2 + + +if __name__ == "__main__": + app = PaddingApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/styles/padding02.py b/testbed/Textualize__textual/docs/examples/guide/styles/padding02.py new file mode 100644 index 0000000000000000000000000000000000000000..50bf0b940cd3faadf6b9d82bdb320b9e0b324142 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/styles/padding02.py @@ -0,0 +1,27 @@ +from textual.app import App, ComposeResult +from textual.widgets import Static + + +TEXT = """I must not fear. +Fear is the mind-killer. +Fear is the little-death that brings total obliteration. +I will face my fear. +I will permit it to pass over me and through me. +And when it has gone past, I will turn the inner eye to see its path. +Where the fear has gone there will be nothing. Only I will remain.""" + + +class PaddingApp(App): + def compose(self) -> ComposeResult: + self.widget = Static(TEXT) + yield self.widget + + def on_mount(self) -> None: + self.widget.styles.background = "purple" + self.widget.styles.width = 30 + self.widget.styles.padding = (2, 4) + + +if __name__ == "__main__": + app = PaddingApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/styles/screen.py b/testbed/Textualize__textual/docs/examples/guide/styles/screen.py new file mode 100644 index 0000000000000000000000000000000000000000..5a7b85fd76c1edd9cd8b5f340451b886b7daab79 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/styles/screen.py @@ -0,0 +1,12 @@ +from textual.app import App + + +class ScreenApp(App): + def on_mount(self) -> None: + self.screen.styles.background = "darkblue" + self.screen.styles.border = ("heavy", "white") + + +if __name__ == "__main__": + app = ScreenApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/styles/widget.py b/testbed/Textualize__textual/docs/examples/guide/styles/widget.py new file mode 100644 index 0000000000000000000000000000000000000000..5abfaf8611b67f84d38628f1947a43a3517525a6 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/styles/widget.py @@ -0,0 +1,17 @@ +from textual.app import App, ComposeResult +from textual.widgets import Static + + +class WidgetApp(App): + def compose(self) -> ComposeResult: + self.widget = Static("Textual") + yield self.widget + + def on_mount(self) -> None: + self.widget.styles.background = "darkblue" + self.widget.styles.border = ("heavy", "white") + + +if __name__ == "__main__": + app = WidgetApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/widgets/fizzbuzz01.css b/testbed/Textualize__textual/docs/examples/guide/widgets/fizzbuzz01.css new file mode 100644 index 0000000000000000000000000000000000000000..ed041d2dc055b5c3e728179a70a0079a26907cad --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/widgets/fizzbuzz01.css @@ -0,0 +1,10 @@ +Screen { + align: center middle; +} + +FizzBuzz { + width: auto; + height: auto; + background: $primary; + color: $text; +} diff --git a/testbed/Textualize__textual/docs/examples/guide/widgets/fizzbuzz01.py b/testbed/Textualize__textual/docs/examples/guide/widgets/fizzbuzz01.py new file mode 100644 index 0000000000000000000000000000000000000000..129abdd074305bc3fdfc1f63a7c66b318d708dd4 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/widgets/fizzbuzz01.py @@ -0,0 +1,30 @@ +from rich.table import Table + +from textual.app import App, ComposeResult +from textual.widgets import Static + + +class FizzBuzz(Static): + def on_mount(self) -> None: + table = Table("Number", "Fizz?", "Buzz?") + for n in range(1, 16): + fizz = not n % 3 + buzz = not n % 5 + table.add_row( + str(n), + "fizz" if fizz else "", + "buzz" if buzz else "", + ) + self.update(table) + + +class FizzBuzzApp(App): + CSS_PATH = "fizzbuzz01.css" + + def compose(self) -> ComposeResult: + yield FizzBuzz() + + +if __name__ == "__main__": + app = FizzBuzzApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/widgets/fizzbuzz02.css b/testbed/Textualize__textual/docs/examples/guide/widgets/fizzbuzz02.css new file mode 100644 index 0000000000000000000000000000000000000000..a8fe581c1bfd65edeb77db2e2ad47ebf7439be78 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/widgets/fizzbuzz02.css @@ -0,0 +1,10 @@ +Screen { + align: center middle; +} + +FizzBuzz { + width: auto; + height: auto; + background: $primary; + color: $text; +} diff --git a/testbed/Textualize__textual/docs/examples/guide/widgets/fizzbuzz02.py b/testbed/Textualize__textual/docs/examples/guide/widgets/fizzbuzz02.py new file mode 100644 index 0000000000000000000000000000000000000000..58618aba5c2a2dfd47fb12a1ac7a1a15b03f434f --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/widgets/fizzbuzz02.py @@ -0,0 +1,35 @@ +from rich.table import Table + +from textual.app import App, ComposeResult +from textual.geometry import Size +from textual.widgets import Static + + +class FizzBuzz(Static): + def on_mount(self) -> None: + table = Table("Number", "Fizz?", "Buzz?", expand=True) + for n in range(1, 16): + fizz = not n % 3 + buzz = not n % 5 + table.add_row( + str(n), + "fizz" if fizz else "", + "buzz" if buzz else "", + ) + self.update(table) + + def get_content_width(self, container: Size, viewport: Size) -> int: + """Force content width size.""" + return 50 + + +class FizzBuzzApp(App): + CSS_PATH = "fizzbuzz02.css" + + def compose(self) -> ComposeResult: + yield FizzBuzz() + + +if __name__ == "__main__": + app = FizzBuzzApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/widgets/hello01.css b/testbed/Textualize__textual/docs/examples/guide/widgets/hello01.css new file mode 100644 index 0000000000000000000000000000000000000000..87b9fc77f0b4f85c82c7ef5251294bfda2b80a23 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/widgets/hello01.css @@ -0,0 +1,3 @@ +Screen { + align: center middle; +} diff --git a/testbed/Textualize__textual/docs/examples/guide/widgets/hello01.py b/testbed/Textualize__textual/docs/examples/guide/widgets/hello01.py new file mode 100644 index 0000000000000000000000000000000000000000..63918910b206f3c76fe8bc922fd5d588bc62ac2a --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/widgets/hello01.py @@ -0,0 +1,19 @@ +from textual.app import App, ComposeResult, RenderResult +from textual.widget import Widget + + +class Hello(Widget): + """Display a greeting.""" + + def render(self) -> RenderResult: + return "Hello, [b]World[/b]!" + + +class CustomApp(App): + def compose(self) -> ComposeResult: + yield Hello() + + +if __name__ == "__main__": + app = CustomApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/widgets/hello02.css b/testbed/Textualize__textual/docs/examples/guide/widgets/hello02.css new file mode 100644 index 0000000000000000000000000000000000000000..6a9503d69d1bf796b0ce9b9fd9a541ab14516bb3 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/widgets/hello02.css @@ -0,0 +1,13 @@ +Screen { + align: center middle; +} + +Hello { + width: 40; + height: 9; + padding: 1 2; + background: $panel; + color: $text; + border: $secondary tall; + content-align: center middle; +} diff --git a/testbed/Textualize__textual/docs/examples/guide/widgets/hello02.py b/testbed/Textualize__textual/docs/examples/guide/widgets/hello02.py new file mode 100644 index 0000000000000000000000000000000000000000..ffab9fd1b32e537d6208e0c4b58cba31231a92d0 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/widgets/hello02.py @@ -0,0 +1,21 @@ +from textual.app import App, ComposeResult, RenderResult +from textual.widget import Widget + + +class Hello(Widget): + """Display a greeting.""" + + def render(self) -> RenderResult: + return "Hello, [b]World[/b]!" + + +class CustomApp(App): + CSS_PATH = "hello02.css" + + def compose(self) -> ComposeResult: + yield Hello() + + +if __name__ == "__main__": + app = CustomApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/widgets/hello03.css b/testbed/Textualize__textual/docs/examples/guide/widgets/hello03.css new file mode 100644 index 0000000000000000000000000000000000000000..1e46fd41557cf5935d60c07a2532d6015484c97f --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/widgets/hello03.css @@ -0,0 +1,12 @@ +Screen { + align: center middle; +} + +Hello { + width: 40; + height: 9; + padding: 1 2; + background: $panel; + border: $secondary tall; + content-align: center middle; +} diff --git a/testbed/Textualize__textual/docs/examples/guide/widgets/hello03.py b/testbed/Textualize__textual/docs/examples/guide/widgets/hello03.py new file mode 100644 index 0000000000000000000000000000000000000000..62708a3e2e5d095941b85bea033ab1c34d0c159a --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/widgets/hello03.py @@ -0,0 +1,48 @@ +from itertools import cycle + +from textual.app import App, ComposeResult +from textual.widgets import Static + + +hellos = cycle( + [ + "Hola", + "Bonjour", + "Guten tag", + "Salve", + "Nǐn hǎo", + "Olá", + "Asalaam alaikum", + "Konnichiwa", + "Anyoung haseyo", + "Zdravstvuyte", + "Hello", + ] +) + + +class Hello(Static): + """Display a greeting.""" + + def on_mount(self) -> None: + self.next_word() + + def on_click(self) -> None: + self.next_word() + + def next_word(self) -> None: + """Get a new hello and update the content area.""" + hello = next(hellos) + self.update(f"{hello}, [b]World[/b]!") + + +class CustomApp(App): + CSS_PATH = "hello03.css" + + def compose(self) -> ComposeResult: + yield Hello() + + +if __name__ == "__main__": + app = CustomApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/widgets/hello04.css b/testbed/Textualize__textual/docs/examples/guide/widgets/hello04.css new file mode 100644 index 0000000000000000000000000000000000000000..87b9fc77f0b4f85c82c7ef5251294bfda2b80a23 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/widgets/hello04.css @@ -0,0 +1,3 @@ +Screen { + align: center middle; +} diff --git a/testbed/Textualize__textual/docs/examples/guide/widgets/hello04.py b/testbed/Textualize__textual/docs/examples/guide/widgets/hello04.py new file mode 100644 index 0000000000000000000000000000000000000000..450f2669717e7a538b89a98aa9abda9977cef0bf --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/widgets/hello04.py @@ -0,0 +1,59 @@ +from itertools import cycle + +from textual.app import App, ComposeResult +from textual.widgets import Static + + +hellos = cycle( + [ + "Hola", + "Bonjour", + "Guten tag", + "Salve", + "Nǐn hǎo", + "Olá", + "Asalaam alaikum", + "Konnichiwa", + "Anyoung haseyo", + "Zdravstvuyte", + "Hello", + ] +) + + +class Hello(Static): + """Display a greeting.""" + + DEFAULT_CSS = """ + Hello { + width: 40; + height: 9; + padding: 1 2; + background: $panel; + border: $secondary tall; + content-align: center middle; + } + """ + + def on_mount(self) -> None: + self.next_word() + + def on_click(self) -> None: + self.next_word() + + def next_word(self) -> None: + """Get a new hello and update the content area.""" + hello = next(hellos) + self.update(f"{hello}, [b]World[/b]!") + + +class CustomApp(App): + CSS_PATH = "hello03.css" + + def compose(self) -> ComposeResult: + yield Hello() + + +if __name__ == "__main__": + app = CustomApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/guide/widgets/hello05.css b/testbed/Textualize__textual/docs/examples/guide/widgets/hello05.css new file mode 100644 index 0000000000000000000000000000000000000000..1e46fd41557cf5935d60c07a2532d6015484c97f --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/widgets/hello05.css @@ -0,0 +1,12 @@ +Screen { + align: center middle; +} + +Hello { + width: 40; + height: 9; + padding: 1 2; + background: $panel; + border: $secondary tall; + content-align: center middle; +} diff --git a/testbed/Textualize__textual/docs/examples/guide/widgets/hello05.py b/testbed/Textualize__textual/docs/examples/guide/widgets/hello05.py new file mode 100644 index 0000000000000000000000000000000000000000..1430138b8621e559729d8236fa1ff819c73a86e5 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/guide/widgets/hello05.py @@ -0,0 +1,45 @@ +from itertools import cycle + +from textual.app import App, ComposeResult +from textual.widgets import Static + + +hellos = cycle( + [ + "Hola", + "Bonjour", + "Guten tag", + "Salve", + "Nǐn hǎo", + "Olá", + "Asalaam alaikum", + "Konnichiwa", + "Anyoung haseyo", + "Zdravstvuyte", + "Hello", + ] +) + + +class Hello(Static): + """Display a greeting.""" + + def on_mount(self) -> None: + self.action_next_word() + + def action_next_word(self) -> None: + """Get a new hello and update the content area.""" + hello = next(hellos) + self.update(f"[@click='next_word']{hello}[/], [b]World[/b]!") + + +class CustomApp(App): + CSS_PATH = "hello05.css" + + def compose(self) -> ComposeResult: + yield Hello() + + +if __name__ == "__main__": + app = CustomApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/styles/README.md b/testbed/Textualize__textual/docs/examples/styles/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8c804358252d20e8a1a46db136f6f1300c3bdd8a --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/README.md @@ -0,0 +1,9 @@ +These are the examples from the documentation, used to generate screenshots. + +You can run them with the textual CLI. + +For example: + +``` +textual run text_style.py +``` diff --git a/testbed/Textualize__textual/docs/examples/styles/align.css b/testbed/Textualize__textual/docs/examples/styles/align.css new file mode 100644 index 0000000000000000000000000000000000000000..a49af0571795873de82d1a0b084db388d7950b90 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/align.css @@ -0,0 +1,13 @@ +Screen { + align: center middle; +} + +.box { + width: 40; + height: 5; + margin: 1; + padding: 1; + background: green; + color: white 90%; + border: heavy white; +} diff --git a/testbed/Textualize__textual/docs/examples/styles/align.py b/testbed/Textualize__textual/docs/examples/styles/align.py new file mode 100644 index 0000000000000000000000000000000000000000..6abee37ce4febaa4cce1830a905677ddb0122329 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/align.py @@ -0,0 +1,11 @@ +from textual.app import App +from textual.widgets import Static + + +class AlignApp(App): + def compose(self): + yield Static("Vertical alignment with [b]Textual[/]", classes="box") + yield Static("Take note, browsers.", classes="box") + + +app = AlignApp(css_path="align.css") diff --git a/testbed/Textualize__textual/docs/examples/styles/background.css b/testbed/Textualize__textual/docs/examples/styles/background.css new file mode 100644 index 0000000000000000000000000000000000000000..27f8649d29a0337d5ee4d0a643cecb38ff86fae7 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/background.css @@ -0,0 +1,14 @@ +Static { + height: 1fr; + content-align: center middle; + color: white; +} +#static1 { + background: red; +} +#static2 { + background: rgb(0, 255, 0); +} +#static3 { + background: hsl(240, 100%, 50%); +} diff --git a/testbed/Textualize__textual/docs/examples/styles/background.py b/testbed/Textualize__textual/docs/examples/styles/background.py new file mode 100644 index 0000000000000000000000000000000000000000..cef306ddcc68bc48e710f0edd1071a3050adf36e --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/background.py @@ -0,0 +1,12 @@ +from textual.app import App +from textual.widgets import Static + + +class BackgroundApp(App): + def compose(self): + yield Static("Widget 1", id="static1") + yield Static("Widget 2", id="static2") + yield Static("Widget 3", id="static3") + + +app = BackgroundApp(css_path="background.css") diff --git a/testbed/Textualize__textual/docs/examples/styles/border.css b/testbed/Textualize__textual/docs/examples/styles/border.css new file mode 100644 index 0000000000000000000000000000000000000000..762430dc8200bfc3c16f9f99e575b4eba2c34f1d --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/border.css @@ -0,0 +1,25 @@ +Screen { + background: white; +} +Screen > Static { + height: 5; + content-align: center middle; + color: white; + margin: 1; + box-sizing: border-box; +} +#static1 { + background: red 20%; + color: red; + border: solid red; +} +#static2 { + background: green 20%; + color: green; + border: dashed green; +} +#static3 { + background: blue 20%; + color: blue; + border: tall blue; +} diff --git a/testbed/Textualize__textual/docs/examples/styles/border.py b/testbed/Textualize__textual/docs/examples/styles/border.py new file mode 100644 index 0000000000000000000000000000000000000000..4dbc8ef4fbfc2e96ee45aa93caa5315f0b1319ec --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/border.py @@ -0,0 +1,12 @@ +from textual.app import App +from textual.widgets import Static + + +class BorderApp(App): + def compose(self): + yield Static("My border is solid red", id="static1") + yield Static("My border is dashed green", id="static2") + yield Static("My border is tall blue", id="static3") + + +app = BorderApp(css_path="border.css") diff --git a/testbed/Textualize__textual/docs/examples/styles/box_sizing.css b/testbed/Textualize__textual/docs/examples/styles/box_sizing.css new file mode 100644 index 0000000000000000000000000000000000000000..38f55482dc67a5c4348772237d7001fe1ceb3468 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/box_sizing.css @@ -0,0 +1,17 @@ +Screen { + background: white; + color: black; +} +App Static { + background: blue 20%; + height: 5; + margin: 2; + padding: 1; + border: wide black; +} +#static1 { + box-sizing: border-box; +} +#static2 { + box-sizing: content-box; +} diff --git a/testbed/Textualize__textual/docs/examples/styles/box_sizing.py b/testbed/Textualize__textual/docs/examples/styles/box_sizing.py new file mode 100644 index 0000000000000000000000000000000000000000..32fc56c6be172fbc8e1aa23dda52c38f3d7e498b --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/box_sizing.py @@ -0,0 +1,11 @@ +from textual.app import App +from textual.widgets import Static + + +class BoxSizingApp(App): + def compose(self): + yield Static("I'm using border-box!", id="static1") + yield Static("I'm using content-box!", id="static2") + + +app = BoxSizingApp(css_path="box_sizing.css") diff --git a/testbed/Textualize__textual/docs/examples/styles/color.css b/testbed/Textualize__textual/docs/examples/styles/color.css new file mode 100644 index 0000000000000000000000000000000000000000..b5552495aecaaff602c7661e20276b849baa74c4 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/color.css @@ -0,0 +1,13 @@ +Static { + height:1fr; + content-align: center middle; +} +#static1 { + color: red; +} +#static2 { + color: rgb(0, 255, 0); +} +#static3 { + color: hsl(240, 100%, 50%) +} diff --git a/testbed/Textualize__textual/docs/examples/styles/color.py b/testbed/Textualize__textual/docs/examples/styles/color.py new file mode 100644 index 0000000000000000000000000000000000000000..26543b0a0402313ab806189fb9d2317eda5dacc6 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/color.py @@ -0,0 +1,12 @@ +from textual.app import App +from textual.widgets import Static + + +class ColorApp(App): + def compose(self): + yield Static("I'm red!", id="static1") + yield Static("I'm rgb(0, 255, 0)!", id="static2") + yield Static("I'm hsl(240, 100%, 50%)!", id="static3") + + +app = ColorApp(css_path="color.css") diff --git a/testbed/Textualize__textual/docs/examples/styles/content_align.css b/testbed/Textualize__textual/docs/examples/styles/content_align.css new file mode 100644 index 0000000000000000000000000000000000000000..7024809b09aafdd2625ed47b1a6c66375ae8fdc8 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/content_align.css @@ -0,0 +1,20 @@ +#box1 { + content-align: left top; + background: red; +} + +#box2 { + content-align: center middle; + background: green; +} + +#box3 { + content-align: right bottom; + background: blue; +} + +Static { + height: 1fr; + padding: 1; + color: white; +} diff --git a/testbed/Textualize__textual/docs/examples/styles/content_align.py b/testbed/Textualize__textual/docs/examples/styles/content_align.py new file mode 100644 index 0000000000000000000000000000000000000000..c0213c63e7f891178a5d768c6b4d0979758c8949 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/content_align.py @@ -0,0 +1,12 @@ +from textual.app import App +from textual.widgets import Static + + +class ContentAlignApp(App): + def compose(self): + yield Static("With [i]content-align[/] you can...", id="box1") + yield Static("...[b]Easily align content[/]...", id="box2") + yield Static("...Horizontally [i]and[/] vertically!", id="box3") + + +app = ContentAlignApp(css_path="content_align.css") diff --git a/testbed/Textualize__textual/docs/examples/styles/display.css b/testbed/Textualize__textual/docs/examples/styles/display.css new file mode 100644 index 0000000000000000000000000000000000000000..14bbf6fc4ddca46805a1fbbf42ff190863946b69 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/display.css @@ -0,0 +1,12 @@ +Screen { + background: green; +} +Static { + height: 5; + background: white; + color: blue; + border: heavy blue; +} +Static.remove { + display: none; +} diff --git a/testbed/Textualize__textual/docs/examples/styles/display.py b/testbed/Textualize__textual/docs/examples/styles/display.py new file mode 100644 index 0000000000000000000000000000000000000000..1e68c6e33da8ba14bfa6783fea50073799d13165 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/display.py @@ -0,0 +1,12 @@ +from textual.app import App +from textual.widgets import Static + + +class DisplayApp(App): + def compose(self): + yield Static("Widget 1") + yield Static("Widget 2", classes="remove") + yield Static("Widget 3") + + +app = DisplayApp(css_path="display.css") diff --git a/testbed/Textualize__textual/docs/examples/styles/grid.css b/testbed/Textualize__textual/docs/examples/styles/grid.css new file mode 100644 index 0000000000000000000000000000000000000000..aa31e81c18b698221c5226173c1e0910c1a39bcd --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/grid.css @@ -0,0 +1,20 @@ +Screen { + layout: grid; + grid-size: 3 4; + grid-rows: 1fr; + grid-columns: 1fr; + grid-gutter: 1; +} + +Static { + color: auto; + background: lightblue; + height: 100%; + padding: 1 2; +} + +#static1 { + tint: magenta 40%; + row-span: 3; + column-span: 2; +} diff --git a/testbed/Textualize__textual/docs/examples/styles/grid.py b/testbed/Textualize__textual/docs/examples/styles/grid.py new file mode 100644 index 0000000000000000000000000000000000000000..338af444c0ecbc9c8ed79e379757973efc9811fb --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/grid.py @@ -0,0 +1,18 @@ +from textual.app import App +from textual.widgets import Static + + +class GridApp(App): + def compose(self): + yield Static("Grid cell 1\n\nrow-span: 3;\ncolumn-span: 2;", id="static1") + yield Static("Grid cell 2", id="static2") + yield Static("Grid cell 3", id="static3") + yield Static("Grid cell 4", id="static4") + yield Static("Grid cell 5", id="static5") + yield Static("Grid cell 6", id="static6") + yield Static("Grid cell 7", id="static7") + + +app = GridApp(css_path="grid.css") +if __name__ == "__main__": + app.run() diff --git a/testbed/Textualize__textual/docs/examples/styles/height.css b/testbed/Textualize__textual/docs/examples/styles/height.css new file mode 100644 index 0000000000000000000000000000000000000000..5baabb27d7fab244d442247cd6af3062186d86cc --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/height.css @@ -0,0 +1,5 @@ +Screen > Widget { + background: green; + height: 50%; + color: white; +} diff --git a/testbed/Textualize__textual/docs/examples/styles/height.py b/testbed/Textualize__textual/docs/examples/styles/height.py new file mode 100644 index 0000000000000000000000000000000000000000..00e3963c40089a5d02b21faeaff80efbc3617859 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/height.py @@ -0,0 +1,10 @@ +from textual.app import App +from textual.widget import Widget + + +class HeightApp(App): + def compose(self): + yield Widget() + + +app = HeightApp(css_path="height.css") diff --git a/testbed/Textualize__textual/docs/examples/styles/layout.css b/testbed/Textualize__textual/docs/examples/styles/layout.css new file mode 100644 index 0000000000000000000000000000000000000000..b0f7e33850b6fc12ac3fa83e43f68ae7e0e5f390 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/layout.css @@ -0,0 +1,18 @@ +#vertical-layout { + layout: vertical; + background: darkmagenta; + height: auto; +} + +#horizontal-layout { + layout: horizontal; + background: darkcyan; + height: auto; +} + +Static { + margin: 1; + width: 12; + color: black; + background: yellowgreen; +} diff --git a/testbed/Textualize__textual/docs/examples/styles/layout.py b/testbed/Textualize__textual/docs/examples/styles/layout.py new file mode 100644 index 0000000000000000000000000000000000000000..f7c04e984408830a3a02740e510837f447bc2de7 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/layout.py @@ -0,0 +1,22 @@ +from textual.app import App +from textual.containers import Container +from textual.widgets import Static + + +class LayoutApp(App): + def compose(self): + yield Container( + Static("Layout"), + Static("Is"), + Static("Vertical"), + id="vertical-layout", + ) + yield Container( + Static("Layout"), + Static("Is"), + Static("Horizontal"), + id="horizontal-layout", + ) + + +app = LayoutApp(css_path="layout.css") diff --git a/testbed/Textualize__textual/docs/examples/styles/margin.css b/testbed/Textualize__textual/docs/examples/styles/margin.css new file mode 100644 index 0000000000000000000000000000000000000000..e1b01fa0306fb0ff5e5af76a18975ddad68dc17c --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/margin.css @@ -0,0 +1,10 @@ +Screen { + background: white; + color: black; +} + +Static { + margin: 4 8; + background: blue 20%; + border: blue wide; +} diff --git a/testbed/Textualize__textual/docs/examples/styles/margin.py b/testbed/Textualize__textual/docs/examples/styles/margin.py new file mode 100644 index 0000000000000000000000000000000000000000..3e6129ead8d116f88f86511e38baca30a12e6cf1 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/margin.py @@ -0,0 +1,18 @@ +from textual.app import App +from textual.widgets import Static + +TEXT = """I must not fear. +Fear is the mind-killer. +Fear is the little-death that brings total obliteration. +I will face my fear. +I will permit it to pass over me and through me. +And when it has gone past, I will turn the inner eye to see its path. +Where the fear has gone there will be nothing. Only I will remain.""" + + +class MarginApp(App): + def compose(self): + yield Static(TEXT) + + +app = MarginApp(css_path="margin.css") diff --git a/testbed/Textualize__textual/docs/examples/styles/offset.css b/testbed/Textualize__textual/docs/examples/styles/offset.css new file mode 100644 index 0000000000000000000000000000000000000000..d0a54a3550ab444b84e74754b56efbedaa19d7ec --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/offset.css @@ -0,0 +1,31 @@ +Screen { + background: white; + color: black; + layout: horizontal; +} +Static { + width: 20; + height: 10; + content-align: center middle; +} + +.paul { + offset: 8 2; + background: red 20%; + border: outer red; + color: red; +} + +.duncan { + offset: 4 10; + background: green 20%; + border: outer green; + color: green; +} + +.chani { + offset: 0 5; + background: blue 20%; + border: outer blue; + color: blue; +} diff --git a/testbed/Textualize__textual/docs/examples/styles/offset.py b/testbed/Textualize__textual/docs/examples/styles/offset.py new file mode 100644 index 0000000000000000000000000000000000000000..d850b3778768200ba392a57f11a687622ad88d10 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/offset.py @@ -0,0 +1,12 @@ +from textual.app import App +from textual.widgets import Static + + +class OffsetApp(App): + def compose(self): + yield Static("Paul (offset 8 2)", classes="paul") + yield Static("Duncan (offset 4 10)", classes="duncan") + yield Static("Chani (offset 0 5)", classes="chani") + + +app = OffsetApp(css_path="offset.css") diff --git a/testbed/Textualize__textual/docs/examples/styles/opacity.css b/testbed/Textualize__textual/docs/examples/styles/opacity.css new file mode 100644 index 0000000000000000000000000000000000000000..15d0594807cea73e3469cd44948092261aa04760 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/opacity.css @@ -0,0 +1,31 @@ +#zero-opacity { + opacity: 0%; +} + +#quarter-opacity { + opacity: 25%; +} + +#half-opacity { + opacity: 50%; +} + +#three-quarter-opacity { + opacity: 75%; +} + +#full-opacity { + opacity: 100%; +} + +Screen { + background: antiquewhite; +} + +Static { + height: 1fr; + border: outer dodgerblue; + background: lightseagreen; + content-align: center middle; + text-style: bold; +} diff --git a/testbed/Textualize__textual/docs/examples/styles/opacity.py b/testbed/Textualize__textual/docs/examples/styles/opacity.py new file mode 100644 index 0000000000000000000000000000000000000000..d723b1d8488e63909847febe3cfbd11f7c79cbcd --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/opacity.py @@ -0,0 +1,14 @@ +from textual.app import App +from textual.widgets import Static + + +class OpacityApp(App): + def compose(self): + yield Static("opacity: 0%", id="zero-opacity") + yield Static("opacity: 25%", id="quarter-opacity") + yield Static("opacity: 50%", id="half-opacity") + yield Static("opacity: 75%", id="three-quarter-opacity") + yield Static("opacity: 100%", id="full-opacity") + + +app = OpacityApp(css_path="opacity.css") diff --git a/testbed/Textualize__textual/docs/examples/styles/outline.css b/testbed/Textualize__textual/docs/examples/styles/outline.css new file mode 100644 index 0000000000000000000000000000000000000000..487270c6a1dc8307e20192621a11b845d1ae6238 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/outline.css @@ -0,0 +1,9 @@ +Screen { + background: white; + color: black; +} +Static { + margin: 4 8; + background: green 20%; + outline: wide green; +} diff --git a/testbed/Textualize__textual/docs/examples/styles/outline.py b/testbed/Textualize__textual/docs/examples/styles/outline.py new file mode 100644 index 0000000000000000000000000000000000000000..e64b11dc23e4985e8d972bb261bebc168ad917ce --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/outline.py @@ -0,0 +1,19 @@ +from textual.app import App +from textual.widgets import Static + + +TEXT = """I must not fear. +Fear is the mind-killer. +Fear is the little-death that brings total obliteration. +I will face my fear. +I will permit it to pass over me and through me. +And when it has gone past, I will turn the inner eye to see its path. +Where the fear has gone there will be nothing. Only I will remain.""" + + +class OutlineApp(App): + def compose(self): + yield Static(TEXT) + + +app = OutlineApp(css_path="outline.css") diff --git a/testbed/Textualize__textual/docs/examples/styles/overflow.css b/testbed/Textualize__textual/docs/examples/styles/overflow.css new file mode 100644 index 0000000000000000000000000000000000000000..27eaa81c1e312c8f64629524a7af26edd6247a37 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/overflow.css @@ -0,0 +1,20 @@ +Screen { + background: $background; + color: black; +} + +Vertical { + width: 1fr; +} + +Static { + margin: 1 2; + background: green 80%; + border: green wide; + color: white 90%; + height: auto; +} + +#right { + overflow-y: hidden; +} diff --git a/testbed/Textualize__textual/docs/examples/styles/overflow.py b/testbed/Textualize__textual/docs/examples/styles/overflow.py new file mode 100644 index 0000000000000000000000000000000000000000..b9a6c338319c1e8d20ceca439144f868b02e8216 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/overflow.py @@ -0,0 +1,22 @@ +from textual.app import App +from textual.widgets import Static +from textual.containers import Horizontal, Vertical + +TEXT = """I must not fear. +Fear is the mind-killer. +Fear is the little-death that brings total obliteration. +I will face my fear. +I will permit it to pass over me and through me. +And when it has gone past, I will turn the inner eye to see its path. +Where the fear has gone there will be nothing. Only I will remain.""" + + +class OverflowApp(App): + def compose(self): + yield Horizontal( + Vertical(Static(TEXT), Static(TEXT), Static(TEXT), id="left"), + Vertical(Static(TEXT), Static(TEXT), Static(TEXT), id="right"), + ) + + +app = OverflowApp(css_path="overflow.css") diff --git a/testbed/Textualize__textual/docs/examples/styles/padding.css b/testbed/Textualize__textual/docs/examples/styles/padding.css new file mode 100644 index 0000000000000000000000000000000000000000..4c558895b861c03408d428e218dfc51f63f234db --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/padding.css @@ -0,0 +1,9 @@ +Screen { + background: white; + color: blue; +} + +Static { + padding: 4 8; + background: blue 20%; +} diff --git a/testbed/Textualize__textual/docs/examples/styles/padding.py b/testbed/Textualize__textual/docs/examples/styles/padding.py new file mode 100644 index 0000000000000000000000000000000000000000..4893838c13a84d80418fe444b156df0259d53933 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/padding.py @@ -0,0 +1,18 @@ +from textual.app import App +from textual.widgets import Static + +TEXT = """I must not fear. +Fear is the mind-killer. +Fear is the little-death that brings total obliteration. +I will face my fear. +I will permit it to pass over me and through me. +And when it has gone past, I will turn the inner eye to see its path. +Where the fear has gone there will be nothing. Only I will remain.""" + + +class PaddingApp(App): + def compose(self): + yield Static(TEXT) + + +app = PaddingApp(css_path="padding.css") diff --git a/testbed/Textualize__textual/docs/examples/styles/scrollbar_gutter.css b/testbed/Textualize__textual/docs/examples/styles/scrollbar_gutter.css new file mode 100644 index 0000000000000000000000000000000000000000..ed62eb852ae0a827e31fc7bee016b7e57b988b47 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/scrollbar_gutter.css @@ -0,0 +1,8 @@ +Screen { + scrollbar-gutter: stable; +} + +#text-box { + color: floralwhite; + background: darkmagenta; +} diff --git a/testbed/Textualize__textual/docs/examples/styles/scrollbar_gutter.py b/testbed/Textualize__textual/docs/examples/styles/scrollbar_gutter.py new file mode 100644 index 0000000000000000000000000000000000000000..b847b3434be6b6a4437d60dac13ac4defb06cb5d --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/scrollbar_gutter.py @@ -0,0 +1,18 @@ +from textual.app import App +from textual.widgets import Static + +TEXT = """I must not fear. +Fear is the mind-killer. +Fear is the little-death that brings total obliteration. +I will face my fear. +I will permit it to pass over me and through me. +And when it has gone past, I will turn the inner eye to see its path. +Where the fear has gone there will be nothing. Only I will remain.""" + + +class ScrollbarGutterApp(App): + def compose(self): + yield Static(TEXT, id="text-box") + + +app = ScrollbarGutterApp(css_path="scrollbar_gutter.css") diff --git a/testbed/Textualize__textual/docs/examples/styles/scrollbar_size.css b/testbed/Textualize__textual/docs/examples/styles/scrollbar_size.css new file mode 100644 index 0000000000000000000000000000000000000000..b119f07a3e79930edde1e60817abc21d0a91838e --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/scrollbar_size.css @@ -0,0 +1,15 @@ +Screen { + background: white; + color: blue 80%; + layout: horizontal; +} + +Static { + padding: 1 2; + width: 200; +} + +.panel { + scrollbar-size: 10 4; + padding: 1 2; +} diff --git a/testbed/Textualize__textual/docs/examples/styles/scrollbar_size.py b/testbed/Textualize__textual/docs/examples/styles/scrollbar_size.py new file mode 100644 index 0000000000000000000000000000000000000000..97facad7088f1c798b9fcf705848c83a5d2347e3 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/scrollbar_size.py @@ -0,0 +1,20 @@ +from textual.app import App +from textual.containers import Vertical +from textual.widgets import Static + +TEXT = """I must not fear. +Fear is the mind-killer. +Fear is the little-death that brings total obliteration. +I will face my fear. +I will permit it to pass over me and through me. +And when it has gone past, I will turn the inner eye to see its path. +Where the fear has gone there will be nothing. Only I will remain. +""" + + +class ScrollbarApp(App): + def compose(self): + yield Vertical(Static(TEXT * 5), classes="panel") + + +app = ScrollbarApp(css_path="scrollbar_size.css") diff --git a/testbed/Textualize__textual/docs/examples/styles/scrollbars.css b/testbed/Textualize__textual/docs/examples/styles/scrollbars.css new file mode 100644 index 0000000000000000000000000000000000000000..8399bd077348d2bb5d7ac41b56a96235e0b63445 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/scrollbars.css @@ -0,0 +1,23 @@ +Screen { + background: #212121; + color: white 80%; + layout: horizontal; +} + +Static { + padding: 1 2; +} + +.panel1 { + width: 1fr; + scrollbar-color: green; + scrollbar-background: #bbb; + padding: 1 2; +} + +.panel2 { + width: 1fr; + scrollbar-color: yellow; + scrollbar-background: purple; + padding: 1 2; +} diff --git a/testbed/Textualize__textual/docs/examples/styles/scrollbars.py b/testbed/Textualize__textual/docs/examples/styles/scrollbars.py new file mode 100644 index 0000000000000000000000000000000000000000..f426c0d57ae0f5cb9ff9b3441696f7069ae6627d --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/scrollbars.py @@ -0,0 +1,21 @@ +from textual.app import App +from textual.containers import Vertical +from textual.widgets import Static + +TEXT = """I must not fear. +Fear is the mind-killer. +Fear is the little-death that brings total obliteration. +I will face my fear. +I will permit it to pass over me and through me. +And when it has gone past, I will turn the inner eye to see its path. +Where the fear has gone there will be nothing. Only I will remain. +""" + + +class ScrollbarApp(App): + def compose(self): + yield Vertical(Static(TEXT * 5), classes="panel1") + yield Vertical(Static(TEXT * 5), classes="panel2") + + +app = ScrollbarApp(css_path="scrollbars.css") diff --git a/testbed/Textualize__textual/docs/examples/styles/text_align.css b/testbed/Textualize__textual/docs/examples/styles/text_align.css new file mode 100644 index 0000000000000000000000000000000000000000..c594254d6b16790e3cc65951a93cf3b395b000c2 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/text_align.css @@ -0,0 +1,24 @@ +#one { + text-align: left; + background: lightblue; + +} + +#two { + text-align: center; + background: indianred; +} + +#three { + text-align: right; + background: palegreen; +} + +#four { + text-align: justify; + background: palevioletred; +} + +Static { + padding: 1; +} diff --git a/testbed/Textualize__textual/docs/examples/styles/text_align.py b/testbed/Textualize__textual/docs/examples/styles/text_align.py new file mode 100644 index 0000000000000000000000000000000000000000..27e2892fa5d30f18ca3253416b78e01aa7bee504 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/text_align.py @@ -0,0 +1,28 @@ +from __future__ import annotations + +from textual.app import App, ComposeResult +from textual.widgets import Static + +TEXT = ( + "I must not fear. Fear is the mind-killer. Fear is the little-death that " + "brings total obliteration. I will face my fear. I will permit it to pass over " + "me and through me." +) + + +class TextAlign(App): + def compose(self) -> ComposeResult: + left = Static("[b]Left aligned[/]\n" + TEXT, id="one") + yield left + + right = Static("[b]Center aligned[/]\n" + TEXT, id="two") + yield right + + center = Static("[b]Right aligned[/]\n" + TEXT, id="three") + yield center + + full = Static("[b]Justified[/]\n" + TEXT, id="four") + yield full + + +app = TextAlign(css_path="text_align.css") diff --git a/testbed/Textualize__textual/docs/examples/styles/text_opacity.css b/testbed/Textualize__textual/docs/examples/styles/text_opacity.css new file mode 100644 index 0000000000000000000000000000000000000000..882cc8acb3044dfb9965f00f3c9ec7595567ff27 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/text_opacity.css @@ -0,0 +1,25 @@ +#zero-opacity { + text-opacity: 0%; +} + +#quarter-opacity { + text-opacity: 25%; +} + +#half-opacity { + text-opacity: 50%; +} + +#three-quarter-opacity { + text-opacity: 75%; +} + +#full-opacity { + text-opacity: 100%; +} + +Static { + height: 1fr; + text-align: center; + text-style: bold; +} diff --git a/testbed/Textualize__textual/docs/examples/styles/text_opacity.py b/testbed/Textualize__textual/docs/examples/styles/text_opacity.py new file mode 100644 index 0000000000000000000000000000000000000000..a2e9dcff2e72613cf4b5c310c2300210c26ee172 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/text_opacity.py @@ -0,0 +1,14 @@ +from textual.app import App +from textual.widgets import Static + + +class TextOpacityApp(App): + def compose(self): + yield Static("text-opacity: 0%", id="zero-opacity") + yield Static("text-opacity: 25%", id="quarter-opacity") + yield Static("text-opacity: 50%", id="half-opacity") + yield Static("text-opacity: 75%", id="three-quarter-opacity") + yield Static("text-opacity: 100%", id="full-opacity") + + +app = TextOpacityApp(css_path="text_opacity.css") diff --git a/testbed/Textualize__textual/docs/examples/styles/text_style.css b/testbed/Textualize__textual/docs/examples/styles/text_style.css new file mode 100644 index 0000000000000000000000000000000000000000..bf953d42c627ee37da00057299400604068ff33d --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/text_style.css @@ -0,0 +1,18 @@ +Screen { + layout: horizontal; +} +Static { + width:1fr; +} +#static1 { + background: red 30%; + text-style: bold; +} +#static2 { + background: green 30%; + text-style: italic; +} +#static3 { + background: blue 30%; + text-style: reverse; +} diff --git a/testbed/Textualize__textual/docs/examples/styles/text_style.py b/testbed/Textualize__textual/docs/examples/styles/text_style.py new file mode 100644 index 0000000000000000000000000000000000000000..f9a59a76feecee3719ad7794ad6d788db7d67da7 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/text_style.py @@ -0,0 +1,20 @@ +from textual.app import App +from textual.widgets import Static + +TEXT = """I must not fear. +Fear is the mind-killer. +Fear is the little-death that brings total obliteration. +I will face my fear. +I will permit it to pass over me and through me. +And when it has gone past, I will turn the inner eye to see its path. +Where the fear has gone there will be nothing. Only I will remain.""" + + +class TextStyleApp(App): + def compose(self): + yield Static(TEXT, id="static1") + yield Static(TEXT, id="static2") + yield Static(TEXT, id="static3") + + +app = TextStyleApp(css_path="text_style.css") diff --git a/testbed/Textualize__textual/docs/examples/styles/tint.css b/testbed/Textualize__textual/docs/examples/styles/tint.css new file mode 100644 index 0000000000000000000000000000000000000000..6fa6a3a67da2a3958eb1ecee5d9c77cb5c53ebfb --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/tint.css @@ -0,0 +1,7 @@ +Static { + height: 3; + text-style: bold; + background: white; + color: black; + content-align: center middle; +} diff --git a/testbed/Textualize__textual/docs/examples/styles/tint.py b/testbed/Textualize__textual/docs/examples/styles/tint.py new file mode 100644 index 0000000000000000000000000000000000000000..44d816b0bb31d8e625fd9bd76b24300e59b57b7b --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/tint.py @@ -0,0 +1,15 @@ +from textual.app import App +from textual.color import Color +from textual.widgets import Static + + +class TintApp(App): + def compose(self): + color = Color.parse("green") + for tint_alpha in range(0, 101, 10): + widget = Static(f"tint: green {tint_alpha}%;") + widget.styles.tint = color.with_alpha(tint_alpha / 100) + yield widget + + +app = TintApp(css_path="tint.css") diff --git a/testbed/Textualize__textual/docs/examples/styles/visibility.css b/testbed/Textualize__textual/docs/examples/styles/visibility.css new file mode 100644 index 0000000000000000000000000000000000000000..349bb134540eaff28fa7a148047dbf4d17e2f5ef --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/visibility.css @@ -0,0 +1,12 @@ +Screen { + background: green; +} +Static { + height: 5; + background: white; + color: blue; + border: heavy blue; +} +Static.invisible { + visibility: hidden; +} diff --git a/testbed/Textualize__textual/docs/examples/styles/visibility.py b/testbed/Textualize__textual/docs/examples/styles/visibility.py new file mode 100644 index 0000000000000000000000000000000000000000..169cc80412416b325802310ddfc079684f4740f4 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/visibility.py @@ -0,0 +1,12 @@ +from textual.app import App +from textual.widgets import Static + + +class VisibilityApp(App): + def compose(self): + yield Static("Widget 1") + yield Static("Widget 2", classes="invisible") + yield Static("Widget 3") + + +app = VisibilityApp(css_path="visibility.css") diff --git a/testbed/Textualize__textual/docs/examples/styles/width.css b/testbed/Textualize__textual/docs/examples/styles/width.css new file mode 100644 index 0000000000000000000000000000000000000000..0f067e236310f8bd0b6c70c256c26d3be87a0df2 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/width.css @@ -0,0 +1,5 @@ +Screen > Widget { + background: green; + width: 50%; + color: white; +} diff --git a/testbed/Textualize__textual/docs/examples/styles/width.py b/testbed/Textualize__textual/docs/examples/styles/width.py new file mode 100644 index 0000000000000000000000000000000000000000..d70868231a9f9fdb11723ad23e48c14d7a6a530b --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/styles/width.py @@ -0,0 +1,10 @@ +from textual.app import App +from textual.widget import Widget + + +class WidthApp(App): + def compose(self): + yield Widget() + + +app = WidthApp(css_path="width.css") diff --git a/testbed/Textualize__textual/docs/examples/tutorial/intro01.py b/testbed/Textualize__textual/docs/examples/tutorial/intro01.py new file mode 100644 index 0000000000000000000000000000000000000000..6a2e2d4a1a9fafe550acc10cbcf0c21d4fcb7046 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/tutorial/intro01.py @@ -0,0 +1,9 @@ +from textual.app import App + + +class ExampleApp(App): + pass + + +app = ExampleApp() +app.run() diff --git a/testbed/Textualize__textual/docs/examples/tutorial/intro02.py b/testbed/Textualize__textual/docs/examples/tutorial/intro02.py new file mode 100644 index 0000000000000000000000000000000000000000..2f5d3ed64c9b0bc6254c1e8a0e2604f62e5d23fa --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/tutorial/intro02.py @@ -0,0 +1,29 @@ +from textual.app import App + + +class ExampleApp(App): + + COLORS = [ + "white", + "maroon", + "red", + "purple", + "fuchsia", + "olive", + "yellow", + "navy", + "teal", + "aqua", + ] + + def on_mount(self): + self.styles.background = "darkblue" + + def on_key(self, event): + if event.key.isdigit(): + self.styles.background = self.COLORS[int(event.key)] + self.bell() + + +app = ExampleApp() +app.run() diff --git a/testbed/Textualize__textual/docs/examples/tutorial/stopwatch.css b/testbed/Textualize__textual/docs/examples/tutorial/stopwatch.css new file mode 100644 index 0000000000000000000000000000000000000000..2bc514b002f7124a949cb1323b26a4bfce4d75c2 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/tutorial/stopwatch.css @@ -0,0 +1,53 @@ +Stopwatch { + layout: horizontal; + background: $boost; + height: 5; + min-width: 50; + margin: 1; + padding: 1; +} + +TimeDisplay { + content-align: center middle; + text-opacity: 60%; + height: 3; +} + +Button { + width: 16; +} + +#start { + dock: left; +} + +#stop { + dock: left; + display: none; +} + +#reset { + dock: right; +} + +.started { + text-style: bold; + background: $success; + color: $text; +} + +.started TimeDisplay { + text-opacity: 100%; +} + +.started #start { + display: none +} + +.started #stop { + display: block +} + +.started #reset { + visibility: hidden +} diff --git a/testbed/Textualize__textual/docs/examples/tutorial/stopwatch.py b/testbed/Textualize__textual/docs/examples/tutorial/stopwatch.py new file mode 100644 index 0000000000000000000000000000000000000000..ffb87ea4c2c6bad5b33bac47992c4f664929f0b1 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/tutorial/stopwatch.py @@ -0,0 +1,107 @@ +from time import monotonic + +from textual.app import App, ComposeResult +from textual.containers import Container +from textual.reactive import reactive +from textual.widgets import Button, Header, Footer, Static + + +class TimeDisplay(Static): + """A widget to display elapsed time.""" + + start_time = reactive(monotonic) + time = reactive(0.0) + total = reactive(0.0) + + def on_mount(self) -> None: + """Event handler called when widget is added to the app.""" + self.update_timer = self.set_interval(1 / 60, self.update_time, pause=True) + + def update_time(self) -> None: + """Method to update time to current.""" + self.time = self.total + (monotonic() - self.start_time) + + def watch_time(self, time: float) -> None: + """Called when the time attribute changes.""" + minutes, seconds = divmod(time, 60) + hours, minutes = divmod(minutes, 60) + self.update(f"{hours:02,.0f}:{minutes:02.0f}:{seconds:05.2f}") + + def start(self) -> None: + """Method to start (or resume) time updating.""" + self.start_time = monotonic() + self.update_timer.resume() + + def stop(self): + """Method to stop the time display updating.""" + self.update_timer.pause() + self.total += monotonic() - self.start_time + self.time = self.total + + def reset(self): + """Method to reset the time display to zero.""" + self.total = 0 + self.time = 0 + + +class Stopwatch(Static): + """A stopwatch widget.""" + + def on_button_pressed(self, event: Button.Pressed) -> None: + """Event handler called when a button is pressed.""" + button_id = event.button.id + time_display = self.query_one(TimeDisplay) + if button_id == "start": + time_display.start() + self.add_class("started") + elif button_id == "stop": + time_display.stop() + self.remove_class("started") + elif button_id == "reset": + time_display.reset() + + def compose(self) -> ComposeResult: + """Create child widgets of a stopwatch.""" + yield Button("Start", id="start", variant="success") + yield Button("Stop", id="stop", variant="error") + yield Button("Reset", id="reset") + yield TimeDisplay() + + +class StopwatchApp(App): + """A Textual app to manage stopwatches.""" + + CSS_PATH = "stopwatch.css" + + BINDINGS = [ + ("d", "toggle_dark", "Toggle dark mode"), + ("a", "add_stopwatch", "Add"), + ("r", "remove_stopwatch", "Remove"), + ] + + def compose(self) -> ComposeResult: + """Called to add widgets to the app.""" + yield Header() + yield Footer() + yield Container(Stopwatch(), Stopwatch(), Stopwatch(), id="timers") + + def action_add_stopwatch(self) -> None: + """An action to add a timer.""" + new_stopwatch = Stopwatch() + self.query_one("#timers").mount(new_stopwatch) + new_stopwatch.scroll_visible() + + def action_remove_stopwatch(self) -> None: + """Called to remove a timer.""" + timers = self.query("Stopwatch") + if timers: + timers.last().remove() + + def action_toggle_dark(self) -> None: + """An action to toggle dark mode.""" + self.dark = not self.dark + + +if __name__ == "__main__": + app = StopwatchApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/tutorial/stopwatch01.py b/testbed/Textualize__textual/docs/examples/tutorial/stopwatch01.py new file mode 100644 index 0000000000000000000000000000000000000000..9f9a76043f221bd0f032d888b91a5b21f2073202 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/tutorial/stopwatch01.py @@ -0,0 +1,22 @@ +from textual.app import App, ComposeResult +from textual.widgets import Header, Footer + + +class StopwatchApp(App): + """A Textual app to manage stopwatches.""" + + BINDINGS = [("d", "toggle_dark", "Toggle dark mode")] + + def compose(self) -> ComposeResult: + """Create child widgets for the app.""" + yield Header() + yield Footer() + + def action_toggle_dark(self) -> None: + """An action to toggle dark mode.""" + self.dark = not self.dark + + +if __name__ == "__main__": + app = StopwatchApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/tutorial/stopwatch02.css b/testbed/Textualize__textual/docs/examples/tutorial/stopwatch02.css new file mode 100644 index 0000000000000000000000000000000000000000..15b6c452346fd0ff76a90b999fdb9f020d039216 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/tutorial/stopwatch02.css @@ -0,0 +1 @@ +/* Blank for now */ diff --git a/testbed/Textualize__textual/docs/examples/tutorial/stopwatch02.py b/testbed/Textualize__textual/docs/examples/tutorial/stopwatch02.py new file mode 100644 index 0000000000000000000000000000000000000000..8baa3831e9ae836973395a30a2179e0297394feb --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/tutorial/stopwatch02.py @@ -0,0 +1,39 @@ +from textual.app import App, ComposeResult +from textual.containers import Container +from textual.widgets import Button, Header, Footer, Static + + +class TimeDisplay(Static): + """A widget to display elapsed time.""" + + +class Stopwatch(Static): + """A stopwatch widget.""" + + def compose(self) -> ComposeResult: + """Create child widgets of a stopwatch.""" + yield Button("Start", id="start", variant="success") + yield Button("Stop", id="stop", variant="error") + yield Button("Reset", id="reset") + yield TimeDisplay("00:00:00.00") + + +class StopwatchApp(App): + """A Textual app to manage stopwatches.""" + + BINDINGS = [("d", "toggle_dark", "Toggle dark mode")] + + def compose(self) -> ComposeResult: + """Create child widgets for the app.""" + yield Header() + yield Footer() + yield Container(Stopwatch(), Stopwatch(), Stopwatch()) + + def action_toggle_dark(self) -> None: + """An action to toggle dark mode.""" + self.dark = not self.dark + + +if __name__ == "__main__": + app = StopwatchApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/tutorial/stopwatch03.css b/testbed/Textualize__textual/docs/examples/tutorial/stopwatch03.css new file mode 100644 index 0000000000000000000000000000000000000000..b911dfeae82c45c546da0cd5c9460f960fb441b8 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/tutorial/stopwatch03.css @@ -0,0 +1,30 @@ +Stopwatch { + layout: horizontal; + background: $boost; + height: 5; + padding: 1; + margin: 1; +} + +TimeDisplay { + content-align: center middle; + text-opacity: 60%; + height: 3; +} + +Button { + width: 16; +} + +#start { + dock: left; +} + +#stop { + dock: left; + display: none; +} + +#reset { + dock: right; +} diff --git a/testbed/Textualize__textual/docs/examples/tutorial/stopwatch03.py b/testbed/Textualize__textual/docs/examples/tutorial/stopwatch03.py new file mode 100644 index 0000000000000000000000000000000000000000..0c455fecb121d144bc466558413a32e7a8ff9ae2 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/tutorial/stopwatch03.py @@ -0,0 +1,40 @@ +from textual.app import App, ComposeResult +from textual.containers import Container +from textual.widgets import Button, Header, Footer, Static + + +class TimeDisplay(Static): + """A widget to display elapsed time.""" + + +class Stopwatch(Static): + """A stopwatch widget.""" + + def compose(self) -> ComposeResult: + """Create child widgets of a stopwatch.""" + yield Button("Start", id="start", variant="success") + yield Button("Stop", id="stop", variant="error") + yield Button("Reset", id="reset") + yield TimeDisplay("00:00:00.00") + + +class StopwatchApp(App): + """A Textual app to manage stopwatches.""" + + CSS_PATH = "stopwatch03.css" + BINDINGS = [("d", "toggle_dark", "Toggle dark mode")] + + def compose(self) -> ComposeResult: + """Create child widgets for the app.""" + yield Header() + yield Footer() + yield Container(Stopwatch(), Stopwatch(), Stopwatch()) + + def action_toggle_dark(self) -> None: + """An action to toggle dark mode.""" + self.dark = not self.dark + + +if __name__ == "__main__": + app = StopwatchApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/tutorial/stopwatch04.css b/testbed/Textualize__textual/docs/examples/tutorial/stopwatch04.css new file mode 100644 index 0000000000000000000000000000000000000000..2bc514b002f7124a949cb1323b26a4bfce4d75c2 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/tutorial/stopwatch04.css @@ -0,0 +1,53 @@ +Stopwatch { + layout: horizontal; + background: $boost; + height: 5; + min-width: 50; + margin: 1; + padding: 1; +} + +TimeDisplay { + content-align: center middle; + text-opacity: 60%; + height: 3; +} + +Button { + width: 16; +} + +#start { + dock: left; +} + +#stop { + dock: left; + display: none; +} + +#reset { + dock: right; +} + +.started { + text-style: bold; + background: $success; + color: $text; +} + +.started TimeDisplay { + text-opacity: 100%; +} + +.started #start { + display: none +} + +.started #stop { + display: block +} + +.started #reset { + visibility: hidden +} diff --git a/testbed/Textualize__textual/docs/examples/tutorial/stopwatch04.py b/testbed/Textualize__textual/docs/examples/tutorial/stopwatch04.py new file mode 100644 index 0000000000000000000000000000000000000000..2394fd20ca74940f25c8c82951e22230cca0346a --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/tutorial/stopwatch04.py @@ -0,0 +1,47 @@ +from textual.app import App, ComposeResult +from textual.containers import Container +from textual.widgets import Button, Header, Footer, Static + + +class TimeDisplay(Static): + """A widget to display elapsed time.""" + + +class Stopwatch(Static): + """A stopwatch widget.""" + + def on_button_pressed(self, event: Button.Pressed) -> None: + """Event handler called when a button is pressed.""" + if event.button.id == "start": + self.add_class("started") + elif event.button.id == "stop": + self.remove_class("started") + + def compose(self) -> ComposeResult: + """Create child widgets of a stopwatch.""" + yield Button("Start", id="start", variant="success") + yield Button("Stop", id="stop", variant="error") + yield Button("Reset", id="reset") + yield TimeDisplay("00:00:00.00") + + +class StopwatchApp(App): + """A Textual app to manage stopwatches.""" + + CSS_PATH = "stopwatch04.css" + BINDINGS = [("d", "toggle_dark", "Toggle dark mode")] + + def compose(self) -> ComposeResult: + """Create child widgets for the app.""" + yield Header() + yield Footer() + yield Container(Stopwatch(), Stopwatch(), Stopwatch()) + + def action_toggle_dark(self) -> None: + """An action to toggle dark mode.""" + self.dark = not self.dark + + +if __name__ == "__main__": + app = StopwatchApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/tutorial/stopwatch05.py b/testbed/Textualize__textual/docs/examples/tutorial/stopwatch05.py new file mode 100644 index 0000000000000000000000000000000000000000..6543ac5ebc85e11e86700f929e364bdbbeb27ac8 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/tutorial/stopwatch05.py @@ -0,0 +1,67 @@ +from time import monotonic + +from textual.app import App, ComposeResult +from textual.containers import Container +from textual.reactive import reactive +from textual.widgets import Button, Header, Footer, Static + + +class TimeDisplay(Static): + """A widget to display elapsed time.""" + + start_time = reactive(monotonic) + time = reactive(0.0) + + def on_mount(self) -> None: + """Event handler called when widget is added to the app.""" + self.set_interval(1 / 60, self.update_time) + + def update_time(self) -> None: + """Method to update the time to the current time.""" + self.time = monotonic() - self.start_time + + def watch_time(self, time: float) -> None: + """Called when the time attribute changes.""" + minutes, seconds = divmod(time, 60) + hours, minutes = divmod(minutes, 60) + self.update(f"{hours:02,.0f}:{minutes:02.0f}:{seconds:05.2f}") + + +class Stopwatch(Static): + """A stopwatch widget.""" + + def on_button_pressed(self, event: Button.Pressed) -> None: + """Event handler called when a button is pressed.""" + if event.button.id == "start": + self.add_class("started") + elif event.button.id == "stop": + self.remove_class("started") + + def compose(self) -> ComposeResult: + """Create child widgets of a stopwatch.""" + yield Button("Start", id="start", variant="success") + yield Button("Stop", id="stop", variant="error") + yield Button("Reset", id="reset") + yield TimeDisplay() + + +class StopwatchApp(App): + """A Textual app to manage stopwatches.""" + + CSS_PATH = "stopwatch04.css" + BINDINGS = [("d", "toggle_dark", "Toggle dark mode")] + + def compose(self) -> ComposeResult: + """Create child widgets for the app.""" + yield Header() + yield Footer() + yield Container(Stopwatch(), Stopwatch(), Stopwatch()) + + def action_toggle_dark(self) -> None: + """An action to toggle dark mode.""" + self.dark = not self.dark + + +if __name__ == "__main__": + app = StopwatchApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/tutorial/stopwatch06.py b/testbed/Textualize__textual/docs/examples/tutorial/stopwatch06.py new file mode 100644 index 0000000000000000000000000000000000000000..e446d9798dc037ea1646adece5284e9a77c7e5a2 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/tutorial/stopwatch06.py @@ -0,0 +1,90 @@ +from time import monotonic + +from textual.app import App, ComposeResult +from textual.containers import Container +from textual.reactive import reactive +from textual.widgets import Button, Header, Footer, Static + + +class TimeDisplay(Static): + """A widget to display elapsed time.""" + + start_time = reactive(monotonic) + time = reactive(0.0) + total = reactive(0.0) + + def on_mount(self) -> None: + """Event handler called when widget is added to the app.""" + self.update_timer = self.set_interval(1 / 60, self.update_time, pause=True) + + def update_time(self) -> None: + """Method to update time to current.""" + self.time = self.total + (monotonic() - self.start_time) + + def watch_time(self, time: float) -> None: + """Called when the time attribute changes.""" + minutes, seconds = divmod(time, 60) + hours, minutes = divmod(minutes, 60) + self.update(f"{hours:02,.0f}:{minutes:02.0f}:{seconds:05.2f}") + + def start(self) -> None: + """Method to start (or resume) time updating.""" + self.start_time = monotonic() + self.update_timer.resume() + + def stop(self): + """Method to stop the time display updating.""" + self.update_timer.pause() + self.total += monotonic() - self.start_time + self.time = self.total + + def reset(self): + """Method to reset the time display to zero.""" + self.total = 0 + self.time = 0 + + +class Stopwatch(Static): + """A stopwatch widget.""" + + def on_button_pressed(self, event: Button.Pressed) -> None: + """Event handler called when a button is pressed.""" + button_id = event.button.id + time_display = self.query_one(TimeDisplay) + if button_id == "start": + time_display.start() + self.add_class("started") + elif button_id == "stop": + time_display.stop() + self.remove_class("started") + elif button_id == "reset": + time_display.reset() + + def compose(self) -> ComposeResult: + """Create child widgets of a stopwatch.""" + yield Button("Start", id="start", variant="success") + yield Button("Stop", id="stop", variant="error") + yield Button("Reset", id="reset") + yield TimeDisplay() + + +class StopwatchApp(App): + """A Textual app to manage stopwatches.""" + + CSS_PATH = "stopwatch04.css" + BINDINGS = [("d", "toggle_dark", "Toggle dark mode")] + + def compose(self) -> ComposeResult: + """Called to add widgets to the app.""" + yield Header() + yield Footer() + yield Container(Stopwatch(), Stopwatch(), Stopwatch()) + + def action_toggle_dark(self) -> None: + """An action to toggle dark mode.""" + self.dark = not self.dark + + +if __name__ == "__main__": + app = StopwatchApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/widgets/button.css b/testbed/Textualize__textual/docs/examples/widgets/button.css new file mode 100644 index 0000000000000000000000000000000000000000..5f1c906da3c50b5b34adfa487bd1e4761acea50e --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/widgets/button.css @@ -0,0 +1,12 @@ +Button { + margin: 1 2; +} + +Horizontal > Vertical { + width: 24; +} + +.header { + margin: 1 0 0 2; + text-style: bold; +} diff --git a/testbed/Textualize__textual/docs/examples/widgets/button.py b/testbed/Textualize__textual/docs/examples/widgets/button.py new file mode 100644 index 0000000000000000000000000000000000000000..b7958e18b645087c8d5aa50a8eb80717eb205688 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/widgets/button.py @@ -0,0 +1,36 @@ +from textual.app import App, ComposeResult +from textual.containers import Horizontal, Vertical +from textual.widgets import Button, Static + + +class ButtonsApp(App[str]): + CSS_PATH = "button.css" + + def compose(self) -> ComposeResult: + yield Horizontal( + Vertical( + Static("Standard Buttons", classes="header"), + Button("Default"), + Button("Primary!", variant="primary"), + Button.success("Success!"), + Button.warning("Warning!"), + Button.error("Error!"), + ), + Vertical( + Static("Disabled Buttons", classes="header"), + Button("Default", disabled=True), + Button("Primary!", variant="primary", disabled=True), + Button.success("Success!", disabled=True), + Button.warning("Warning!", disabled=True), + Button.error("Error!", disabled=True), + ), + ) + + def on_button_pressed(self, event: Button.Pressed) -> None: + self.app.bell() + self.exit(str(event.button)) + + +if __name__ == "__main__": + app = ButtonsApp() + print(app.run()) diff --git a/testbed/Textualize__textual/docs/examples/widgets/footer.py b/testbed/Textualize__textual/docs/examples/widgets/footer.py new file mode 100644 index 0000000000000000000000000000000000000000..47d9c9aa67b2c384ccf9987ac0a7363df88d492c --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/widgets/footer.py @@ -0,0 +1,15 @@ +from textual.app import App, ComposeResult +from textual.binding import Binding +from textual.widgets import Footer + + +class FooterApp(App): + BINDINGS = [Binding(key="q", action="quit", description="Quit the app")] + + def compose(self) -> ComposeResult: + yield Footer() + + +if __name__ == "__main__": + app = FooterApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/widgets/header.py b/testbed/Textualize__textual/docs/examples/widgets/header.py new file mode 100644 index 0000000000000000000000000000000000000000..d6617101a0d535637d883991df08c024dcfa2d7d --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/widgets/header.py @@ -0,0 +1,12 @@ +from textual.app import App, ComposeResult +from textual.widgets import Header + + +class HeaderApp(App): + def compose(self) -> ComposeResult: + yield Header() + + +if __name__ == "__main__": + app = HeaderApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/widgets/input.py b/testbed/Textualize__textual/docs/examples/widgets/input.py new file mode 100644 index 0000000000000000000000000000000000000000..3b315c571cba6dfd69d17183cff52e98aa730435 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/widgets/input.py @@ -0,0 +1,13 @@ +from textual.app import App, ComposeResult +from textual.widgets import Input + + +class InputApp(App): + def compose(self) -> ComposeResult: + yield Input(placeholder="First Name") + yield Input(placeholder="Last Name") + + +if __name__ == "__main__": + app = InputApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/widgets/static.py b/testbed/Textualize__textual/docs/examples/widgets/static.py new file mode 100644 index 0000000000000000000000000000000000000000..691334e4a65c286a49963f8665b6942eb83e2ae7 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/widgets/static.py @@ -0,0 +1,12 @@ +from textual.app import App, ComposeResult +from textual.widgets import Static + + +class StaticApp(App): + def compose(self) -> ComposeResult: + yield Static("Hello, world!") + + +if __name__ == "__main__": + app = StaticApp() + app.run() diff --git a/testbed/Textualize__textual/docs/examples/widgets/table.py b/testbed/Textualize__textual/docs/examples/widgets/table.py new file mode 100644 index 0000000000000000000000000000000000000000..87b2c0ce8b9d6ed5b28b8df5ef2e9f54a61e2462 --- /dev/null +++ b/testbed/Textualize__textual/docs/examples/widgets/table.py @@ -0,0 +1,29 @@ +import csv +import io + +from textual.app import App, ComposeResult +from textual.widgets import DataTable + +CSV = """lane,swimmer,country,time +4,Joseph Schooling,Singapore,50.39 +2,Michael Phelps,United States,51.14 +5,Chad le Clos,South Africa,51.14 +6,László Cseh,Hungary,51.14 +3,Li Zhuhao,China,51.26 +8,Mehdy Metella,France,51.58 +7,Tom Shields,United States,51.73 +1,Aleksandr Sadovnikov,Russia,51.84""" + + +class TableApp(App): + def compose(self) -> ComposeResult: + yield DataTable() + + def on_mount(self) -> None: + table = self.query_one(DataTable) + rows = csv.reader(io.StringIO(CSV)) + table.add_columns(*next(rows)) + table.add_rows(rows) + + +app = TableApp() diff --git a/testbed/Textualize__textual/docs/getting_started.md b/testbed/Textualize__textual/docs/getting_started.md new file mode 100644 index 0000000000000000000000000000000000000000..9ddf67e9aa0c81d192f2cf509bd45afd44abea93 --- /dev/null +++ b/testbed/Textualize__textual/docs/getting_started.md @@ -0,0 +1,49 @@ +All you need to get started building Textual apps. + +## Requirements + +Textual requires Python 3.7 or later (if you have a choice, pick the most recent Python). Textual runs on Linux, macOS, Windows and probably any OS where Python also runs. + +!!! info inline end "Your platform" + + ### :fontawesome-brands-linux: Linux (all distros) + + All Linux distros come with a terminal emulator that can run Textual apps. + + ### :material-apple: macOS + + The default terminal app is limited to 256 colors. We recommend installing a newer terminal such as [iterm2](https://iterm2.com/), [Kitty](https://sw.kovidgoyal.net/kitty/), or [WezTerm](https://wezfurlong.org/wezterm/). + + ### :material-microsoft-windows: Windows + + The new [Windows Terminal](https://apps.microsoft.com/store/detail/windows-terminal/9N0DX20HK701?hl=en-gb&gl=GB) runs Textual apps beautifully. + +## Installation + +You can install Textual via PyPI. + +If you plan on developing Textual apps, then you should install `textual[dev]`. The `[dev]` part installs a few extra dependencies for development. + +``` +pip install "textual[dev]==0.2.0b5" +``` + +If you only plan on _running_ Textual apps, then you can drop the `[dev]` part: + +``` +pip install textual==0.2.0b5 +``` + +!!! important + + There may be a more recent beta version since the time of writing. Check the [release history](https://pypi.org/project/textual/#history) for a more recent version. + +## Textual CLI + +If you installed the dev dependencies you have access to the `textual` CLI command. There are a number of sub-commands which will aid you in building Textual apps. + +```bash +textual --help +``` + +See [devtools](guide/devtools.md) for more about the `textual` command. diff --git a/testbed/Textualize__textual/docs/guide/CSS.md b/testbed/Textualize__textual/docs/guide/CSS.md new file mode 100644 index 0000000000000000000000000000000000000000..7bca457f8252424ef0bc80f1cd029ae8874644a6 --- /dev/null +++ b/testbed/Textualize__textual/docs/guide/CSS.md @@ -0,0 +1,430 @@ +# Textual CSS + +Textual uses CSS to apply style to widgets. If you have any exposure to web development you will have encountered CSS, but don't worry if you haven't: this chapter will get you up to speed. + +## Stylesheets + +CSS stands for _Cascading Stylesheets_. A stylesheet is a list of styles and rules about how those styles should be applied to a web page. In the case of Textual, the stylesheet applies [styles](./styles.md) to widgets but otherwise it is the same idea. + +When Textual loads CSS it sets attributes on your widgets' `style` object. The effect is the same as if you had set attributes in Python. + +CSS is typically stored in an external file with the extension `.css` alongside your Python code. + +Let's look at some Textual CSS. + +```sass +Header { + dock: top; + height: 3; + content-align: center middle; + background: blue; + color: white; +} +``` + +This is an example of a CSS _rule set_. There may be many such sections in any given CSS file. + +Let's break this CSS code down a bit. + +```sass hl_lines="1" +Header { + dock: top; + height: 3; + content-align: center middle; + background: blue; + color: white; +} +``` + +The first line is a _selector_ which tells Textual which widget(s) to modify. In the above example, the styles will be applied to a widget defined by the Python class `Header`. + +```sass hl_lines="2 3 4 5 6" +Header { + dock: top; + height: 3; + content-align: center middle; + background: blue; + color: white; +} +``` + +The lines inside the curly braces contains CSS _rules_, which consist of a rule name and rule value separated by a colon and ending in a semi-colon. Such rules are typically written one per line, but you could add additional rules as long as they are separated by semi-colons. + +The first rule in the above example reads `"dock: top;"`. The rule name is `dock` which tells Textual to place the widget on an edge of the screen. The text after the colon is `top` which tells Textual to dock to the _top_ of the screen. Other valid values for `dock` are "right", "bottom", or "left"; but "top" is most appropriate for a header. + +## The DOM + +The DOM, or _Document Object Model_, is a term borrowed from the web world. Textual doesn't use documents but the term has stuck. In Textual CSS, the DOM is an arrangement of widgets you can visualize as a tree-like structure. + +Some widgets contain other widgets: for instance, a list control widget will likely also have item widgets, or a dialog widget may contain button widgets. These _child_ widgets form the branches of the tree. + +Let's look at a trivial Textual app. + +=== "dom1.py" + + ```python + --8<-- "docs/examples/guide/dom1.py" + ``` + +=== "Output" + + ```{.textual path="docs/examples/guide/dom1.py"} + ``` + +This example creates an instance of `ExampleApp`, which will implicitly create a `Screen` object. In DOM terms, the `Screen` is a _child_ of `ExampleApp`. + +With the above example, the DOM will look like the following: + +
+--8<-- "docs/images/dom1.excalidraw.svg" +
+ +This doesn't look much like a tree yet. Let's add a header and a footer to this application, which will create more _branches_ of the tree: + +=== "dom2.py" + + ```python hl_lines="7 8" + --8<-- "docs/examples/guide/dom2.py" + ``` + + +=== "Output" + + ```{.textual path="docs/examples/guide/dom2.py"} + ``` + +With a header and a footer widget the DOM looks the this: + +
+--8<-- "docs/images/dom2.excalidraw.svg" +
+ +!!! note + + We've simplified the above example somewhat. Both the Header and Footer widgets contain children of their own. When building an app with pre-built widgets you rarely need to know how they are constructed unless you plan on changing the styles of individual components. + +Both Header and Footer are children of the Screen object. + +To further explore the DOM, we're going to build a simple dialog with a question and two buttons. To do this we're going import and use a few more builtin widgets: + +- `textual.layout.Container` For our top-level dialog. +- `textual.layout.Horizontal` To arrange widgets left to right. +- `textual.widgets.Static` For simple content. +- `textual.widgets.Button` For a clickable button. + +=== "dom3.py" + + ```python hl_lines="12 13 14 15 16 17 18 19 20" + --8<-- "docs/examples/guide/dom3.py" + ``` + +We've added a Container to our DOM which (as the name suggests) is a container for other widgets. The container has a number of other widgets passed as positional arguments which will be added as the children of the container. Not all widgets accept child widgets in this way. A Button widget doesn't require any children, for example. + +Here's the DOM created by the above code: + +
+--8<-- "docs/images/dom3.excalidraw.svg" +
+ +Here's the output from this example: + +```{.textual path="docs/examples/guide/dom3.py"} + +``` + +You may recognize some of the elements in the above screenshot, but it doesn't quite look like a dialog. This is because we haven't added a stylesheet. + +## CSS files + +To add a stylesheet set the `CSS_PATH` classvar to a relative path: + +```python hl_lines="9" +--8<-- "docs/examples/guide/dom4.py" +``` + +You may have noticed that some of the constructors have additional keyword arguments: `id` and `classes`. These are used by the CSS to identify parts of the DOM. We will cover these in the next section. + +Here's the CSS file we are applying: + +```sass +--8<-- "docs/examples/guide/dom4.css" +``` + +The CSS contains a number of rule sets with a selector and a list of rules. You can also add comments with text between `/*` and `*/` which will be ignored by Textual. Add comments to leave yourself reminders or to temporarily disable selectors. + +With the CSS in place, the output looks very different: + +```{.textual path="docs/examples/guide/dom4.py"} + +``` + +### Why CSS? + +It is reasonable to ask why use CSS at all? Python is a powerful and expressive language. Wouldn't it be easier to set styles in your `.py` files? + +A major advantage of CSS is that it separates how your app _looks_ from how it _works_. Setting styles in Python can generate a lot of spaghetti code which can make it hard to see the important logic in your application. + +A second advantage of CSS is that you can customize builtin and third-party widgets just as easily as you can your own app or widgets. + +Finally, Textual CSS allows you to _live edit_ the styles in your app. If you run your application with the following command, any changes you make to the CSS file will be instantly updated in the terminal: + +```bash +textual run my_app.py --dev +``` + +Being able to iterate on the design without restarting the application makes it easier and faster to design beautiful interfaces. + +## Selectors + +A selector is the text which precedes the curly braces in a set of rules. It tells Textual which widgets it should apply the rules to. + +Selectors can target a kind of widget or a very specific widget. For instance you could have a selector that modifies all buttons, or you could target an individual button used in one dialog. This gives you a lot of flexibility in customizing your user interface. + +Let's look at the selectors supported by Textual CSS. + +### Type selector + +The _type_ selector matches the name of the (Python) class. For example, the following widget can be matched with a `Button` selector: + +```python +from textual.widgets import Widget + +class Button(Static): + pass +``` + +The following rule applies a border to this widget: + +```sass +Button { + border: solid blue; +} +``` + +The type selector will also match a widget's base classes. Consequently a `Static` selector will also style the button because the `Button` Python class extends `Static`. + +```sass +Static { + background: blue; + border: rounded white; +} +``` + +!!! note + + The fact that the type selector matches base classes is a departure from browser CSS which doesn't have the same concept. + +You may have noticed that the `border` rule exists in both Static and Button. When this happens, Textual will use the most recently defined sub-class within a list of bases. So Button wins over Static, and Static wins over Widget (the base class of all widgets). Hence if both rules were in a stylesheet, the buttons would be "solid blue" and not "rounded white". + +### ID selector + +Every Widget can have a single `id` attribute, which is set via the constructor. The ID should be unique to it's container. + +Here's an example of a widget with an ID: + +```python +yield Button(id="next") +``` + +You can match an ID with a selector starting with a hash (`#`). Here is how you might draw a red outline around the above button: + +```sass +#next { + outline: red; +} +``` + +A Widget's `id` attribute can not be changed after the Widget has been constructed. + +### Class-name selector + +Every widget can have a number of class names applied. The term "class" here is borrowed from web CSS, and has a different meaning to a Python class. You can think of a CSS class as a tag of sorts. Widgets with the same tag will share styles. + +CSS classes are set via the widget's `classes` parameter in the constructor. Here's an example: + +```python +yield Button(classes="success") +``` + +This button will have a single class called `"success"` which we could target via CSS to make the button a particular color. + +You may also set multiple classes separated by spaces. For instance, here is a button with both an `error` class and a `disabled` class: + +```python +yield Button(classes="error disabled") +``` + +To match a Widget with a given class in CSS you can precede the class name with a dot (`.`). Here's a rule with a class selector to match the `"success"` class name: + +```sass +.success { + background: green; + color: white; +} +``` + +!!! note + + You can apply a class name to any widget, which means that widgets of different types could share classes. + +Class name selectors may be _chained_ together by appending another full stop and class name. The selector will match a widget that has _all_ of the class names set. For instance, the following sets a red background on widgets that have both `error` _and_ `disabled` class names. + +```sass +.error.disabled { + background: darkred; +} +``` + +Unlike the `id` attribute, a widget's classes can be changed after the widget was created. Adding and removing CSS classes is the recommended way of changing the display while your app is running. There are a few methods you can use to manage CSS classes. + +- [add_class()][textual.dom.DOMNode.add_class] Adds one or more classes to a widget. +- [remove_class()][textual.dom.DOMNode.remove_class] Removes class name(s) from a widget. +- [toggle_class()][textual.dom.DOMNode.toggle_class] Removes a class name if it is present, or adds the name if it's not already present. +- [has_class()][textual.dom.DOMNode.has_class] Checks if a class(es) is set on a widget. +- [classes][textual.dom.DOMNode.classes] Is a frozen set of the class(es) set on a widget. + + +### Universal selector + +The _universal_ selector is denoted by an asterisk and will match _all_ widgets. + +For example, the following will draw a red outline around all widgets: + +```sass +* { + outline: solid red; +} +``` + +### Pseudo classes + +Pseudo classes can be used to match widgets in a particular state. Psuedo classes are set automatically by Textual. For instance, you might want a button to have a green background when the mouse cursor moves over it. We can do this with the `:hover` pseudo selector. + +```sass +Button:hover { + background: green; +} +``` + +The `background: green` is only applied to the Button underneath the mouse cursor. When you move the cursor away from the button it will return to its previous background color. + +Here are some other pseudo classes: + +- `:focus` Matches widgets which have input focus. +- `:focus-within` Matches widgets with a focused a child widget. + +## Combinators + +More sophisticated selectors can be created by combining simple selectors. The logic used to combine selectors is know as a _combinator_. + +### Descendant combinator + +If you separate two selectors with a space it will match widgets with the second selector that have an ancestor that matches the first selector. + +Here's a section of DOM to illustrate this combinator: + +
+--8<-- "docs/images/descendant_combinator.excalidraw.svg" +
+ +Let's say we want to make the text of the buttons in the dialog bold, but we _don't_ want to change the Button in the sidebar. We can do this with the following rule: + +```sass hl_lines="1" +#dialog Button { + text-style: bold; +} +``` + +The `#dialog Button` selector matches all buttons that are below the widget with an ID of "dialog". No other buttons will be matched. + +As with all selectors, you can combine as many as you wish. The following will match a `Button` that is under a `Horizontal` widget _and_ under a widget with an id of `"dialog"`: + +```css +#dialog Horizontal Button { + text-style: bold; +} +``` + +### Child combinator + +The child combinator is similar to the descendant combinator but will only match an immediate child. To create a child combinator, separate two selectors with a greater than symbol (`>`). Any whitespace around the `>` will be ignored. + +Let's use this to match the Button in the sidebar given the following DOM: + +
+--8<-- "docs/images/child_combinator.excalidraw.svg" +
+ +We can use the following CSS to style all buttons which have a parent with an ID of `sidebar`: + +```sass +#sidebar > Button { + text-style: underline; +} +``` + +## Specificity + +It is possible that several selectors match a given widget. If the same style is applied by more than one selector then Textual needs a way to decide which rule _wins_. It does this by following these rules: + +- The selector with the most IDs wins. For instance `#next` beats `.button` and `#dialog #next` beats `#next`. If the selectors have the same number of IDs then move to the next rule. + +- The selector with the most class names wins. For instance `.button.success` beats `.success`. For the purposes of specificity, pseudo classes are treated the same as regular class names, so ".button:hover" counts as _2_ class names. If the selectors have the same number of class names then move to the next rule. + +- The selector with the most types wins. For instance `Container Button` beats `Button`. + +### Important rules + +The specificity rules are usually enough to fix any conflicts in your stylesheets. There is one last way of resolving conflicting selectors which applies to individual rules. If you add the text `!important` to the end of a rule then it will "win" regardless of the specificity. + +!!! warning + + Use `!important` sparingly (if at all) as it can make it difficult to modify your CSS in the future. + +Here's an example that makes buttons blue when hovered over with the mouse, regardless of any other selectors that match Buttons: + +```sass hl_lines="2" +Button:hover { + background: blue !important; +} +``` + +## CSS Variables + +You can define variables to reduce repetition and encourage consistency in your CSS. +Variables in Textual CSS are prefixed with `$`. +Here's an example of how you might define a variable called `$border`: + +```scss +$border: wide green; +``` + +With our variable assigned, we can write `$border` and it will be substituted with `wide green`. +Consider the following snippet: + +```scss +#foo { + border: $border; +} +``` + +This will be translated into: + +```scss +#foo { + border: wide green; +} +``` + +Variables allow us to define reusable styling in a single place. +If we decide we want to change some aspect of our design in the future, we only have to update a single variable. + +!!! note + + Variables can only be used in the _values_ of a CSS declaration. You cannot, for example, refer to a variable inside a selector. + +Variables can refer to other variables. +Let's say we define a variable `$success: lime;`. +Our `$border` variable could then be updated to `$border: wide $success;`, which will +be translated to `$border: wide lime;`. + diff --git a/testbed/Textualize__textual/docs/guide/actions.md b/testbed/Textualize__textual/docs/guide/actions.md new file mode 100644 index 0000000000000000000000000000000000000000..958f82a0dd9be586c6d91c684674c1a7a139a7f6 --- /dev/null +++ b/testbed/Textualize__textual/docs/guide/actions.md @@ -0,0 +1,160 @@ +# Actions + +Actions are allow-listed functions with a string syntax you can embed in links and bind to keys. In this chapter we will discuss how to create actions and how to run them. + +## Action methods + +Action methods are methods on your app or widgets prefixed with `action_`. Aside from the prefix these are regular methods which you could call directly if you wished. + +!!! information + + Action methods may be coroutines (defined with the `async` keyword). + +Let's write an app with a simple action. + +```python title="actions01.py" hl_lines="6-8 12" +--8<-- "docs/examples/guide/actions/actions01.py" +``` + +The `action_set_background` method is an action which sets the background of the screen. The key handler above will call this action if you press the ++r++ key. + +Although it is possible (and occasionally useful) to call action methods in this way, they are intended to be parsed from an _action string_. For instance, the string `"set_background('red')"` is an action string which would call `self.action_set_background('red')`. + +The following example replaces the immediate call with a call to [action()][textual.widgets.Widget.action] which parses an action string and dispatches it to the appropriate method. + +```python title="actions02.py" hl_lines="10-12" +--8<-- "docs/examples/guide/actions/actions02.py" +``` + +Note that the `action()` method is a coroutine so `on_key` needs to be prefixed with the `async` keyword. + +You will not typically need this in a real app as Textual will run actions in links or key bindings. Before we discuss these, let's have a closer look at the syntax for action strings. + +## Syntax + +Action strings have a simple syntax, which for the most part replicates Python's function call syntax. + +!!! important + + As much as they *look* like Python code, Textual does **not** call Python's `eval` function or similar to compile action strings. + +Action strings have the following format: + +- The name of an action on is own will call the action method with no parameters. For example, an action string of `"bell"` will call `action_bell()`. +- Actions may be followed by braces containing Python objects. For example, the action string `set_background("red")` will call `action_set_background("red")`. +- Actions may be prefixed with a _namespace_ (see below) follow by a dot. + +
+--8<-- "docs/images/actions/format.excalidraw.svg" +
+ +### Parameters + +If the action strings contains parameters, these must be valid Python literals. Which means you can include numbers, strings, dicts, lists etc. but you can't include variables or references to any other python symbols. + +Consequently `"set_background('blue')"` is a valid action string, but `"set_background(new_color)"` is not — because `new_color` is a variable and not a literal. + +## Links + +Actions may be embedded as links within console markup. You can create such links with a `@click` tag. + +The following example mounts simple static text with embedded action links. + +=== "actions03.py" + + ```python title="actions03.py" hl_lines="4-9 13-14" + --8<-- "docs/examples/guide/actions/actions03.py" + ``` + +=== "Output" + + ```{.textual path="docs/examples/guide/actions/actions03.py"} + ``` + +When you click any of the links, Textual runs the `"set_background"` action to change the background to the given color and plays the terminals bell. + +## Bindings + +Textual will also run actions bound to keys. The following example adds key [bindings](./input.md#bindings) for the ++r++, ++g++, and ++b++ keys which call the `"set_background"` action. + +=== "actions04.py" + + ```python title="actions04.py" hl_lines="13-17" + --8<-- "docs/examples/guide/actions/actions04.py" + ``` + +=== "Output" + + ```{.textual path="docs/examples/guide/actions/actions04.py" press="g"} + ``` + +If you run this example, you can change the background by pressing keys in addition to clicking links. + +## Namespaces + +Textual will look for action methods on the widget or app where they are used. If we were to create a [custom widget](./widgets.md#custom-widgets) it can have its own set of actions. + +The following example defines a custom widget with its own `set_background` action. + +=== "actions05.py" + + ```python title="actions05.py" hl_lines="13-14" + --8<-- "docs/examples/guide/actions/actions05.py" + ``` + +=== "actions05.css" + + ```sass title="actions05.css" + --8<-- "docs/examples/guide/actions/actions05.css" + ``` + +There are two instances of the custom widget mounted. If you click the links in either of them it will changed the background for that widget only. The ++r++, ++g++, and ++b++ key bindings are set on the App so will set the background for the screen. + +You can optionally prefix an action with a _namespace_, which tells Textual to run actions for a different object. + +Textual supports the following action namespaces: + +- `app` invokes actions on the App. +- `screen` invokes actions on the screen. + +In the previous example if you wanted a link to set the background on the app rather than the widget, we could set a link to `app.set_background('red')`. + + +## Builtin actions + +Textual supports the following builtin actions which are defined on the app. + + +### Bell + +::: textual.app.App.action_bell + options: + show_root_heading: false + +### Push screen + +::: textual.app.App.action_push_screen + + +### Pop screen + +::: textual.app.App.action_pop_screen + + +### Screenshot + +::: textual.app.App.action_screenshot + + +### Switch screen + +::: textual.app.App.action_switch_screen + + +### Toggle_dark + +::: textual.app.App.action_toggle_dark + +### Quit + +::: textual.app.App.action_quit diff --git a/testbed/Textualize__textual/docs/guide/animation.md b/testbed/Textualize__textual/docs/guide/animation.md new file mode 100644 index 0000000000000000000000000000000000000000..7768594d8f9976cbad402d0f39f21f47c321d907 --- /dev/null +++ b/testbed/Textualize__textual/docs/guide/animation.md @@ -0,0 +1,87 @@ +# Animation + +Ths chapter discusses how to use Textual's animation system to create visual effects such as movement, blending, and fading. + + +## Animating styles + +Textual's animator can change an attribute from one value to another in fixed increments over a period of time. You can apply animations to [styles](styles.md) such `offset` to move widgets around the screen, and `opacity` to create fading effects. + +Apps and widgets both have an [animate][textual.app.App.animate] method which will animate properties on those objects. Additionally, `styles` objects have an identical `animate` method which will animate styles. + +Let's look at an example of how we can animate the opacity of a widget to make it fade out. +The following example app contains a single `Static` widget which is immediately animated to an opacity of `0.0` (making it invisible) over a duration of two seconds. + +```python hl_lines="14" +--8<-- "docs/examples/guide/animator/animation01.py" +``` + +The animator updates the value of the `opacity` attribute on the `styles` object in small increments over two seconds. Here's what the output will look like after each half a second. + + +=== "After 0s" + + ```{.textual path="docs/examples/guide/animator/animation01_static.py"} + ``` + +=== "After 0.5s" + + ```{.textual path="docs/examples/guide/animator/animation01.py" press="wait:500"} + ``` + + +=== "After 1s" + + ```{.textual path="docs/examples/guide/animator/animation01.py" press="wait:1000"} + ``` + +=== "After 1.5s" + + ```{.textual path="docs/examples/guide/animator/animation01.py" press="wait:1500"} + ``` + +=== "After 2s" + + ```{.textual path="docs/examples/guide/animator/animation01.py" press="wait:2000"} + ``` + +## Duration and Speed + +When requesting an animation you can specify a *duration* or *speed*. +The duration is how long the animation should take in seconds. The speed is how many units a value should change in one second. +For instance, if you animate a value at 0 to 10 with a speed of 2, it will complete in 5 seconds. + +## Easing functions + +The easing function determines the journey a value takes on its way to the target value. +It could move at a constant pace, or it might start off slow then accelerate towards its final value. +Textual supports a number of [easing functions](https://easings.net/). + +
+--8<-- "docs/images/animation/animation.excalidraw.svg" +
+ + +Run the following from the command prompt to preview them. + +```bash +textual easing +``` + +You can specify which easing method to use via the `easing` parameter on the `animate` method. The default easing method is `"in_out_cubic"` which accelerates and then decelerates to produce a pleasing organic motion. + +!!! note + + The `textual easing` preview requires the `dev` extras to be installed (using `pip install textual[dev]`). + + +## Completion callbacks + +You can pass an callable to the animator via the `on_complete` parameter. Textual will run the callable when the animation has completed. + +## Delaying animations + +You can delay the start of an animation with the `delay` parameter of the `animate` method. +This parameter accepts a `float` value representing the number of seconds to delay the animation by. +For example, `self.box.styles.animate("opacity", value=0.0, duration=2.0, delay=5.0)` delays the start of the animation by five seconds, +meaning the animation will start after 5 seconds and complete 2 seconds after that. diff --git a/testbed/Textualize__textual/docs/guide/app.md b/testbed/Textualize__textual/docs/guide/app.md new file mode 100644 index 0000000000000000000000000000000000000000..1689895ef94e6f8f89a5f25789a4be2559324b90 --- /dev/null +++ b/testbed/Textualize__textual/docs/guide/app.md @@ -0,0 +1,187 @@ +# App Basics + +In this chapter we will cover how to use Textual's App class to create an application. Just enough to get you up to speed. We will go in to more detail in the following chapters. + +## The App class + +The first step in building a Textual app is to import the [App][textual.app.App] class and create a subclass. Let's look at the simplest app class: + +```python +--8<-- "docs/examples/app/simple01.py" +``` + + +### The run method + +To run an app we create an instance and call [run()][textual.app.App.run]. + +```python hl_lines="8-10" title="simple02.py" +--8<-- "docs/examples/app/simple02.py" +``` + +Apps don't get much simpler than this—don't expect it to do much. + +!!! tip + + The `__name__ == "__main__":` condition is true only if you run the file with `python` command. This allows us to import `app` without running the app immediately. It also allows the [devtools run](devtools.md#run) command to run the app in development mode. See the [Python docs](https://docs.python.org/3/library/__main__.html#idiomatic-usage) for more information. + +If we run this app with `python simple02.py` you will see a blank terminal, something like the following: + +```{.textual path="docs/examples/app/simple02.py"} +``` + +When you call [App.run()][textual.app.App.run] Textual puts the terminal in to a special state called *application mode*. When in application mode the terminal will no longer echo what you type. Textual will take over responding to user input (keyboard and mouse) and will update the visible portion of the terminal (i.e. the *screen*). + +If you hit ++ctrl+c++ Textual will exit application mode and return you to the command prompt. Any content you had in the terminal prior to application mode will be restored. + +!!! tip + + A side effect of application mode is that you may no longer be able to select and copy text in the usual way. Terminals typically offer a way to bypass this limit with a key modifier. On iTerm you can select text if you hold the ++option++ key. See the documentation for your terminal software for how to select text in application mode. + +## Events + +Textual has an event system you can use to respond to key presses, mouse actions, and internal state changes. Event handlers are methods prefixed with `on_` followed by the name of the event. + +One such event is the *mount* event which is sent to an application after it enters application mode. You can respond to this event by defining a method called `on_mount`. + +!!! info + + You may have noticed we use the term "send" and "sent" in relation to event handler methods in preference to "calling". This is because Textual uses a message passing system where events are passed (or *sent*) between components. See [events](./events.md) for details. + +Another such event is the *key* event which is sent when the user presses a key. The following example contains handlers for both those events: + +```python title="event01.py" +--8<-- "docs/examples/app/event01.py" +``` + +The `on_mount` handler sets the `self.screen.styles.background` attribute to `"darkblue"` which (as you can probably guess) turns the background blue. Since the mount event is sent immediately after entering application mode, you will see a blue screen when you run this code. + +```{.textual path="docs/examples/app/event01.py" hl_lines="23-25"} +``` + +The key event handler (`on_key`) has an `event` parameter which will receive a [Key][textual.events.Key] instance. Every event has an associated event object which will be passed to the handler method if it is present in the method's parameter list. + +!!! note + + It is unusual (but not unprecedented) for a method's parameters to affect how it is called. Textual accomplishes this by inspecting the method prior to calling it. + +Some events contain additional information you can inspect in the handler. The [Key][textual.events.Key] event has a `key` attribute which is the name of the key that was pressed. The `on_key` method above uses this attribute to change the background color if any of the keys from ++0++ to ++9++ are pressed. + +### Async events + +Textual is powered by Python's [asyncio](https://docs.python.org/3/library/asyncio.html) framework which uses the `async` and `await` keywords. + +Textual knows to *await* your event handlers if they are coroutines (i.e. prefixed with the `async` keyword). Regular functions are generally fine unless you plan on integrating other async libraries (such as [httpx](https://www.python-httpx.org/) for reading data from the internet). + +!!! tip + + For a friendly introduction to async programming in Python, see FastAPI's [concurrent burgers](https://fastapi.tiangolo.com/async/) article. + + +## Widgets + +Widgets are self-contained components responsible for generating the output for a portion of the screen. Widgets respond to events in much the same way as the App. Most apps that do anything interesting will contain at least one (and probably many) widgets which together form a User Interface. + +Widgets can be as simple as a piece of text, a button, or a fully-fledge component like a text editor or file browser (which may contain widgets of their own). + +### Composing + +To add widgets to your app implement a [`compose()`][textual.app.App.compose] method which should return an iterable of Widget instances. A list would work, but it is convenient to yield widgets, making the method a *generator*. + +The following example imports a builtin Welcome widget and yields it from `App.compose()`. + +```python title="widgets01.py" +--8<-- "docs/examples/app/widgets01.py" +``` + +When you run this code, Textual will *mount* the Welcome widget which contains Markdown content and a button: + +```{.textual path="docs/examples/app/widgets01.py"} +``` + +Notice the `on_button_pressed` method which handles the [Button.Pressed][textual.widgets.Button] event sent by a button contained in the Welcome widget. The handler calls [App.exit()][textual.app.App.exit] to exit the app. + +### Mounting + +While composing is the preferred way of adding widgets when your app starts it is sometimes necessary to add new widget(s) in response to events. You can do this by calling [mount()][textual.widget.Widget.mount] which will add a new widget to the UI. + +Here's an app which adds a welcome widget in response to any key press: + +```python title="widgets02.py" +--8<-- "docs/examples/app/widgets02.py" +``` + +When you first run this you will get a blank screen. Press any key to add the welcome widget. You can even press a key multiple times to add several widgets. + +```{.textual path="docs/examples/app/widgets02.py" press="a,a,a,down,down,down,down,down,down,_,_,_,_,_,_"} +``` + +### Exiting + +An app will run until you call [App.exit()][textual.app.App.exit] which will exit application mode and the [run][textual.app.App.run] method will return. If this is the last line in your code you will return to the command prompt. + +The exit method will also accept an optional positional value to be returned by `run()`. The following example uses this to return the `id` (identifier) of a clicked button. + +```python title="question01.py" +--8<-- "docs/examples/app/question01.py" +``` + +Running this app will give you the following: + +```{.textual path="docs/examples/app/question01.py"} +``` + +Clicking either of those buttons will exit the app, and the `run()` method will return either `"yes"` or `"no"` depending on button clicked. + +#### Return type + +You may have noticed that we subclassed `App[str]` rather than the usual `App`. + +```python title="question01.py" hl_lines="5" +--8<-- "docs/examples/app/question01.py" +``` + +The addition of `[str]` tells Mypy that `run()` is expected to return a string. It may also return `None` if [App.exit()][textual.app.App.exit] is called without a return value, so the return type of `run` will be `str | None`. Replace the `str` in `[str]` with the type of the value you intend to call the exit method with. + +!!! note + + Type annotations are entirely optional (but recommended) with Textual. + +## CSS + +Textual apps can reference [CSS](CSS.md) files which define how your app and widgets will look, while keeping your Python code free of display related code (which tends to be messy). + +The chapter on [Textual CSS](CSS.md) describes how to use CSS in detail. For now lets look at how your app references external CSS files. + +The following example enables loading of CSS by adding a `CSS_PATH` class variable: + +```python title="question02.py" hl_lines="6" +--8<-- "docs/examples/app/question02.py" +``` + +If the path is relative (as it is above) then it is taken as relative to where the app is defined. Hence this example references `"question01.css"` in the same directory as the Python code. Here is that CSS file: + +```sass title="question02.css" +--8<-- "docs/examples/app/question02.css" +``` + +When `"question02.py"` runs it will load `"question02.css"` and update the app and widgets accordingly. Even though the code is almost identical to the previous sample, the app now looks quite different: + +```{.textual path="docs/examples/app/question02.py"} +``` + +### Classvar CSS + +While external CSS files are recommended for most applications, and enable some cool features like *live editing*, you can also specify the CSS directly within the Python code. + +To do this set a `CSS` class variable on the app to a string containing your CSS. + +Here's the question app with classvar CSS: + +```python title="question03.py" hl_lines="6-24" +--8<-- "docs/examples/app/question03.py" +``` + +## What's next + +In the following chapter we will learn more about how to apply styles to you widgets and app. diff --git a/testbed/Textualize__textual/docs/guide/devtools.md b/testbed/Textualize__textual/docs/guide/devtools.md new file mode 100644 index 0000000000000000000000000000000000000000..fa835bba3dae75b33e93f61a1dd948aad2fc43e2 --- /dev/null +++ b/testbed/Textualize__textual/docs/guide/devtools.md @@ -0,0 +1,123 @@ +# Devtools + +!!! note inline end + + If you don't have the `textual` command on your path, you may have forgotten so install with the `dev` switch. + + See [getting started](../getting_started.md#installation) for details. + +Textual comes with a command line application of the same name. The `textual` command is a super useful tool that will help you to build apps. + +Take a moment to look through the available sub-commands. There will be even more helpful tools here in the future. + +```bash +textual --help +``` + + +## Run + +You can run Textual apps with the `run` subcommand. If you supply a path to a Python file it will load and run the application. + +```bash +textual run my_app.py +``` + +The `run` sub-command assumes you have an App instance called `app` in the global scope of your Python file. If the application is called something different, you can specify it with a colon following the filename: + +```bash +textual run my_app.py:alternative_app +``` + +!!! note + + If the Python file contains a call to app.run() then you can launch the file as you normally would any other Python program. Running your app via `textual run` will give you access to a few Textual features such as live editing of CSS files. + + +## Live editing + +If you combine the `run` command with the `--dev` switch your app will run in *development mode*. + +```bash +textual run --dev my_app.py +``` + +One of the the features of *dev* mode is live editing of CSS files: any changes to your CSS will be reflected in the terminal a few milliseconds later. + +This is a great feature for iterating on your app's look and feel. Open the CSS in your editor and have your app running in a terminal. Edits to your CSS will appear almost immediately after you save. + +## Console + +When building a typical terminal application you are generally unable to use `print` when debugging (or log to the console). This is because anything you write to standard output will overwrite application content. Textual has a solution to this in the form of a debug console which restores `print` and adds a few additional features to help you debug. + +To use the console, open up **two** terminal emulators. Run the following in one of the terminals: + +```bash +textual console +``` + +You should see the Textual devtools welcome message: + +```{.textual title="textual console" path="docs/examples/getting_started/console.py", press="_,_"} +``` + +In the other console, run your application with `textual run` and the `--dev` switch: + +```bash +textual run --dev my_app.py +``` + +Anything you `print` from your application will be displayed in the console window. Textual will also write log messages to this window which may be helpful when debugging your application. + + +### Verbosity + +Textual writes log messages to inform you about certain events, such as when the user presses a key or clicks on the terminal. To avoid swamping you with too much information, some events are marked as "verbose" and will be excluded from the logs. If you want to see these log messages, you can add the `-v` switch. + +```bash +textual console -v +``` + +## Textual log + +In addition to simple strings, Textual console supports [Rich](https://rich.readthedocs.io/en/latest/) formatting. To write rich logs, import `log` as follows: + +```python +from textual import log +``` + +This method will pretty print data structures (like lists and dicts) as well as [Rich renderables](https://rich.readthedocs.io/en/stable/protocol.html). Here are some examples: + +```python +log("Hello, World") # simple string +log(locals()) # Log local variables +log(children=self.children, pi=3.141592) # key/values +log(self.tree) # Rich renderables +``` + +Textual log messages may contain [console Markup](https://rich.readthedocs.io/en/stable/markup.html): + +```python +log("[bold red]DANGER![/] We're having too much fun") +``` + +### Log method + +There's a convenient shortcut to `log` available on the App and Widget objects. This is useful in event handlers. Here's an example: + +```python +from textual.app import App + +class LogApp(App): + + def on_load(self): + self.log("In the log handler!", pi=3.141529) + + def on_mount(self): + self.log(self.tree) + +if __name__ == "__main__": + LogApp.run() + +``` + diff --git a/testbed/Textualize__textual/docs/guide/events.md b/testbed/Textualize__textual/docs/guide/events.md new file mode 100644 index 0000000000000000000000000000000000000000..d5fb2fe6905d54b0e06312850553f398b554a5fb --- /dev/null +++ b/testbed/Textualize__textual/docs/guide/events.md @@ -0,0 +1,189 @@ +# Events and Messages + +We've used event handler methods in many of the examples in this guide. This chapter explores [events](../events/index.md) and messages (see below) in more detail. + +## Messages + +Events are a particular kind of *message* sent by Textual in response to input and other state changes. Events are reserved for use by Textual but you can also create custom messages for the purpose of coordinating between widgets in your app. + +More on that later, but for now keep in mind that events are also messages, and anything that is true of messages is true of events. + +## Message Queue + +Every [App][textual.app.App] and [Widget][textual.widget.Widget] object contains a *message queue*. You can think of a message queue as orders at a restaurant. The chef takes an order and makes the dish. Orders that arrive while the chef is cooking are placed in a line. When the chef has finished a dish they pick up the next order in the line. + +Textual processes messages in the same way. Messages are picked off a queue and processed (cooked) by a handler method. This guarantees messages and events are processed even if your code can not handle them right way. + +This processing of messages is done within an asyncio Task which is started when you mount the widget. The task monitors a queue for new messages and dispatches them to the appropriate handler when they arrive. + +!!! tip + + The FastAPI docs have an [excellent introduction](https://fastapi.tiangolo.com/async/) to Python async programming. + +By way of an example, let's consider what happens if you were to type "Text" in to a `Input` widget. When you hit the ++t++ key, Textual creates a [key][textual.events.Key] event and sends it to the widget's message queue. Ditto for ++e++, ++x++, and ++t++. + +The widget's task will pick the first message from the queue (a key event for the ++t++ key) and call the `on_key` method with the event as the first argument. In other words it will call `Input.on_key(event)`, which updates the display to show the new letter. + +
+--8<-- "docs/images/events/queue.excalidraw.svg" +
+ +When the `on_key` method returns, Textual will get the next event from the the queue and repeat the process for the remaining keys. At some point the queue will be empty and the widget is said to be in an *idle* state. + +!!! note + + This example illustrates a point, but a typical app will be fast enough to have processed a key before the next event arrives. So it is unlikely you will have so many key events in the message queue. + +
+--8<-- "docs/images/events/queue2.excalidraw.svg" +
+ + +## Default behaviors + +You may be familiar with Python's [super](https://docs.python.org/3/library/functions.html#super) function to call a function defined in a base class. You will not have to use this in event handlers as Textual will automatically call handler methods defined in a widget's base class(es). + +For instance, let's say we are building the classic game of Pong and we have written a `Paddle` widget which extends [Static][textual.widgets.Static]. When a [Key][textual.events.Key] event arrives, Textual calls `Paddle.on_key` (to respond to ++left++ and ++right++ keys), then `Static.on_key`, and finally `Widget.on_key`. + +### Preventing default behaviors + +If you don't want this behavior you can call [prevent_default()][textual.message.Message.prevent_default] on the event object. This tells Textual not to call any more handlers on base classes. + +!!! warning + + You won't need `prevent_default` very often. Be sure to know what your base classes do before calling it, or you risk disabling some core features builtin to Textual. + +## Bubbling + +Messages have a `bubble` attribute. If this is set to `True` then events will be sent to a widget's parent after processing. Input events typically bubble so that a widget will have the opportunity to respond to input events if they aren't handled by their children. + +The following diagram shows an (abbreviated) DOM for a UI with a container and two buttons. With the "No" button [focused](#), it will receive the key event first. + +
+--8<-- "docs/images/events/bubble1.excalidraw.svg" +
+ +After Textual calls `Button.on_key` the event _bubbles_ to the button's parent and will call `Container.on_key` (if it exists). + +
+--8<-- "docs/images/events/bubble2.excalidraw.svg" +
+ +As before, the event bubbles to it's parent (the App class). + +
+--8<-- "docs/images/events/bubble3.excalidraw.svg" +
+ +The App class is always the root of the DOM, so there is no where for the event to bubble to. + +### Stopping bubbling + +Event handlers may stop this bubble behavior by calling the [stop()][textual.message.Message.stop] method on the event or message. You might want to do this if a widget has responded to the event in an authoritative way. For instance when a text input widget responds to a key event it stops the bubbling so that the key doesn't also invoke a key binding. + +## Custom messages + +You can create custom messages for your application that may be used in the same way as events (recall that events are simply messages reserved for use by Textual). + +The most common reason to do this is if you are building a custom widget and you need to inform a parent widget about a state change. + +Let's look at an example which defines a custom message. The following example creates color buttons which—when clicked—send a custom message. + +=== "custom01.py" + + ```python title="custom01.py" hl_lines="10-15 27-29 42-43" + --8<-- "docs/examples/events/custom01.py" + ``` +=== "Output" + + ```{.textual path="docs/examples/events/custom01.py"} + ``` + + +Note the custom message class which extends [Message][textual.message.Message]. The constructor stores a [color][textual.color.Color] object which handler methods will be able to inspect. + +The message class is defined within the widget class itself. This is not strictly required but recommended, for these reasons: + +- It reduces the amount of imports. If you import `ColorButton`, you have access to the message class via `ColorButton.Selected`. +- It creates a namespace for the handler. So rather than `on_selected`, the handler name becomes `on_color_button_selected`. This makes it less likely that your chosen name will clash with another message. + + +## Sending events + +In the previous example we used [emit()][textual.message_pump.MessagePump.emit] to send an event to it's parent. We could also have used [emit_no_wait()][textual.message_pump.MessagePump.emit_no_wait] for non async code. Sending messages in this way allows you to write custom widgets without needing to know in what context they will be used. + +There are other ways of sending (posting) messages, which you may need to use less frequently. + +- [post_message][textual.message_pump.MessagePump.post_message] To post a message to a particular widget. +- [post_message_no_wait][textual.message_pump.MessagePump.post_message_no_wait] The non-async version of `post_message`. + + +## Message handlers + +Most of the logic in a Textual app will be written in message handlers. Let's explore handlers in more detail. + +### Handler naming + +Textual uses the following scheme to map messages classes on to a Python method. + +- Start with `"on_"`. +- Add the messages namespace (if any) converted from CamelCase to snake_case plus an underscore `"_"` +- Add the name of the class converted from CamelCase to snake_case. + +
+--8<-- "docs/images/events/naming.excalidraw.svg" +
+ +### Handler arguments + +Message handler methods can be written with or without a positional argument. If you add a positional argument, Textual will call the handler with the event object. The following handler (taken from custom01.py above) contains a `message` parameter. The body of the code makes use of the message to set a preset color. + +```python + def on_color_button_selected(self, message: ColorButton.Selected) -> None: + self.screen.styles.animate("background", message.color, duration=0.5) +``` + +If the body of your handler doesn't require any information in the message you can omit it from the method signature. If we just want to play a bell noise when the button is clicked, we could write our handler like this: + +```python + def on_color_button_selected(self) -> None: + self.app.bell() +``` + +This pattern is a convenience that saves writing out a parameter that may not be used. + +### Async handlers + +Message handlers may be coroutines. If you prefix your handlers with the `async` keyword, Textual will `await` them. This lets your handler use the `await` keyword for asynchronous APIs. + +If your event handlers are coroutines it will allow multiple events to be processed concurrently, but bear in mind an individual widget (or app) will not be able to pick up a new message from its message queue until the handler has returned. This is rarely a problem in practice; as long has handlers return within a few milliseconds the UI will remain responsive. But slow handlers might make your app hard to use. + +!!! info + + To re-use the chef analogy, if an order comes in for beef wellington (which takes a while to cook), orders may start to pile up and customers may have to wait for their meal. The solution would be to have another chef work on the wellington while the first chef picks up new orders. + +Network access is a common cause of slow handlers. If you try to retrieve a file from the internet, the message handler may take anything up to a few seconds to return, which would prevent the widget or app from updating during that time. The solution is to launch a new asyncio task to do the network task in the background. + +Let's look at an example which looks up word definitions from an [api](https://dictionaryapi.dev/) as you type. + +!!! note + + You will need to install [httpx](https://www.python-httpx.org/) with `pip install httpx` to run this example. + +=== "dictionary.py" + + ```python title="dictionary.py" hl_lines="27" + --8<-- "docs/examples/events/dictionary.py" + ``` +=== "dictionary.css" + + ```python title="dictionary.css" + --8<-- "docs/examples/events/dictionary.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/events/dictionary.py" press="tab,t,e,x,t,_,_,_,_,_,_,_,_,_,_,_"} + ``` + +Note the highlighted line in the above code which calls `asyncio.create_task` to run coroutine in the background. Without this you would find typing in to the text box to be unresponsive. diff --git a/testbed/Textualize__textual/docs/guide/index.md b/testbed/Textualize__textual/docs/guide/index.md new file mode 100644 index 0000000000000000000000000000000000000000..412a09b13410dcda40bd880734a3aedb911e94c6 --- /dev/null +++ b/testbed/Textualize__textual/docs/guide/index.md @@ -0,0 +1,9 @@ +# Textual Guide + +Welcome to the Textual Guide! An in-depth reference on how to build apps with Textual. + +## Example code + +Most of the code in this guide is fully working—you could cut and paste it if you wanted to. + +Although it is probably easier to check out the [Textual repository](https://github.com/Textualize/textual) and navigate to the `docs/examples/guide` directory and run the examples from there. diff --git a/testbed/Textualize__textual/docs/guide/input.md b/testbed/Textualize__textual/docs/guide/input.md new file mode 100644 index 0000000000000000000000000000000000000000..7c0ac92374e99cb5f945232a85bbe5f4b5b925e2 --- /dev/null +++ b/testbed/Textualize__textual/docs/guide/input.md @@ -0,0 +1,207 @@ +# Input + +This chapter will discuss how to make your app respond to input in the form of key presses and mouse actions. + +!!! quote + + More Input! + + — Johnny Five + +## Keyboard input + +The most fundamental way to receive input in via [Key](./events/key) events. Let's write an app to show key events as you type. + +=== "key01.py" + + ```python title="key01.py" hl_lines="12-13" + --8<-- "docs/examples/guide/input/key01.py" + ``` + +=== "Output" + + ```{.textual path="docs/examples/guide/input/key01.py", press="T,e,x,t,u,a,l,!,_"} + ``` + +Note the key event handler on the app which logs all key events. if you press any key it will show up on the screen. + +### Attributes + +There are two main attributes on a key event. The `key` attribute is the _name_ of the key which may be a single character, or a longer identifier. Textual ensures that the `key` attribute could always be used in a method name. + +Key events also contain a `char` attribute which contains single character if it is printable, or ``None`` if it is not printable (like a function key which has no corresponding character). + +To illustrate the difference between `key` and `char`, try `key01.py` with the space key. You should see something like the following: + +```{.textual path="docs/examples/guide/input/key01.py", press="space,_"} + +``` + +Note that the `key` attribute contains the word "space" while the `char` attribute contains a literal space. + +### Key methods + +Textual offers a convenient way of handling specific keys. If you create a method beginning with `key_` followed by the name of a key, then that method will be called in response to the key. + +Let's add a key method to the example code. + +```python title="key02.py" hl_lines="15-16" +--8<-- "docs/examples/guide/input/key01.py" +``` + +Note the addition of a `key_space` method which is called in response to the space key, and plays the terminal bell noise. + +!!! note + + Consider key methods to be a convenience for experimenting with Textual features. In nearly all cases, key [bindings](#bindings) and [actions](../guide/actions.md) are preferable. + +## Input focus + +Only a single widget may receive key events at a time. The widget which is actively receiving key events is said to have input _focus_. + +The following example shows how focus works in practice. + +=== "key03.py" + + ```python title="key03.py" hl_lines="16-20" + --8<-- "docs/examples/guide/input/key03.py" + ``` + +=== "key03.css" + + ```python title="key03.css" hl_lines="15-17" + --8<-- "docs/examples/guide/input/key03.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/guide/input/key03.py", press="tab,H,e,l,l,o,tab,W,o,r,l,d,!,_"} + ``` + +The app splits the screen in to quarters, with a TextLog widget in each quarter. If you click any of the text logs, you should see that it is highlighted to show that thw widget has focus. Key events will be sent to the focused widget only. + +!!! tip + + the `:focus` CSS pseudo-selector can be used to apply a style to the focused widget. + +You can move focus by pressing the ++tab++ key to focus the next widget. Pressing ++shift+tab++ moves the focus in the opposite direction. + +### Controlling focus + +Textual will handle keyboard focus automatically, but you can tell Textual to focus a widget by calling the widget's [focus()][textual.widget.Widget.focus] method. + +### Focus events + +When a widget receives focus, it is sent a [Focus](../events/focus.md) event. When a widget loses focus it is sent a [Blur](../events/blur.md) event. + +## Bindings + +Keys may be associated with [actions](../guide/actions.md) for a given widget. This association is known as a key _binding_. + +To create bindings, add a `BINDINGS` class variable to your app or widget. This should be a list of tuples of three strings. +The first value is the key, the second is the action, the third value is a short human readable description. + +The following example binds the keys ++r++, ++g++, and ++b++ to an action which adds a bar widget to the screen. + +=== "binding01.py" + + ```python title="binding01.py" hl_lines="13-17" + --8<-- "docs/examples/guide/input/binding01.py" + ``` + +=== "binding01.css" + + ```python title="binding01.css" + --8<-- "docs/examples/guide/input/binding01.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/guide/input/binding01.py", press="r,g,b,b"} + ``` + +Note how the footer displays bindings and makes them clickable. + +!!! tip + + Multiple keys can be bound to a single action by comma-separating them. + For example, `("r,t", "add_bar('red')", "Add Red")` means both ++r++ and ++t++ are bound to `add_bar('red')`. + +### Binding class + +The tuple of three strings may be enough for simple bindings, but you can also replace the tuple with a [Binding][textual.binding.Binding] instance which exposes a few more options. + +### Why use bindings? + +Bindings are particularly useful for configurable hot-keys. Bindings can also be inspected in widgets such as [Footer](../widgets/footer.md). + +In a future version of Textual it will also be possible to specify bindings in a configuration file, which will allow users to override app bindings. + +## Mouse Input + +Textual will send events in response to mouse movement and mouse clicks. These events contain the coordinates of the mouse cursor relative to the terminal or widget. + +!!! information + + The trackpad (and possibly other pointer devices) are treated the same as the mouse in terminals. + +Terminal coordinates are given by a pair values named `x` and `y`. The X coordinate is an offset in characters, extending from the left to the right of the screen. The Y coordinate is an offset in _lines_, extending from the top of the screen to the bottom. + +Coordinates may be relative to the screen, so `(0, 0)` would be the top left of the screen. Coordinates may also be relative to a widget, where `(0, 0)` would be the top left of the widget itself. + + +
+--8<-- "docs/images/input/coords.excalidraw.svg" +
+ +### Mouse movements + +When you move the mouse cursor over a widget it will receive [MouseMove](../events/mouse_move.md) events which contain the coordinate of the mouse and information about what modified keys (++ctrl++, ++shift++ etc). + +The following example shows mouse movements being used to _attach_ a widget to the mouse cursor. + +=== "mouse01.py" + + ```python title="mouse01.py" hl_lines="11-13" + --8<-- "docs/examples/guide/input/mouse01.py" + ``` + +=== "mouse01.css" + + ```python title="mouse01.css" + --8<-- "docs/examples/guide/input/mouse01.css" + ``` + +If you run `mouse01.py` you should find that it logs the mouse move event, and keeps a widget pinned directly under the cursor. + +The `on_mouse_move` handler sets the [offset](../styles/offset.md) style of the ball (a rectangular one) to match the mouse coordinates. + +### Mouse capture + +In the `mouse01.py` example there was a call to `capture_mouse()` in the mount handler. Textual will send mouse move events to the widget directly under the cursor. You can tell Textual to send all mouse events to a widget regardless of the position of the mouse cursor by calling [capture_mouse][textual.widget.Widget.capture_mouse]. + +Call [release_mouse][textual.widget.Widget.release_mouse] to restore the default behavior. + +!!! warning + + If you capture the mouse, be aware you might get negative mouse coordinates if the cursor is to the left of the widget. + +Textual will send a [MouseCapture](../events/mouse_capture.md) event when the mouse is captured, and a [MouseRelease](../events/mouse_release.md) event when it is released. + +### Enter and Leave events + +Textual will send a [Enter](../events/enter.md) event to a widget when the mouse cursor first moves over it, and a [Leave](../events/leave) event when the cursor moves off a widget. + +### Click events + +There are three events associated with clicking a button on your mouse. When the button is initially pressed, Textual sends a [MouseDown](../events/mouse_down.md) event, followed by [MouseUp](../events/mouse_up.md) when the button is released. Textual then sends a final [Click](../events/click.md) event. + +If you want your app to respond to a mouse click you should prefer the Click event (and not MouseDown or MouseUp). This is because a future version of Textual may support other pointing devices which don't have up and down states. + +### Scroll events + +Most mice have a scroll wheel which you can use to scroll window underneath the cursor. Scrollable containers in Textual will handle these automatically, but you can handle [MouseDown](../events/mouse_scroll_down.md) and [MouseUp](../events/mouse_scroll_up) if you want build your own scrolling functionality. + +!!! information + + Terminal emulators will typically convert trackpad gestures in to scroll events. diff --git a/testbed/Textualize__textual/docs/guide/layout.md b/testbed/Textualize__textual/docs/guide/layout.md new file mode 100644 index 0000000000000000000000000000000000000000..81e4d75149742cc1ae683be92b8761227c28f9d2 --- /dev/null +++ b/testbed/Textualize__textual/docs/guide/layout.md @@ -0,0 +1,551 @@ +# Layout + +In Textual, the *layout* defines how widgets will be arranged (or *laid out*) inside a container. +Textual supports a number of layouts which can be set either via a widgets `styles` object or via CSS. +Layouts can be used for both high-level positioning of widgets on screen, and for positioning of nested widgets. + +## Vertical + +The `vertical` layout arranges child widgets vertically, from top to bottom. + +
+--8<-- "docs/images/layout/vertical.excalidraw.svg" +
+ +The example below demonstrates how children are arranged inside a container with the `vertical` layout. + +=== "Output" + + ```{.textual path="docs/examples/guide/layout/vertical_layout.py"} + ``` + +=== "vertical_layout.py" + + ```python + --8<-- "docs/examples/guide/layout/vertical_layout.py" + ``` + +=== "vertical_layout.css" + + ```sass hl_lines="2" + --8<-- "docs/examples/guide/layout/vertical_layout.css" + ``` + +Notice that the first widget yielded from the `compose` method appears at the top of the display, +the second widget appears below it, and so on. +Inside `vertical_layout.css`, we've assigned `layout: vertical` to `Screen`. +`Screen` is the parent container of the widgets yielded from the `App.compose` method, and can be thought of as the terminal window itself. + +!!! note + + The `layout: vertical` CSS isn't *strictly* necessary in this case, since Screens use a `vertical` layout by default. + +We've assigned each child `.box` a height of `1fr`, which ensures they're each allocated an equal portion of the available height. + +You might also have noticed that the child widgets are the same width as the screen, despite nothing in our CSS file suggesting this. +This is because widgets expand to the width of their parent container (in this case, the `Screen`). + +Just like other styles, `layout` can be adjusted at runtime by modifying the `styles` of a `Widget` instance: + +```python +widget.styles.layout = "vertical" +``` + +Using `fr` units guarantees that the children fill the available height of the parent. +However, if the total height of the children exceeds the available space, then Textual will automatically add +a scrollbar to the parent `Screen`. + +!!! note + + A scrollbar is added automatically because `Screen` contains the declaration `overflow-y: auto;`. + +For example, if we swap out `height: 1fr;` for `height: 10;` in the example above, the child widgets become a fixed height of 10, and a scrollbar appears (assuming our terminal window is sufficiently small): + +```{.textual path="docs/examples/guide/layout/vertical_layout_scrolled.py"} +``` + +[//]: # (TODO: Add link to "focus" docs in paragraph below.) + +With the parent container in focus, we can use our mouse wheel, trackpad, or keyboard to scroll it. + +## Horizontal + +The `horizontal` layout arranges child widgets horizontally, from left to right. + +
+--8<-- "docs/images/layout/horizontal.excalidraw.svg" +
+ +The example below shows how we can arrange widgets horizontally, with minimal changes to the vertical layout example above. + + +=== "Output" + + ```{.textual path="docs/examples/guide/layout/horizontal_layout.py"} + ``` + +=== "horizontal_layout.py" + + ```python + --8<-- "docs/examples/guide/layout/horizontal_layout.py" + ``` + +=== "horizontal_layout.css" + + ```sass hl_lines="2" + --8<-- "docs/examples/guide/layout/horizontal_layout.css" + ``` + + +We've changed the `layout` to `horizontal` inside our CSS file. +As a result, the widgets are now arranged from left to right instead of top to bottom. + +We also adjusted the height of the child `.box` widgets to `100%`. +As mentioned earlier, widgets expand to fill the _width_ of their parent container. +They do not, however, expand to fill the container's height. +Thus, we need explicitly assign `height: 100%` to achieve this. + +A consequence of this "horizontal growth" behaviour is that if we remove the width restriction from the above example (by deleting `width: 1fr;`), each child widget will grow to fit the width of the screen, +and only the first widget will be visible. +The other two widgets in our layout are offscreen, to the right-hand side of the screen. +In the case of `horizontal` layout, Textual will _not_ automatically add a scrollbar. + +To enable horizontal scrolling, we can use the `overflow-x: auto;` declaration: + +=== "Output" + + ```{.textual path="docs/examples/guide/layout/horizontal_layout_overflow.py"} + ``` + +=== "horizontal_layout_overflow.py" + + ```python + --8<-- "docs/examples/guide/layout/horizontal_layout_overflow.py" + ``` + +=== "horizontal_layout_overflow.css" + + ```sass hl_lines="3" + --8<-- "docs/examples/guide/layout/horizontal_layout_overflow.css" + ``` + +With `overflow-x: auto;`, Textual automatically adds a horizontal scrollbar since the width of the children +exceeds the available horizontal space in the parent container. + +## Utility containers + +Textual comes with several "container" widgets. +These are [Vertical][textual.containers.Vertical], [Horizontal][textual.containers.Horizontal], and [Grid][textual.containers.Grid] which have the corresponding layout. + +The example below shows how we can combine these containers to create a simple 2x2 grid. +Inside a single `Horizontal` container, we place two `Vertical` containers. +In other words, we have a single row containing two columns. + +=== "Output" + + ```{.textual path="docs/examples/guide/layout/utility_containers.py"} + ``` + +=== "utility_containers.py" + + ```python + --8<-- "docs/examples/guide/layout/utility_containers.py" + ``` + +=== "utility_containers.css" + + ```sass hl_lines="2" + --8<-- "docs/examples/guide/layout/utility_containers.css" + ``` + +You may be tempted to use many levels of nested utility containers in order to build advanced, grid-like layouts. +However, Textual comes with a more powerful mechanism for achieving this known as _grid layout_, which we'll discuss next. + +## Grid + +The `grid` layout arranges widgets within a grid. +Widgets can span multiple rows and columns to create complex layouts. +The diagram below hints at what can be achieved using `layout: grid`. + +
+--8<-- "docs/images/layout/grid.excalidraw.svg" +
+ +!!! note + + Grid layouts in Textual have little in common with browser-based CSS Grid. + +To get started with grid layout, define the number of columns and rows in your grid with the `grid-size` CSS property and set `layout: grid`. Widgets are inserted into the "cells" of the grid from left-to-right and top-to-bottom order. + +The following example creates a 3 x 2 grid and adds six widgets to it + +=== "Output" + + ```{.textual path="docs/examples/guide/layout/grid_layout1.py"} + ``` + +=== "grid_layout1.py" + + ```python + --8<-- "docs/examples/guide/layout/grid_layout1.py" + ``` + +=== "grid_layout1.css" + + ```sass hl_lines="2 3" + --8<-- "docs/examples/guide/layout/grid_layout1.css" + ``` + + +If we were to yield a seventh widget from our `compose` method, it would not be visible as the grid does not contain enough cells to accommodate it. We can tell Textual to add new rows on demand to fit the number of widgets, by omitting the number of rows from `grid-size`. The following example creates a grid with three columns, with rows created on demand: + + +=== "Output" + + ```{.textual path="docs/examples/guide/layout/grid_layout2.py"} + ``` + +=== "grid_layout2.py" + + ```python + --8<-- "docs/examples/guide/layout/grid_layout2.py" + ``` + +=== "grid_layout2.css" + + ```sass hl_lines="3" + --8<-- "docs/examples/guide/layout/grid_layout2.css" + ``` + +Since we specified that our grid has three columns (`grid-size: 3`), and we've yielded seven widgets in total, +a third row has been created to accommodate the seventh widget. + +Now that we know how to define a simple uniform grid, let's look at how we can +customize it to create more complex layouts. + +### Row and column sizes + +You can adjust the width of columns and the height of rows in your grid using the `grid-columns` and `grid-rows` properties. +These properties can take multiple values, letting you specify dimensions on a column-by-column or row-by-row basis. + +Continuing on from our earlier 3x2 example grid, let's adjust the width of the columns using `grid-columns`. +We'll make the first column take up half of the screen width, with the other two columns sharing the remaining space equally. + + +=== "Output" + + ```{.textual path="docs/examples/guide/layout/grid_layout3_row_col_adjust.py"} + ``` + +=== "grid_layout3_row_col_adjust.py" + + ```python + --8<-- "docs/examples/guide/layout/grid_layout3_row_col_adjust.py" + ``` + +=== "grid_layout3_row_col_adjust.css" + + ```sass hl_lines="4" + --8<-- "docs/examples/guide/layout/grid_layout3_row_col_adjust.css" + ``` + + +Since our `grid-size` is 3 (meaning it has three columns), our `grid-columns` declaration has three space-separated values. +Each of these values sets the width of a column. +The first value refers to the left-most column, the second value refers to the next column, and so on. +In the example above, we've given the left-most column a width of `2fr` and the other columns widths of `1fr`. +As a result, the first column is allocated twice the width of the other columns. + +Similarly, we can adjust the height of a row using `grid-rows`. +In the following example, we use `%` units to adjust the first row of our grid to `25%` height, +and the second row to `75%` height (while retaining the `grid-columns` change from above). + + +=== "Output" + + ```{.textual path="docs/examples/guide/layout/grid_layout4_row_col_adjust.py"} + ``` + +=== "grid_layout4_row_col_adjust.py" + + ```python + --8<-- "docs/examples/guide/layout/grid_layout4_row_col_adjust.py" + ``` + +=== "grid_layout4_row_col_adjust.css" + + ```sass hl_lines="5" + --8<-- "docs/examples/guide/layout/grid_layout4_row_col_adjust.css" + ``` + + +If you don't specify enough values in a `grid-columns` or `grid-rows` declaration, the values you _have_ provided will be "repeated". +For example, if your grid has four columns (i.e. `grid-size: 4;`), then `grid-columns: 2 4;` is equivalent to `grid-columns: 2 4 2 4;`. +If it instead had three columns, then `grid-columns: 2 4;` would be equivalent to `grid-columns: 2 4 2;`. + +### Cell spans + +Cells may _span_ multiple rows or columns, to create more interesting grid arrangements. + +To make a single cell span multiple rows or columns in the grid, we need to be able to select it using CSS. +To do this, we'll add an ID to the widget inside our `compose` method so we can set the `row-span` and `column-span` properties using CSS. + +Let's add an ID of `#two` to the second widget yielded from `compose`, and give it a `column-span` of 2 to make that widget span two columns. +We'll also add a slight tint using `tint: magenta 40%;` to draw attention to it. + + +=== "Output" + + ```{.textual path="docs/examples/guide/layout/grid_layout5_col_span.py"} + ``` + +=== "grid_layout5_col_span.py" + + ```python + --8<-- "docs/examples/guide/layout/grid_layout5_col_span.py" + ``` + +=== "grid_layout5_col_span.css" + + ```sass hl_lines="6-9" + --8<-- "docs/examples/guide/layout/grid_layout5_col_span.css" + ``` + + + +Notice that the widget expands to fill columns to the _right_ of its original position. +Since `#two` now spans two cells instead of one, all widgets that follow it are shifted along one cell in the grid to accommodate. +As a result, the final widget wraps on to a new row at the bottom of the grid. + +!!! note + + In the example above, setting the `column-span` of `#two` to be 3 (instead of 2) would have the same effect, since there are only 2 columns available (including `#two`'s original column). + +We can similarly adjust the `row-span` of a cell to have it span multiple rows. +This can be used in conjunction with `column-span`, meaning one cell may span multiple rows and columns. +The example below shows `row-span` in action. +We again target widget `#two` in our CSS, and add a `row-span: 2;` declaration to it. + + +=== "Output" + + ```{.textual path="docs/examples/guide/layout/grid_layout6_row_span.py"} + ``` + +=== "grid_layout6_row_span.py" + + ```python + --8<-- "docs/examples/guide/layout/grid_layout6_row_span.py" + ``` + +=== "grid_layout6_row_span.css" + + ```sass hl_lines="8" + --8<-- "docs/examples/guide/layout/grid_layout6_row_span.css" + ``` + + + +Widget `#two` now spans two columns and two rows, covering a total of four cells. +Notice how the other cells are moved to accommodate this change. +The widget that previously occupied a single cell now occupies four cells, thus displacing three cells to a new row. + +### Gutter + +The spacing between cells in the grid can be adjusted using the `grid-gutter` CSS property. +By default, cells have no gutter, meaning their edges touch each other. +Gutter is applied across every cell in the grid, so `grid-gutter` must be used on a widget with `layout: grid` (_not_ on a child/cell widget). + +To illustrate gutter let's set our `Screen` background color to `lightgreen`, and the background color of the widgets we yield to `darkmagenta`. +Now if we add `grid-gutter: 1;` to our grid, one cell of spacing appears between the cells and reveals the light green background of the `Screen`. + +=== "Output" + + ```{.textual path="docs/examples/guide/layout/grid_layout7_gutter.py"} + ``` + +=== "grid_layout7_gutter.py" + + ```python + --8<-- "docs/examples/guide/layout/grid_layout7_gutter.py" + ``` + +=== "grid_layout7_gutter.css" + + ```sass hl_lines="4" + --8<-- "docs/examples/guide/layout/grid_layout7_gutter.css" + ``` + +Notice that gutter only applies _between_ the cells in a grid, pushing them away from each other. +It doesn't add any spacing between cells and the edges of the parent container. + +!!! tip + + You can also supply two values to the `grid-gutter` property to set vertical and horizontal gutters respectively. + Since terminal cells are typically two times taller than they are wide, + it's common to set the horizontal gutter equal to double the vertical gutter (e.g. `grid-gutter: 1 2;`) in order to achieve visually consistent spacing around grid cells. + +## Docking + +Widgets may be *docked*. +Docking a widget removes it from the layout and fixes its position, aligned to either the top, right, bottom, or left edges of a container. +Docked widgets will not scroll out of view, making them ideal for sticky headers, footers, and sidebars. + +
+--8<-- "docs/images/layout/dock.excalidraw.svg" +
+ +To dock a widget to an edge, add a `dock: ;` declaration to it, where `` is one of `top`, `right`, `bottom`, or `left`. +For example, a sidebar similar to that shown in the diagram above can be achieved using `dock: left;`. +The code below shows a simple sidebar implementation. + +=== "Output" + + ```{.textual path="docs/examples/guide/layout/dock_layout1_sidebar.py" press="pagedown,down,down,_,_,_,_,_"} + ``` + +=== "dock_layout1_sidebar.py" + + ```python + --8<-- "docs/examples/guide/layout/dock_layout1_sidebar.py" + ``` + +=== "dock_layout1_sidebar.css" + + ```sass hl_lines="2" + --8<-- "docs/examples/guide/layout/dock_layout1_sidebar.css" + ``` + +If we run the app above and scroll down, the body text will scroll but the sidebar does not (note the position of the scrollbar in the output shown above). + +Docking multiple widgets to the same edge will result in overlap. +The first widget yielded from `compose` will appear below widgets yielded after it. +Let's dock a second sidebar, `#another-sidebar`, to the left of the screen. +This new sidebar is double the width of the one previous one, and has a `deeppink` background. + +=== "Output" + + ```{.textual path="docs/examples/guide/layout/dock_layout2_sidebar.py" press="pagedown,down,down,_,_,_,_,_"} + ``` + +=== "dock_layout2_sidebar.py" + + ```python hl_lines="16" + --8<-- "docs/examples/guide/layout/dock_layout2_sidebar.py" + ``` + +=== "dock_layout2_sidebar.css" + + ```sass hl_lines="1-6" + --8<-- "docs/examples/guide/layout/dock_layout2_sidebar.css" + ``` + +Notice that the original sidebar (`#sidebar`) appears on top of the newly docked widget. +This is because `#sidebar` was yielded _after_ `#another-sidebar` inside the `compose` method. + +Of course, we can also dock widgets to multiple edges within the same container. +The built-in `Header` widget contains some internal CSS which docks it to the top. +We can yield it inside `compose`, and without any additional CSS, we get a header fixed to the top of the screen. + +=== "Output" + + ```{.textual path="docs/examples/guide/layout/dock_layout3_sidebar_header.py"} + ``` + +=== "dock_layout3_sidebar_header.py" + + ```python hl_lines="14" + --8<-- "docs/examples/guide/layout/dock_layout3_sidebar_header.py" + ``` + +=== "dock_layout3_sidebar_header.css" + + ```sass + --8<-- "docs/examples/guide/layout/dock_layout3_sidebar_header.css" + ``` + +If we wished for the sidebar to appear below the header, it'd simply be a case of yielding the sidebar before we yield the header. + +## Layers + +Textual has a concept of _layers_ which gives you finely grained control over the order widgets are place. + +When drawing widgets, Textual will first draw on _lower_ layers, working its way up to higher layers. +As such, widgets on higher layers will be drawn on top of those on lower layers. + +Layer names are defined with a `layers` style on a container (parent) widget. +Descendants of this widget can then be assigned to one of these layers using a `layer` style. + +The `layers` style takes a space-separated list of layer names. +The leftmost name is the lowest layer, and the rightmost is the highest layer. +Therefore, if you assign a descendant to the rightmost layer name, it'll be drawn on the top layer and will be visible above all other descendants. + +An example `layers` declaration looks like: `layers: one two three;`. +To add a widget to the topmost layer in this case, you'd add a declaration of `layer: three;` to it. + +In the example below, `#box1` is yielded before `#box2`. +Given our earlier discussion on yield order, you'd expect `#box2` to appear on top. +However, in this case, both `#box1` and `#box2` are assigned to layers which define the reverse order, so `#box1` is on top of `#box2` + + +[//]: # (NOTE: the example below also appears in the layers and layer style reference) + +=== "Output" + + ```{.textual path="docs/examples/guide/layout/layers.py"} + ``` + +=== "layers.py" + + ```python + --8<-- "docs/examples/guide/layout/layers.py" + ``` + +=== "layers.css" + + ```sass hl_lines="3 15 19" + --8<-- "docs/examples/guide/layout/layers.css" + ``` + +## Offsets + +Widgets have a relative offset which is added to the widget's location, _after_ its location has been determined via its parent's layout. +This means that if a widget hasn't had its offset modified using CSS or Python code, it will have an offset of `(0, 0)`. + +
+--8<-- "docs/images/layout/offset.excalidraw.svg" +
+ +The offset of a widget can be set using the `offset` CSS property. +`offset` takes two values. + +* The first value defines the `x` (horizontal) offset. Positive values will shift the widget to the right. Negative values will shift the widget to the left. +* The second value defines the `y` (vertical) offset. Positive values will shift the widget down. Negative values will shift the widget up. + +[//]: # (TODO Link the word animation below to animation docs) + +## Putting it all together + +The sections above show how the various layouts in Textual can be used to position widgets on screen. +In a real application, you'll make use of several layouts. + +The example below shows how an advanced layout can be built by combining the various techniques described on this page. + +=== "Output" + + ```{.textual path="docs/examples/guide/layout/combining_layouts.py"} + ``` + +=== "combining_layouts.py" + + ```python + --8<-- "docs/examples/guide/layout/combining_layouts.py" + ``` + +=== "combining_layouts.css" + + ```sass + --8<-- "docs/examples/guide/layout/combining_layouts.css" + ``` + +Textual layouts make it easy design build real-life applications with relatively little code. diff --git a/testbed/Textualize__textual/docs/guide/queries.md b/testbed/Textualize__textual/docs/guide/queries.md new file mode 100644 index 0000000000000000000000000000000000000000..ff58ca2774b8760f244fd74ea70c7da295e88ce4 --- /dev/null +++ b/testbed/Textualize__textual/docs/guide/queries.md @@ -0,0 +1,170 @@ +# DOM Queries + +In the previous chapter we introduced the [DOM](../guide/CSS.md#the-dom) which is how Textual apps keep track of widgets. We saw how you can apply styles to the DOM with CSS [selectors](./CSS.md#selectors). + +Selectors are a very useful idea and can do more that apply styles. We can also find widgets in Python code with selectors, and make updates to widgets in a simple expressive way. Let's look at how! + +## Query one + +The [query_one][textual.dom.DOMNode.query_one] method gets a single widget in an app or other widget. If you call it with a selector it will return the first matching widget. + +Let's say we have a widget with an ID of `send` and we want to get a reference to it in our app. We could do this with the following: + +```python +send_button = self.query_one("#send") +``` + +If there is no widget with an ID of `send`, Textual will raise a [NoMatches][textual.css.query.NoMatches] exception. Otherwise it will return the matched widget. + +You can also add a second parameter for the expected type. + +```python +send_button = self.query_one("#send", Button) +``` + +If the matched widget is *not* a button (i.e. if `isinstance(widget, Button)` equals `False`), Textual will raise a [WrongType][textual.css.query.WrongType] exception. + +!!! tip + + The second parameter allows type-checkers like MyPy to know the exact return type. Without it, MyPy would only know the result of `query_one` is a Widget (the base class). + +## Making queries + +Apps and widgets have a [query][textual.dom.DOMNode.query] method which finds (or queries) widgets. This method returns a [DOMQuery][textual.css.query.DOMQuery] object which is a list-like container of widgets. + +If you call `query` with no arguments, you will get back a `DOMQuery` containing all widgets. This method is *recursive*, meaning it will also return child widgets (as many levels as required). + +Here's how you might iterate over all the widgets in your app: + +```python +for widget in self.query(): + print(widget) +``` + +Called on the `app`, this will retrieve all widgets in the app. If you call the same method on a widget, it will return the children of that widget. + +!!! note + + All the query and related methods work on both App and Widget sub-classes. + +### Query selectors + +You can call `query` with a CSS selector. Let's look a few examples: + +If we want to find all the button widgets, we could do something like the following: + +```python +for button in self.query("Button"): + print(button) +``` + +Any selector that works in CSS will work with the `query` method. For instance, if we want to find all the disabled buttons in a Dialog widget, we could do this: + +```python +for button in self.query("Dialog Button.disabled"): + print(button) +``` + +!!! info + + The selector `Dialog Button.disabled` says find all the `Button` with a CSS class of `disabled` that are a child of a `Dialog` widget. + +### Results + +Query objects have a [results][textual.css.query.DOMQuery.results] method which is an alternative way of iterating over widgets. If you supply a type (i.e. a Widget class) then this method will generate only objects of that type. + +The following example queries for widgets with the `disabled` CSS class and iterates over just the Button objects. + +```python +for button in self.query(".disabled").results(Button): + print(button) +``` + +!!! tip + + This method allows type-checkers like MyPy to know the exact type of the object in the loop. Without it, MyPy would only know that `button` is a `Widget` (the base class). + +## Query objects + +We've seen that the [query][textual.dom.DOMNode.query] method returns a [DOMQuery][textual.css.query.DOMQuery] object you can iterate over in a for loop. Query objects behave like Python lists and support all of the same operations (such as `query[0]`, `len(query)` ,`reverse(query)` etc). They also have a number of other methods to simplify retrieving and modifying widgets. + +## First and last + +The [first][textual.css.query.DOMQuery.first] and [last][textual.css.query.DOMQuery.last] methods return the first or last matching widget from the selector, respectively. + +Here's how we might find the _last_ button in an app: + +```python +last_button = self.query("Button").last() +``` + +If there are no buttons, Textual will raise a [NoMatches][textual.css.query.NoMatches] exception. Otherwise it will return a button widget. + +Both `first()` and `last()` accept an `expect_type` argument that should be the class of the widget you are expecting. Let's say we want to get the last widget with class `.disabled`, and we want to check it really is a button. We could do this: + +```python +disabled_button = self.query(".disabled").last(Button) +``` + +The query selects all widgets with a `disabled` CSS class. The `last` method gets the last disabled widget and checks it is a `Button` and not any other kind of widget. + +If the last widget is *not* a button, Textual will raise a [WrongType][textual.css.query.WrongType] exception. + +!!! tip + + Specifying the expected type allows type-checkers like MyPy to know the exact return type. + +## Filter + +Query objects have a [filter][textual.css.query.DOMQuery.filter] method which further refines a query. This method will return a new query object with widgets that match both the original query _and_ the new selector + +Let's say we have a query which gets all the buttons in an app, and we want a new query object with just the disabled buttons. We could write something like this: + +```python +# Get all the Buttons +buttons_query = self.query("Button") +# Buttons with 'disabled' CSS class +disabled_buttons = buttons_query.filter(".disabled") +``` + +Iterating over `disabled_buttons` will give us all the disabled buttons. + +## Exclude + +Query objects have an [exclude][textual.css.query.DOMQuery.exclude] method which is the logical opposite of [filter][textual.css.query.DOMQuery.filter]. The `exclude` method removes any widgets from the query object which match a selector. + +Here's how we could get all the buttons which *don't* have the `disabled` class set. + +```python +# Get all the Buttons +buttons_query = self.query("Button") +# Remove all the Buttons with the 'disabled' CSS class +enabled_buttons = buttons_query.exclude(".disabled") +``` + +## Loop-free operations + +Once you have a query object, you can loop over it to call methods on the matched widgets. Query objects also support a number of methods which make an update to every matched widget without an explicit loop. + +For instance, let's say we want to disable all buttons in an app. We could do this by calling [add_class()][textual.css.query.DOMQuery.add_class] on a query object. + +```python +self.query("Button").add_class("disabled") +``` + +This single line is equivalent to the following: + +```python +for widget in self.query("Button"): + widget.add_class("disabled") +``` + +Here are the other loop-free methods on query objects: + +- [set_class][textual.css.query.DOMQuery.set_class] Sets a CSS class (or classes) on matched widgets. +- [add_class][textual.css.query.DOMQuery.add_class] Adds a CSS class (or classes) to matched widgets. +- [remove_class][textual.css.query.DOMQuery.remove_class] Removes a CSS class (or classes) from matched widgets. +- [toggle_class][textual.css.query.DOMQuery.toggle_class] Sets a CSS class (or classes) if it is not set, or removes the class (or classes) if they are set on the matched widgets. +- [remove][textual.css.query.DOMQuery.remove] Removes matched widgets from the DOM. +- [refresh][textual.css.query.DOMQuery.refresh] Refreshes matched widgets. + diff --git a/testbed/Textualize__textual/docs/guide/reactivity.md b/testbed/Textualize__textual/docs/guide/reactivity.md new file mode 100644 index 0000000000000000000000000000000000000000..5b4cf2af7448d04cd7986bba90632a52ef84f431 --- /dev/null +++ b/testbed/Textualize__textual/docs/guide/reactivity.md @@ -0,0 +1,229 @@ +# Reactivity + +Textual's reactive attributes are attributes _with superpowers_. In this chapter we will look at how reactive attributes can simplify your apps. + +!!! quote + + With great power comes great responsibility. + + — Uncle Ben + +## Reactive attributes + +Textual provides an alternative way of adding attributes to your widget or App, which doesn't require adding them to your class constructor (`__init__`). To create these attributes import [reactive][textual.reactive.reactive] from `textual.reactive`, and assign them in the class scope. + +The following code illustrates how to create reactive attributes: + +```python +from textual.reactive import reactive +from textual.widget import Widget + +class Reactive(Widget): + + name = reactive("Paul") # (1)! + count = reactive(0) # (2)! + is_cool = reactive(True) # (3)! +``` + +1. Create a string attribute with a default of `"Paul"` +2. Creates an integer attribute with a default of `0`. +3. Creates a boolean attribute with a default of `True`. + +The `reactive` constructor accepts a default value as the first positional argument. + +!!! information + + Textual uses Python's _descriptor protocol_ to create reactive attributes, which is the same protocol used by the builtin `property` decorator. + +You can get and set these attributes in the same way as if you had assigned them in a `__init__` method. For instance `self.name = "Jessica"`, `self.count += 1`, or `print(self.is_cool)`. + +### Dynamic defaults + +You can also set the default to a function (or other callable). Textual will call this function to get the default value. The following code illustrates a reactive value which will be automatically assigned the current time when the widget is created: + +```python +from time import time +from textual.reactive import reactive +from textual.widget import Widget + +class Timer(Widget): + + start_time = reactive(time) # (1)! +``` + +1. The `time` function returns the current time in seconds. + +### Typing reactive attributes + +There is no need to specify a type hint if a reactive attribute has a default value, as type checkers will assume the attribute is the same type as the default. + +You may want to add explicit type hints if the attribute type is a superset of the default type. For instance if you want to make an attribute optional. Here's how you would create a reactive string attribute which may be `None`: + +```python + name: reactive[str | None] = reactive("Paul") +``` + +## Smart refresh + +The first superpower we will look at is "smart refresh". When you modify a reactive attribute, Textual will make note of the fact that it has changed and refresh automatically. + +!!! information + + If you modify multiple reactive attribute, Textual will only do a single refresh to minimize updates. + +Let's look at an example which illustrates this. In the following app, the value of an input is used to update a "Hello, World!" type greeting. + +=== "refresh01.py" + + ```python hl_lines="7-13 24" + --8<-- "docs/examples/guide/reactivity/refresh01.py" + ``` + +=== "refresh01.css" + + ```sass + --8<-- "docs/examples/guide/reactivity/refresh01.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/guide/reactivity/refresh01.py" press="tab,T,e,x,t,u,a,l"} + ``` + +The `Name` widget has a reactive `who` attribute. When the app modifies that attribute, a refresh happens automatically. + +!!! information + + Textual will check if a value has really changed, so assigning the same value wont prompt an unnecessary refresh. + +### Disabling refresh + +If you *don't* want an attribute to prompt a refresh or layout but you still want other reactive superpowers, you can use [var][textual.reactive.var] to create an attribute. You can import `var` from `textual.reactive`. + +The following code illustrates how you create non-refreshing reactive attributes. + +```python +class MyWidget(Widget): + count = var(0) # (1)! +``` + +1. Changing `self.count` wont cause a refresh or layout. + +### Layout + +The smart refresh feature will update the content area of a widget, but will not change its size. If modifying an attribute should change the size of the widget, you can set `layout=True` on the reactive attribute. This ensures that your CSS layout will update accordingly. + +The following example modifies "refresh01.py" so that the greeting has an automatic width. + +=== "refresh02.py" + + ```python hl_lines="10" + --8<-- "docs/examples/guide/reactivity/refresh02.py" + ``` + + 1. This attribute will update the layout when changed. + +=== "refresh02.css" + + ```sass hl_lines="7-9" + --8<-- "docs/examples/guide/reactivity/refresh02.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/guide/reactivity/refresh02.py" press="tab,n,a,m,e"} + ``` + +If you type in to the input now, the greeting will expand to fit the content. If you were to set `layout=False` on the reactive attribute, you should see that the box remains the same size when you type. + +## Validation + +The next superpower we will look at is _validation_, which can check and potentially modify a value you assign to a reactive attribute. + +If you add a method that begins with `validate_` followed by the name of your attribute, it will be called when you assign a value to that attribute. This method should accept the incoming value as a positional argument, and return the value to set (which may be the same or a different value). + +A common use for this is to restrict numbers to a given range. The following example keeps a count. There is a button to increase the count, and a button to decrease it. The validation ensures that the count will never go above 10 or below zero. + +=== "validate01.py" + + ```python hl_lines="12-18 30 32" + --8<-- "docs/examples/guide/reactivity/validate01.py" + ``` + +=== "validate01.css" + + ```sass + --8<-- "docs/examples/guide/reactivity/validate01.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/guide/reactivity/validate01.py"} + ``` + +If you click the buttons in the above example it will show the current count. When `self.count` is modified in the button handler, Textual runs `validate_count` which performs the validation to limit the value of count. + +## Watch methods + +Watch methods are another superpower. Textual will call watch methods when reactive attributes are modified. Watch methods begin with `watch_` followed by the name of the attribute. If the watch method accepts a positional argument, it will be called with the new assigned value. If the watch method accepts *two* positional arguments, it will be called with both the *old* value and the *new* value. + +The follow app will display any color you type in to the input. Try it with a valid color in Textual CSS. For example `"darkorchid"` or `"#52de44". + +=== "watch01.py" + + ```python hl_lines="17-19 28" + --8<-- "docs/examples/guide/reactivity/watch01.py" + ``` + + 1. Creates a reactive [color][textual.color.Color] attribute. + 2. Called when `self.color` is changed. + 3. New color is assigned here. + +=== "watch01.css" + + ```sass + --8<-- "docs/examples/guide/reactivity/watch01.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/guide/reactivity/watch01.py" press="tab,d,a,r,k,o,r,c,h,i,d"} + ``` + +The color is parsed in `on_input_submitted` and assigned to `self.color`. Because `color` is reactive, Textual also calls `watch_color` with the old and new values. + +## Compute methods + +Compute methods are the final superpower offered by the `reactive` descriptor. Textual runs compute methods to calculate the value of a reactive attribute. Compute methods begin with `compute_` followed by the name of the reactive value. + +You could be forgiven in thinking this sounds a lot like Python's property decorator. The difference is that Textual will cache the value of compute methods, and update them when any other reactive attribute changes. + +The following example uses a computed attribute. It displays three inputs for the each color component (red, green, and blue). If you enter numbers in to these inputs, the background color of another widget changes. + +=== "computed01.py" + + ```python hl_lines="25-26 28-29" + --8<-- "docs/examples/guide/reactivity/computed01.py" + ``` + + 1. Combines color components in to a Color object. + 2. The compute method is called when the _result_ of `compute_color` changes. + +=== "computed01.css" + + ```sass + --8<-- "docs/examples/guide/reactivity/computed01.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/guide/reactivity/computed01.py"} + ``` + +Note the `compute_color` method which combines the color components into a [Color][textual.color.Color] object. It will be recalculated when any of the `red` , `green`, or `blue` attributes are modified. + +When the result of `compute_color` changes, Textual will also call `watch_color` since `color` still has the [watch method](#watch-methods) superpower. + +!!! note + + It is best to avoid doing anything slow or cpu-intensive in a compute method. Textual calls compute methods on an object when _any_ reactive attribute changes. diff --git a/testbed/Textualize__textual/docs/guide/screens.md b/testbed/Textualize__textual/docs/guide/screens.md new file mode 100644 index 0000000000000000000000000000000000000000..94c61794e1ccced8dc020e205864b3f5aba50738 --- /dev/null +++ b/testbed/Textualize__textual/docs/guide/screens.md @@ -0,0 +1,151 @@ +# Screens + +This chapter covers Textual's screen API. We will discuss how to create screens and switch between them. + +## What is a screen? + +Screens are containers for widgets that occupy the dimensions of your terminal. There can be many screens in a given app, but only one screen is visible at a time. + +Textual requires that there be at least one screen object and will create one implicitly in the App class. If you don't change the screen, any widgets you [mount][textual.widget.Widget.mount] or [compose][textual.widget.Widget.compose] will be added to this default screen. + +!!! tip + + Try printing `widget.parent` to see what object your widget is connected to. + +
+--8<-- "docs/images/dom1.excalidraw.svg" +
+ +## Creating a screen + +You can create a screen by extending the [Screen][textual.screen.Screen] class which you can import from `textual.screen`. The screen may be styled in the same way as other widgets, with the exception that you can't modify the screen's dimensions (as these will always be the size of your terminal). + +Let's look at a simple example of writing a screen class to simulate Window's [blue screen of death](https://en.wikipedia.org/wiki/Blue_screen_of_death). + +=== "screen01.py" + + ```python title="screen01.py" hl_lines="17-23 28" + --8<-- "docs/examples/guide/screens/screen01.py" + ``` + +=== "screen01.css" + + ```sass title="screen01.css" + --8<-- "docs/examples/guide/screens/screen01.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/guide/screens/screen01.py" press="b,_"} + ``` + +If you run this you will see an empty screen. Hit the ++b++ screen to show a blue screen of death. Hit ++escape++ to return to the default screen. + +The `BSOD` class above defines a screen with a key binding and compose method. These should be familiar as they work in the same way as apps. + +The app class has a new `SCREENS` class variable. Textual uses this class variable to associated a name with screen object (the name is used to reference screens in the screen API). Also in the app is a key binding associated with the action `"push_screen('bsod')"`. The screen class has a similar action `"pop_screen"` bound to the ++escape++ key. We will cover these actions below. + +## Named screens + +You can associate a screen with a name by defining a `SCREENS` class variable in your app, which should be dict that maps names on to Screen objects. The name of the screen may be used interchangeably with screen objects in much of the screen API. + +You can also _install_ new named screens dynamically with the [install_screen][textual.app.App.install_screen] method. The following example installs the `BSOD` screen in a mount handler rather than from the `SCREENS` variable. + +=== "screen02.py" + + ```python title="screen02.py" hl_lines="30-31" + --8<-- "docs/examples/guide/screens/screen02.py" + ``` + +=== "screen02.css" + + ```sass title="screen02.css" + --8<-- "docs/examples/guide/screens/screen02.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/guide/screens/screen02.py" press="b,_"} + ``` + +Although both do the same thing, we recommend the `SCREENS` for screens that exist for the lifetime of your app. + +### Uninstalling screens + +Screens defined in `SCREENS` or added with [install_screen][textual.app.App.install_screen] are _installed_ screens. Textual will keep these screens in memory for the lifetime of your app. + +If you have installed a screen, but you later want it to be removed and cleaned up, you can call [uninstall_screen][textual.app.App.uninstall_screen]. + +## Screen stack + +Textual keeps track of a _stack_ of screens. You can think of the screen stack as a stack of paper, where only the very top sheet is visible. If you remove the top sheet the paper underneath becomes visible. Screens work in a similar way. + +The active screen (top of the stack) will render the screen and receive input events. The following API methods on the App class can manipulate this stack, and let you decide which screen the user can interact with. + +### Push screen + +The [push_screen][textual.app.App.push_screen] method puts a screen on top of the stack and makes that screen active. You can call this method with the name of an installed screen, or a screen object. + +
+--8<-- "docs/images/screens/push_screen.excalidraw.svg" +
+ +#### Action + +You can also push screens with the `"app.push_screen"` action, which requires the name of an installed screen. + +### Pop screen + +The [pop_screen][textual.app.App.pop_screen] method removes the top-most screen from the stack, and makes the new top screen active. + +!!! note + + The screen stack must always have at least one screen. If you attempt to remove the last screen, Textual will raise a [ScreenStackError][textual.app.ScreenStackError] exception. + +
+--8<-- "docs/images/screens/pop_screen.excalidraw.svg" +
+ + +When you pop a screen it will be removed and deleted unless it has been installed or there is another copy of the screen on the stack. + +#### Action + +You can also pop screens with the `"app.pop_screen"` action. + +### Switch screen + +The [switch_screen][textual.app.App.switch_screen] method replaces the top of the stack with a new screen. + +
+--8<-- "docs/images/screens/switch_screen.excalidraw.svg" +
+ +Like [pop_screen](#pop-screen), if the screen being replaced is not installed it will be removed and deleted. + +#### Action + +You can also switch screens with the `"app.switch_screen"` action which accepts the name of the screen to switch to. + +## Modal screens + +Screens can be used to implement modal dialogs. The following example pushes a screen when you hit the ++q++ key to ask you if you really want to quit. + +=== "modal01.py" + + ```python title="modal01.py" hl_lines="18 20 32" + --8<-- "docs/examples/guide/screens/modal01.py" + ``` + +=== "modal01.css" + + ```sass title="modal01.css" + --8<-- "docs/examples/guide/screens/modal01.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/guide/screens/modal01.py" press="q,_"} + ``` + +Note the `request_quit` action in the app which pushes a new instance of `QuitScreen`. This makes the quit screen active. if you click cancel, the quit screen calls `pop_screen` to return the default screen. This also removes and deletes the `QuitScreen` object. diff --git a/testbed/Textualize__textual/docs/guide/styles.md b/testbed/Textualize__textual/docs/guide/styles.md new file mode 100644 index 0000000000000000000000000000000000000000..99457a078b468732b92a1fb34301b3a28deb5061 --- /dev/null +++ b/testbed/Textualize__textual/docs/guide/styles.md @@ -0,0 +1,332 @@ +# Styles + +In this chapter will explore how you can apply styles to your application to create beautiful user interfaces. + +## Styles object + +Every Textual widget class provides a `styles` object which contains a number of attributes. These attributes tell Textual how the widget should be displayed. Setting any of these attributes will update the screen accordingly. + +!!! note + + These docs use the term *screen* to describe the contents of the terminal, which will typically be a window on your desktop. + +Let's look at a simple example which sets styles on `screen` (a special widget that represents the screen). + +```python title="screen.py" hl_lines="6-7" +--8<-- "docs/examples/guide/styles/screen.py" +``` + +The first line sets the [background](../styles/background.md) style to `"darkblue"` which will change the background color to dark blue. There are a few other ways of setting color which we will explore later. + +The second line sets [border](../styles/border.md) to a tuple of `("heavy", "white")` which tells Textual to draw a white border with a style of `"heavy"`. Running this code will show the following: + +```{.textual path="docs/examples/guide/styles/screen.py"} +``` + +## Styling widgets + +Setting styles on screen is useful, but to create most user interfaces we will also need to apply styles to other widgets. + +The following example adds a static widget which we will apply some styles to: + +```python title="widget.py" hl_lines="7 11-12" +--8<-- "docs/examples/guide/styles/widget.py" +``` + +The compose method stores a reference to the widget before yielding it. In the mount handler we use that reference to set the same styles on the widget as we did for the screen example. Here is the result: + +```{.textual path="docs/examples/guide/styles/widget.py"} +``` + +Widgets will occupy the full width of their container and as many lines as required to fit in the vertical direction. + +Note how the combined height of the widget is three rows in the terminal. This is because a border adds two rows (and two columns). If you were to remove the line that sets the border style, the widget would occupy a single row. + +!!! information + + Widgets will wrap text by default. If you were to replace `"Textual"` with a long paragraph of text, the widget will expand downwards to fit. + +## Colors + +There are a number of style attribute which accept colors. The most commonly used are [color](../styles/color.md) which sets the default color of text on a widget, and [background](..styles/background/md) which sets the background color (beneath the text). + +You can set a color value to one of a number of pre-defined color constants, such as "crimson", "lime", and "palegreen". You can find a full list in the [Color reference](../reference/color.md#textual.color--named-colors). + +Here's how you would set the screen background to lime: + +```python +self.screen.styles.background = "lime" +``` + +In addition to color names, you can also use any of the following ways of expressing a color: + +- RGB hex colors starts with a `#` followed by three pairs of one or two hex digits; one for the red, green, and blue color components. For example, `#f00` is an intense red color, and `#9932CC` is *dark orchid*. +- RGB decimal color start with `rgb` followed by a tuple of three numbers in the range 0 to 255. For example `rgb(255,0,0)` is intense red, and `rgb(153,50,204)` is *dark orchid*. +- HSL colors start with `hsl` followed by a angle between 0 and 360 and two percentage values, representing Hue, Saturation and Lightness. For example `hsl(0,100%,50%)` is intense red and `hsl(280,60%,49%)` is *dark orchid*. + + +The background and color styles also accept a [Color][textual.color.Color] object which can be used to create colors dynamically. + +The following example adds three widgets and sets their color styles. + +```python title="colors01.py" hl_lines="16-19" +--8<-- "docs/examples/guide/styles/colors01.py" +``` + +Here is the output: + +```{.textual path="docs/examples/guide/styles/colors01.py"} +``` + +### Alpha + +Textual represents color internally as a tuple of three values for the red, green, and blue components. + +Textual supports a common fourth value called *alpha* which can make a color translucent. If you set alpha on a background color, Textual will blend the background with the color beneath it. If you set alpha on the text color, then Textual will blend the text with the background color. + +There are a few ways you can set alpha on a color in Textual. + +- You can set the alpha value of a color by adding a fourth digit or pair of digits to a hex color. The extra digits form an alpha component which ranges from 0 for completely transparent to 255 (completely opaque). Any value between 0 and 255 will be translucent. For example `"#9932CC7f"` is a dark orchid which is roughly 50% translucent. +- You can also set alpha with the `rgba` format, which is identical to `rgb` with the additional of a fourth value that should be between 0 and 1, where 0 is invisible and 1 is opaque. For example `"rgba(192,78,96,0.5)"`. +- You can add the `a` parameter on a [Color][textual.color.Color] object. For example `Color(192, 78, 96, a=0.5)` creates a translucent dark orchid. + +The following examples shows what happens when you set alpha on background colors: + +```python title="colors01.py" hl_lines="12-15" +--8<-- "docs/examples/guide/styles/colors02.py" +``` + +Notice that an alpha of 0.1 the background almost matches the screen, but at 1.0 it is a solid color. + +```{.textual path="docs/examples/guide/styles/colors02.py"} +``` + +## Dimensions + +Widgets occupy a rectangular region of the screen, which may be as small as a single character or as large as the screen (potentially *larger* if [scrolling](../styles/overflow.md) is enabled). + +### Box Model + +The following styles influence the dimensions of a widget. + +- [width](../styles/width.md) and [height](../styles/width.md) define the size of the widget. +- [padding](../styles/padding.md) adds optional space around the content area. +- [border](../styles/border.md) draws an optional rectangular border around the padding and the content area. + +Additionally, the [margin](../styles/margin.md) style adds space around a widget's border, which isn't technically part of the widget, but provides visual separation between widgets. + +Together these styles compose the widget's *box model*. The following diagram shows how these settings are combined: + +
+--8<-- "docs/images/styles/box.excalidraw.svg" +
+ +### Width and height + +Setting the width restricts the number of columns used by a widget, and setting the height restricts the number of rows. Let's look at an example which sets both dimensions. + +```python title="dimensions01.py" hl_lines="21-22" +--8<-- "docs/examples/guide/styles/dimensions01.py" +``` + +This code produces the following result. + +```{.textual path="docs/examples/guide/styles/dimensions01.py"} +``` + +Note how the text wraps in the widget, and is cropped because it doesn't fit in the space provided. + +#### Auto dimensions + +In practice, we generally want the size of a widget to adapt to it's content, which we can do by setting a dimension to `"auto"`. + +Let's set the height to auto and see what happens. + +```python title="dimensions02.py" hl_lines="22" +--8<-- "docs/examples/guide/styles/dimensions02.py" +``` + +If you run this you will see the height of the widget now grows to accommodate the full text: + +```{.textual path="docs/examples/guide/styles/dimensions02.py"} +``` + +#### Units + +Textual offers a few different *units* which allow you to specify dimensions relative to the screen or container. Relative units can better make use of available space if the user resizes the terminal. + +- Percentage units are given as a string containing a number followed by a percentage symbol, e.g. `"50%"`. Setting a dimension to a percentage unit will cause it to fit in that percentage of the available space. For instance, setting width to `"50%"` will cause the width of the widget to be half the available space. +- View units are similar to percentage units, but explicitly reference a dimension. The `vw` unit sets a dimension to a percentage of the terminal *width*, and `vh` sets a dimension to a percentage of the terminal *height*. +- The `w` unit sets a dimension to a percentage of the available width (which may be smaller than the terminal size if the widget is within another widget). +- The `h` unit sets a dimension to a percentage of the available height. + + +The following example demonstrates applying percentage units: + +```python title="dimensions03.py" hl_lines="21-22" +--8<-- "docs/examples/guide/styles/dimensions03.py" +``` + +With the width set to `"50%"` and the height set to `"80%"`, the widget will keep those relative dimensions when resizing the terminal window: + + +=== "60 x 20" + + ```{.textual path="docs/examples/guide/styles/dimensions03.py" columns="60" lines="20"} + ``` + +=== "80 x 30" + + ```{.textual path="docs/examples/guide/styles/dimensions03.py" columns="80" lines="30"} + ``` + +=== "120 x 40" + + ```{.textual path="docs/examples/guide/styles/dimensions03.py" columns="120" lines="40"} + ``` + +Percentage units can be problematic for some relative values. For instance, if we want to divide the screen into thirds, we would have to set a dimension to `33.3333333333%` which is awkward. Textual supports `fr` units which are often better than percentage-based units for these situations. + +When specifying `fr` units for a given dimension, Textual will divide the available space by the sum of the `fr` units on that dimension. That space will then be divided amongst the widgets as a proportion of their individual `fr` values. + +Let's look at an example. We will create two widgets, one with a height of `"2fr"` and one with a height of `"1fr"`. + +```python title="dimensions04.py" hl_lines="24-25" +--8<-- "docs/examples/guide/styles/dimensions04.py" +``` + +The total `fr` units for height is 3. The first widget will have a screen height of two thirds because its height style is set to `2fr`. The second widget's height styles is `1fr` so its screen height will be one third. Here's what that looks like. + +```{.textual path="docs/examples/guide/styles/dimensions04.py"} +``` + +### Maximum and minimums + +The same units may also be used to set limits on a dimension. The following styles set minimum and maximum sizes and can accept any of the values used in width and height. + +- [min-width](../styles/min_width.md) sets a minimum width. +- [max-width](../styles/max_width.md) sets a maximum width. +- [min-height](../styles/min_height.md) sets a minimum height. +- [max-height](../styles/max_height.md) sets a maximum height. + +### Padding + +Padding adds space around your content which can aid readability. Setting [padding](../styles/padding.md) to an integer will add that number additional rows and columns around the content area. The following example sets padding to 2: + +```python title="padding01.py" hl_lines="22" +--8<-- "docs/examples/guide/styles/padding01.py" +``` + +Notice the additional space around the text: + +```{.textual path="docs/examples/guide/styles/padding01.py"} +``` + +You can also set padding to a tuple of *two* integers which will apply padding to the top/bottom and left/right edges. The following example sets padding to `(2, 4)` which adds two rows to the top and bottom of the widget, and 4 columns to the left and right of the widget. + +```python title="padding02.py" hl_lines="22" +--8<-- "docs/examples/guide/styles/padding02.py" +``` + +Compare the output of this example to the previous example: + +```{.textual path="docs/examples/guide/styles/padding02.py"} +``` + +You can also set padding to a tuple of *four* values which applies padding to each edge individually. The first value is the padding for the top of the widget, followed by the right of the widget, then bottom, then left. + +### Border + +The [border](../styles/border.md) style draws a border around a widget. To add a border set `syles.border` to a tuple of two values. The first value is the border type, which should be a string. The second value is the border color which will accept any value that works with [color](../styles/color.md) and [background](../styles/background.md). + +The following example adds a border around a widget: + +```python title="border01.py" hl_lines="22" +--8<-- "docs/examples/guide/styles/border01.py" +``` + +Here is the result: + +```{.textual path="docs/examples/guide/styles/border01.py"} +``` + +There are many other border types. Run the following from the command prompt to preview them. + + +```bash +textual borders +``` + +### Outline + +[Outline](../styles/outline.md) is similar to border and is set in the same way. The difference is that outline will not change the size of the widget, and may overlap the content area. The following example sets an outline on a widget: + +```python title="outline01.py" hl_lines="22" +--8<-- "docs/examples/guide/styles/outline01.py" +``` + +Notice how the outline overlaps the text in the widget. + +```{.textual path="docs/examples/guide/styles/outline01.py"} +``` + +Outline can be useful to emphasize a widget, but be mindful that it may obscure your content. + +### Box sizing + +When you set padding or border it reduces the size of the widget's content area. In other words, setting padding or border won't change the width or height of the widget. + +This is generally desirable when you arrange things on screen as you can add border or padding without breaking your layout. Occasionally though you may want to keep the size of the content area constant and grow the size of the widget to fit padding and border. The [box-sizing](../styles/box_sizing.md) style allows you to switch between these two modes. + +If you set `box_sizing` to `"content-box"` then space required for padding and border will be added to the widget dimensions. The default value of `box_sizing` is `"border-box"`. Compare the box model diagram for `content-box` to the to the box model for `border-box`. + +=== "content-box" + +
+ --8<-- "docs/images/styles/content_box.excalidraw.svg" +
+ +=== "border-box" + +
+ --8<-- "docs/images/styles/border_box.excalidraw.svg" +
+ + +The following example creates two widgets with a width of 30, a height of 6, and a border and padding of 1. +The first widget has the default `box_sizing` (`"border-box"`). +The second widget sets `box_sizing` to `"content-box"`. + +```python title="box_sizing01.py" hl_lines="33" +--8<-- "docs/examples/guide/styles/box_sizing01.py" +``` + +The padding and border of the first widget is subtracted from the height leaving only 2 lines in the content area. The second widget also has a height of 6, but the padding and border adds additional height so that the content area remains 6 lines. + +```{.textual path="docs/examples/guide/styles/box_sizing01.py"} +``` + +### Margin + +Margin is similar to padding in that it adds space, but unlike padding, [margin](../styles/margin.md) is outside of the widget's border. It is used to add space between widgets. + +The following example creates two widgets, each with a margin of 2. + +```python title="margin01.py" hl_lines="26-27" +--8<-- "docs/examples/guide/styles/margin01.py" +``` + +Notice how each widget has an additional two rows and columns around the border. + +```{.textual path="docs/examples/guide/styles/margin01.py"} +``` + +!!! note + + In the above example both widgets have a margin of 2, but there are only 2 lines of space between the widgets. This is because margins of consecutive widgets *overlap*. In other words when there are two widgets next to each other Textual picks the greater of the two margins. + +## More styles + +We've covered the most fundamental styles used by Textual apps, but there are many more which you can use to customize many aspects of how your app looks. See the [Styles reference](../styles/index.md) for a comprehensive list. + +In the next chapter we will discuss Textual CSS which is a powerful way of applying styles to widgets that keeps your code free of style attributes. diff --git a/testbed/Textualize__textual/docs/guide/widgets.md b/testbed/Textualize__textual/docs/guide/widgets.md new file mode 100644 index 0000000000000000000000000000000000000000..2a4c11fbc024c5a991bfe75684a551d713cc5fc5 --- /dev/null +++ b/testbed/Textualize__textual/docs/guide/widgets.md @@ -0,0 +1,203 @@ +# Widgets + +In this chapter we will explore widgets in more detail, and how you can create custom widgets of your own. + + +## What is a widget? + +A widget is a component of your UI responsible for managing a rectangular region of the screen. Widgets may respond to [events](./events.md) in much the same way as an app. In many respects, widgets are like mini-apps. + +!!! information + + Every widget runs in its own asyncio task. + +## Custom widgets + +There is a growing collection of [builtin widgets](../widgets/index.md) in Textual, but you can build entirely custom widgets that work in the same way. + +The first step in building a widget is to import and extend a widget class. This can either be [Widget][textual.widget.Widget] which is the base class of all widgets, or one of it's subclasses. + +Let's create a simple custom widget to display a greeting. + + +```python title="hello01.py" hl_lines="5-9" +--8<-- "docs/examples/guide/widgets/hello01.py" +``` + +The three highlighted lines define a custom widget class with just a [render()][textual.widget.Widget.render] method. Textual will display whatever is returned from render in the content area of your widget. We have returned a string in the code above, but there are other possible return types which we will cover later. + +Note that the text contains tags in square brackets, i.e. `[b]`. This is [console markup](https://rich.readthedocs.io/en/latest/markup.html) which allows you to embed various styles within your content. If you run this you will find that `World` is in bold. + +```{.textual path="docs/examples/guide/widgets/hello01.py"} +``` + +This (very simple) custom widget may be [styled](./styles.md) in the same was as builtin widgets, and targeted with CSS. Let's add some CSS to this app. + + +=== "hello02.py" + + ```python title="hello02.py" hl_lines="13" + --8<-- "docs/examples/guide/widgets/hello02.py" + ``` + +=== "hello02.css" + + ```sass title="hello02.css" + --8<-- "docs/examples/guide/widgets/hello02.css" + ``` + +The addition of the CSS has completely transformed our custom widget. + +```{.textual path="docs/examples/guide/widgets/hello02.py"} +``` + +## Static widget + +While you can extend the Widget class, a subclass will typically be a better starting point. The [Static][textual.widgets.Static] class is a widget subclass which caches the result of render, and provides an [update()][textual.widgets.Static.update] method to update the content area. + +Let's use Static to create a widget which cycles through "hello" in various languages. + +=== "hello03.py" + + ```python title="hello03.py" hl_lines="24-36" + --8<-- "docs/examples/guide/widgets/hello03.py" + ``` + +=== "hello03.css" + + ```sass title="hello03.css" + --8<-- "docs/examples/guide/widgets/hello03.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/guide/widgets/hello03.py"} + ``` + +Note that there is no `render()` method on this widget. The Static class is handling the render for us. Instead we call `update()` when we want to update the content within the widget. + +The `next_word` method updates the greeting. We call this method from the mount handler to get the first word, and from an click handler to cycle through the greetings when we click the widget. + +### Default CSS + +When building an app it is best to keep your CSS in an external file. This allows you to see all your CSS in one place, and to enable live editing. However if you intent to distribute a widget (via PyPI for instance) it can be convenient to bundle the code and CSS together. You can do this by adding a `DEFAULT_CSS` class variable inside your widget class. + +Textual's builtin widgets bundle CSS in this way, which is why you can see nicely styled widgets without having to copy any CSS code. + +Here's the Hello example again, this time the widget has embedded default CSS: + +=== "hello04.py" + + ```python title="hello04.py" hl_lines="27-36" + --8<-- "docs/examples/guide/widgets/hello04.py" + ``` + +=== "hello04.css" + + ```sass title="hello04.css" + --8<-- "docs/examples/guide/widgets/hello04.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/guide/widgets/hello04.py"} + ``` + + +#### Default specificity + +CSS defined within `DEFAULT_CSS` has an automatically lower [specificity](./CSS.md#specificity) than CSS read from either the App's `CSS` class variable or an external stylesheet. In practice this means that your app's CSS will take precedence over any CSS bundled with widgets. + + +## Text links + +Text in a widget may be marked up with links which perform an action when clicked. Links in console markup use the following format: + +``` +"Click [@click='app.bell']Me[/]" +``` + +The `@click` tag introduces a click handler, which runs the `app.bell` action. + +Let's use markup links in the hello example so that the greeting becomes a link which updates the widget. + + +=== "hello05.py" + + ```python title="hello05.py" hl_lines="24-33" + --8<-- "docs/examples/guide/widgets/hello05.py" + ``` + +=== "hello05.css" + + ```sass title="hello05.css" + --8<-- "docs/examples/guide/widgets/hello05.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/guide/widgets/hello05.py" press="_"} + ``` + +If you run this example you will see that the greeting has been underlined, which indicates it is clickable. If you click on the greeting it will run the `next_word` action which updates the next word. + + +## Rich renderables + +In previous examples we've set strings as content for Widgets. You can also use special objects called [renderables](https://rich.readthedocs.io/en/latest/protocol.html) for advanced visuals. You can use any renderable defined in [Rich](https://github.com/Textualize/rich) or third party libraries. + +Lets make a widget that uses a Rich table for its content. The following app is a solution to the classic [fizzbuzz](https://en.wikipedia.org/wiki/Fizz_buzz) problem often used to screen software engineers in job interviews. The problem is this: Count up from 1 to 100, when the number is divisible by 3, output "fizz"; when the number is divisible by 5, output "buzz"; and when the number is divisible by both 3 and 5 output "fizzbuzz". + +This app will "play" fizz buzz by displaying a table of the first 15 numbers and columns for fizz and buzz. + +=== "fizzbuzz01.py" + + ```python title="fizzbuzz01.py" hl_lines="18" + --8<-- "docs/examples/guide/widgets/fizzbuzz01.py" + ``` + +=== "fizzbuzz01.css" + + ```sass title="fizzbuzz01.css" hl_lines="32-35" + --8<-- "docs/examples/guide/widgets/fizzbuzz01.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/guide/widgets/fizzbuzz01.py"} + ``` + +## Content size + +Textual will auto-detect the dimensions of the content area from rich renderables if width or height is set to `auto`. You can override auto dimensions by implementing [get_content_width()][textual.widget.Widget.get_content_width] or [get_content_height()][textual.widget.Widget.get_content_height]. + +Let's modify the default width for the fizzbuzz example. By default, the table will be just wide enough to fix the columns. Let's force it to be 50 characters wide. + + +=== "fizzbuzz02.py" + + ```python title="fizzbuzz02.py" hl_lines="10 21-23" + --8<-- "docs/examples/guide/widgets/fizzbuzz02.py" + ``` + +=== "fizzbuzz02.css" + + ```sass title="fizzbuzz02.css" + --8<-- "docs/examples/guide/widgets/fizzbuzz02.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/guide/widgets/fizzbuzz02.py"} + ``` + +Note that we've added `expand=True` to tell the Table to expand beyond the optimal width, so that it fills the 50 characters returned by `get_content_width`. + + +## Compound widgets + +TODO: Explanation of compound widgets + +## Line API + +TODO: Explanation of line API diff --git a/testbed/Textualize__textual/docs/how-to/animation.md b/testbed/Textualize__textual/docs/how-to/animation.md new file mode 100644 index 0000000000000000000000000000000000000000..4709f033e0b3e3f3226343c5099b7aba334c9b25 --- /dev/null +++ b/testbed/Textualize__textual/docs/how-to/animation.md @@ -0,0 +1 @@ +# Animation diff --git a/testbed/Textualize__textual/docs/how-to/index.md b/testbed/Textualize__textual/docs/how-to/index.md new file mode 100644 index 0000000000000000000000000000000000000000..48a0aac2606b601b5652f4c032abe6b827073244 --- /dev/null +++ b/testbed/Textualize__textual/docs/how-to/index.md @@ -0,0 +1,3 @@ +# How to ... + +For those who want more focused information on Textual features. diff --git a/testbed/Textualize__textual/docs/how-to/mouse-and-keyboard.md b/testbed/Textualize__textual/docs/how-to/mouse-and-keyboard.md new file mode 100644 index 0000000000000000000000000000000000000000..1707580e405464bc8b1923e1fb6e084f7f8a0907 --- /dev/null +++ b/testbed/Textualize__textual/docs/how-to/mouse-and-keyboard.md @@ -0,0 +1 @@ +# Mouse and Keyboard diff --git a/testbed/Textualize__textual/docs/how-to/scroll.md b/testbed/Textualize__textual/docs/how-to/scroll.md new file mode 100644 index 0000000000000000000000000000000000000000..a12cc92b4729c144a8323555b0cde7e481c01660 --- /dev/null +++ b/testbed/Textualize__textual/docs/how-to/scroll.md @@ -0,0 +1 @@ +# Scroll diff --git a/testbed/Textualize__textual/docs/images/actions/format.excalidraw.svg b/testbed/Textualize__textual/docs/images/actions/format.excalidraw.svg new file mode 100644 index 0000000000000000000000000000000000000000..b74fbad3fd1b066605e0c2021e64de30a83814f6 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ameOptional parametersapp.set_background('red') \ No newline at end of file diff --git a/testbed/Textualize__textual/docs/images/animation/animation.excalidraw.svg b/testbed/Textualize__textual/docs/images/animation/animation.excalidraw.svg new file mode 100644 index 0000000000000000000000000000000000000000..da9a23f25909125e0afe334c5fc4d266ed077a88 --- /dev/null +++ b/testbed/Textualize__textual/docs/images/animation/animation.excalidraw.svg @@ -0,0 +1,16 @@ + + + eyJ2ZXJzaW9uIjoiMSIsImVuY29kaW5nIjoiYnN0cmluZyIsImNvbXByZXNzZWQiOnRydWUsImVuY29kZWQiOiJ4nO1XWVPjRlx1MDAxMH7nV1DeVyzmPrYqlYJcdTAwMDVcdTAwMTJcdTAwMDJLXHUwMDBlczib2ofBXHUwMDFh21x1MDAxM8uSkMZcdTAwMDaW4r+nJVx1MDAxM48vwrnUblX0YGumZ3q+6e6vu3Wztr7e8Ne5bbxfb9irjklcXFxcmMvGRjU/tkXpslx1MDAxNESkXHUwMDFll9mo6NQr+97n5fvNzaEpXHUwMDA21ueJ6dho7MqRSUo/il1cdTAwMTZ1suGm83ZY/lj9XHUwMDFlmaH9Ic+GsS+icEjTxs5nxeQsm9ihTX1cdNr/gvH6+k39O4POXHUwMDE0RTZcdTAwMDFWT1x1MDAwN3BKL05cdTAwMWVlaY1cdTAwMTMjrjSjWuDpXG5X7sBR3sYg7lx1MDAwMlxcXHUwMDFiJNVU42Tvl7TZ/nX76rh1fDDO+4j+dNVcdKd2XZK0/HUysYLp9EeFXHLS0lx1MDAxN9nAnrnY9/812sz8dF9syj5cdTAwMDCYiots1OuntqwuXHUwMDFmkGa56Th/XV9cdTAwMDNNZ03aq5WEmStcdTAwMThRwSMqXHUwMDE0XHUwMDE3XGZRQZhUU2m1n2lcdTAwMWNxXHUwMDAxcsyRRIxcdTAwMTK5gOxDloBcdTAwMWZcdTAwMDDZO1Q/XHUwMDAx2rnpXGZ6gC+Np2t8YdIyN1x1MDAwNXgrrLu8uzOONGZIXHUwMDEwPpX0rev1fWVcdTAwMGXCXCI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acvAXHUwMDAyrJBklrt7wYggirFw2UcnlbJcdTAwMWE8M6lQKlmIlCcklW6W+pb7Ulx1MDAwN1x1MDAxNJqb3TNDl1xcz/mtjtHKUG5oZy1Z2rpsVlx1MDAxZjdza7dcdTAwMTLXS+uqarvzwe1cdTAwMWR8XHUwMDE1T8U+m7l3XHUwMDA3zjagrthfyjdZ4XouNcnxLI5nsYrcW8zhq1x1MDAxMVPIXG6Pp9Vps9y/lGdcdTAwMTe90+ukvfOlO+52bfNbp1x1MDAxNYH0x1x1MDAxNaZcXCqFkObznTiQKVx1MDAxMlxcK2jEXHUwMDE5NFLQkn81XnHyKF5BktaKMvyMYv1cdTAwMTJesSrLvlx1MDAxOa/GJlx1MDAxOX1cdTAwMTPEmlx1MDAwMJkwa+2uXCI2TJ63PNhcdTAwMDdcdTAwMTZMeFx1MDAwNi5w8d0lg7rG2NnL7eUoeNetn0przdaKXHUwMDE4tnLAze3a7T8uXFzYXHUwMDFjIn0= + + + + timevalue \ No newline at end of file diff --git a/testbed/Textualize__textual/docs/images/child_combinator.excalidraw.svg b/testbed/Textualize__textual/docs/images/child_combinator.excalidraw.svg new file mode 100644 index 0000000000000000000000000000000000000000..47e3b0d8e5e728e02904c7f76da41f3d65ac2cae --- /dev/null +++ b/testbed/Textualize__textual/docs/images/child_combinator.excalidraw.svg @@ -0,0 +1,16 @@ + + + eyJ2ZXJzaW9uIjoiMSIsImVuY29kaW5nIjoiYnN0cmluZyIsImNvbXByZXNzZWQiOnRydWUsImVuY29kZWQiOiJ4nO1daXPayFx1MDAxNv2eX+HyfMmrXHUwMDFhNL0vUzX1ylx1MDAxYl6It1x1MDAxOMdxXqamXHUwMDA0yFi2QFjIYDw1//3dxlx1MDAxOFx0kFx1MDAwNDiIQCaaqlx1MDAxOCTRurp9l3P6dvf8/W5jYzPstZzN3zc2naeq7bm1wO5u/mrOd5yg7fpNuET639v+Y1Dt33lcdTAwMWKGrfbvv/3WsIN7J2x5dtWxOm770fba4WPN9a2q3/jN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E3XHUwMDA3joR1XHUwMDE3M001yc71XHUwMDFiI4uHQVx1MDAxY7PGiygzUYlINLlOd3K18DqFqnSrNUdkr3OGq3RcdTAwMWWSselcdTAwMTnHRFx1MDAxMqlm5yFS2yd35O7sYLdXrX/0xd72WUWkxKtcdTAwMTVcdTAwMTlDJlx1MDAxNFx1MDAwMI7Go9jhZb8z9mrd31TmyVx1MDAxODkmSdPeJiFcZlx1MDAwNtJcdTAwMDH2IN8y2+1bho5Xi2YnXHUwMDExm9lnt142a05gXGLLRnjrtjde9lx1MDAxZE+e6qpGfjz7VNfQb6WxmZHXXHUwMDFhpy7Jor1ccnxA0EhcdTAwMDVcdTAwMWbIJGQ5x+L67P5fSW+mWFlcdTAwMTC2zNbiXHUwMDE0Y6FGx1x1MDAxNFx1MDAwNMA9zNToXG6qMY92hJRv92hNLU0pXHUwMDE1ZjNcdTAwMWUmaGxCXnxcdTAwMTVX4lx1MDAxYS6zmo/QkZLdXHUwMDBmXHUwMDAxOLJzwijggNxcdTAwMGXAXHUwMDExXHUwMDExXGKMWkNATli4XHUwMDBl0VrNwlW+XHUwMDE5a1x1MDAxOHGkJmbSqlZcdTAwMDSeiVTiYliwMqzM/zvDbFx1MDAwMrXe2CPVes1ReDXcNOTxbtDupt1qXYRgZcNeXHUwMDAwQ3Zrg5BcdTAwMWS93GbHdbrbXHTuddM/TFx1MDAwNOyr0Vx1MDAwNFx1MDAxYce84t//vPvn/yxzRNUifQ== + + + + Container( id="dialog")Horizontal( classes="buttons")Button("Yes")Button("No")Screen()Container( id="sidebar")Button( "Install")Underline this button \ No newline at end of file diff --git a/testbed/Textualize__textual/docs/images/css_stopwatch.excalidraw.svg b/testbed/Textualize__textual/docs/images/css_stopwatch.excalidraw.svg new file mode 100644 index 0000000000000000000000000000000000000000..931702ccff50d8666033a028cda0d7a559bd39fd --- /dev/null +++ b/testbed/Textualize__textual/docs/images/css_stopwatch.excalidraw.svg @@ -0,0 +1,16 @@ + + + eyJ2ZXJzaW9uIjo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cdTAwMTMpOVlcdTAwMTQujUmVu3TAXHUwMDAxlFx1MDAwM7hpRiWAUckkXm3aXHUwMDA0QcRTm+pVXFxe6ZuR5eTjTeTjzVON6Fx1MDAxNbRlLsRkoZZ5kbybKiNnXHUwMDE2Qlx1MDAxNS1GXHUwMDE1RHqXKKVEb4BVs/5Ar1x1MDAxYSdcdTAwMDdu9fjspkrCI+ZcdTAwMDRrXHUwMDBmK6hcdTAwMTUqZtn7usmjnFx1MDAxOIxcIvyx5+tcdTAwMTLOhSwmXHUwMDEwkECI1e1cdTAwMTOJ5jLGqcSrRJbehil7czGEzWS0xTE26dZcYmtcdTAwMWLPKrRkdru6TVx1MDAxNDs3Qp6eXHUwMDFj135+/XHXpZ+u6u9cdTAwMTXfZNp4xm9cZlx1MDAxNFx1MDAxNU/Nr6eNp/9cdTAwMDDD6SGzIn0= + + + + Stop00:00:00.00ResetStart00:00:00.00StopwatchStarted Stopwatch \ No newline at end of file diff --git a/testbed/Textualize__textual/docs/images/descendant_combinator.excalidraw.svg b/testbed/Textualize__textual/docs/images/descendant_combinator.excalidraw.svg new file mode 100644 index 0000000000000000000000000000000000000000..1f5a7ce8d1c0bdf6a8b12a251febd62cef920f6e --- /dev/null +++ b/testbed/Textualize__textual/docs/images/descendant_combinator.excalidraw.svg @@ -0,0 +1,16 @@ + + + eyJ2ZXJzaW9uIjoiMSIsImVuY29kaW5nIjoiYnN0cmluZyIsImNvbXByZXNzZWQiOnRydWUsImVuY29kZWQiOiJ4nO1dWXPiSFx1MDAxMn7vX+HwPOzsRKOp+5iIiVxyfODbbjdu293bXHUwMDEzXHUwMDBljGSQXHUwMDExXHUwMDEylmSwPTH/favARlx1MDAwMiRZXHUwMDFjYmCnefAhQSmVyuP7KiuLPz9sbGyGz1x1MDAxZGvzt41N66lec2zTr/U2P+rjXctcdTAwMGZsz1WnUP//wHv06/13NsOwXHUwMDEz/Pbrr+2a37LCjlOrW0bXXHUwMDBlXHUwMDFla05cdTAwMTA+mrZn1L32r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PhcdTAwMDPFZsTH9+NcdTAwMDVUXHUwMDA1T8R5fk/OfvCrjD9cdTAwMTAxMMaC6u2zIIjvXHUwMDEw1XdoXHUwMDE1YYnsr+wqXGJ/MGlwyoWKXHUwMDE5XHUwMDEyYUXdo4npqKjBjMGU31x1MDAwNLFcdTAwMTCMU5XIwLJbUVxuhlx1MDAxZtl5YWNkwlx1MDAwMynlYaQ3RVx1MDAxMIIgNDndIYz+ZMeM4CP3LIdcdTAwMTJF51lcYlx1MDAwMVwiXGbr73lcdTAwMTJsQlx1MDAxNjiQN0madYJcdTAwMWSpNqtfpaG5pmGOXHUwMDBmr1x1MDAwM2/WOp1qqGxrqH9lvrb5XHUwMDFhqaO72+zaVm8ryav6L1x1MDAxZFx1MDAwMPt61GHG0vf4519cdTAwMWb++lx1MDAxZow/wb0ifQ== + + + + Container( id="dialog")Horizontal( classes="buttons")Button("Yes")Button("No")Screen()Container( id="sidebar")Button( "Install")match these*don't* match this \ No newline at end of file diff --git a/testbed/Textualize__textual/docs/images/dom1.excalidraw.svg b/testbed/Textualize__textual/docs/images/dom1.excalidraw.svg new file mode 100644 index 0000000000000000000000000000000000000000..54634dc1de731ef7d2be27c6aa3e8a920ba3a0bb --- /dev/null +++ b/testbed/Textualize__textual/docs/images/dom1.excalidraw.svg @@ -0,0 +1,16 @@ + + + eyJ2ZXJzaW9uIjoiMSIsImVuY29kaW5nIjoiYnN0cmluZyIsImNvbXByZXNzZWQiOnRydWUsImVuY29kZWQiOiJ4nM1Ya0/jOFx1MDAxNP3Or6i6X3YlXGKOY8fxSKtcdTAwMTXPpSywo1x1MDAwMVxyj9VcYrmJaT3Na1x1MDAxMpfHIP77XqdMXHUwMDFlbVxiZVx1MDAxN0ZEUZv4OtfX1+fc4+R+pdfr67tU9j/0+vLWXHUwMDE3oVxuMnHTXzXt1zLLVVx1MDAxMoNcdFx1MDAxN/d5Ms38oudY6zT/sL5cdTAwMWWJbFwidVx1MDAxYVxuX1rXKp+KMNfTQCWWn0Tr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8JcbkWut5IoUlx1MDAxYdL/MVGxnk9zkc9ccsPvsVx1MDAxNMG8XHUwMDE1plW3zVx1MDAxN4LUeGzu3KqrXsWU4qa8/rLa2nttXHUwMDExweaoYbfysFL/NzuQwmdfpOmxXHUwMDA2pJVrXHUwMDAwYFbBY+GuJta/VvJms+Xb0lVxmDRcdTAwMTYpNCVHmundP6w8/Fx1MDAwYlxiYlx1MDAxObwifQ== + + + + ExampleApp()Screen() \ No newline at end of file diff --git a/testbed/Textualize__textual/docs/images/dom2.excalidraw.svg b/testbed/Textualize__textual/docs/images/dom2.excalidraw.svg new file mode 100644 index 0000000000000000000000000000000000000000..bd636267f4e9c55076f927ebd0646f4d6ded6a37 --- /dev/null +++ b/testbed/Textualize__textual/docs/images/dom2.excalidraw.svg @@ -0,0 +1,16 @@ + + + eyJ2ZXJzaW9uIjoiMSIsImVuY29kaW5nIjoiYnN0cmluZyIsImNvbXByZXNzZWQiOnRydWUsImVuY29kZWQiOiJ4nO1aa0/bSFx1MDAxNP3Or0DZL7tS4877UWm1glx1MDAxNpZ3aWFcdTAwMDNlVVWuPSReP2s7QKj633dsgu28XHUwMDFjXHUwMDEzXHUwMDEyNpXWQiGZmdy5nrnnzLk3/r6xudlKXHUwMDA3kWq92WypO8v0XHUwMDFjOzZvW6+y9lx1MDAxYlx1MDAxNSdOXHUwMDE46C6Uf07CfmzlI3tpXHUwMDFhJW9ev/bN2FVp5JmWMm6cpG96Sdq3ndCwQv+1kyo/+SN7PTF99XtcdTAwMTT6dlx1MDAxYVx1MDAxYuUkbWU7aVx1MDAxOD/MpTzlqyBNtPW/9efNze/5a8U72zH9MLDz4XlHxT0hx1tPwiB3XHUwMDE1Ulx1MDAwNLEkklx1MDAxNFx1MDAwM5zknZ4sVbbuvdZcdTAwMGWrsidralxyTi//7Jn/qItLwY5Odq7hh17nvJz12vG8s3TgPayDafX6sSp7kzRcdTAwMGVddeHYaS+bfKy9+F5cdTAwMTLqJSi/XHUwMDE1h/1uL1BJMvKd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3RXGbmXFw011x1MDAxMvXqal1cdFxyXHUwMDBiXHUwMDAzScFcdTAwMDVikmnJUFx1MDAxZVRcdTAwMGaEpqVcdTAwMDTCNPuVnFxiQenqXGJNYoNBiHQ8M4xw5cHeks6kgVx1MDAwNOeSUo6ZoHLy2V/B9Z2QhTLCZ/HZokJj2XxcdTAwMDZcZk1j2lx1MDAxYlx1MDAwMfR2MSRk+ZxiwVx1MDAxZNyA+TOTXHUwMDEwPGzognxWrzxGfKJASL1OTGtcdTAwMDRcbinhXHUwMDEzLlx0gzJ9XGZcdTAwMDGYXHUwMDFmm1iIn5rNZlx1MDAwNXJ2TYTwLCrbXHUwMDE4mm+ZUXSW6ngrtkKHtGNcdTAwMGbVaXmPrVx1MDAxYkfdbk95vP46vzLBl69mxkIqu9PvPzZ+/Fx1MDAwYlx0sVx1MDAwYuIifQ== + + + + ExampleApp()Screen()Header()Footer() \ No newline at end of file diff --git a/testbed/Textualize__textual/docs/images/dom3.excalidraw.svg b/testbed/Textualize__textual/docs/images/dom3.excalidraw.svg new file mode 100644 index 0000000000000000000000000000000000000000..86fb5e78d8d6e94f74ee0ce6f25e4e0f532bdb11 --- /dev/null +++ b/testbed/Textualize__textual/docs/images/dom3.excalidraw.svg @@ -0,0 +1,16 @@ + + + eyJ2ZXJzaW9uIjoiMSIsImVuY29kaW5nIjoiYnN0cmluZyIsImNvbXByZXNzZWQiOnRydWUsImVuY29kZWQiOiJ4nO1d+1PiyFx1MDAxNv59/oop95e9VWO2+/T7Vt265Vx1MDAwYnVcdTAwMWSfOFx1MDAwYnrnllx1MDAxNSFcdTAwMDIjLyGIurX/+z1cdTAwMWSVXHUwMDA0Qlx1MDAwMihB2DvU7qhJ6Jx0n/Od7+tX/vz0+fOa/9j21v75ec17KLn1Wrnj9te+2OP3XqdbazXxXHUwMDE0XHUwMDA0f3dbvU4puLLq++3uP3/7reF2bj2/XXdLnnNf6/bcetfvlWstp9Rq/FbzvUb33/bfI7fh/avdapT9jlx1MDAxM95k3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AwMTK4nYmhR+ya42ZAxNFcdTAwMDKBk1x1MDAwMlD7hoKw2kM+JFx1MDAxY5RiRiq7ZT5nXHUwMDEw31ODW9/h5i1vjV1mLJtcdTAwMDE4wM7+4kiJhGG2VaPvSVx1MDAxYeyJSKyu5VxiL1x1MDAwNONN67ehWfrowDBbXHUwMDAzKkBSXHUwMDEwOliCQlh8IzTlIFx1MDAwMCuqXHUwMDA3RGU1gSzRi4OTo/47L1x1MDAxOItsZVx1MDAxN+NklGKiYDO8TTF9ouiyolx1MDAxOJNcdTAwMGV7fte1XHUwMDA0VFx1MDAwNsNbPVtcdTAwMTSzkk4pad/LrNiIXfNDMbxcdTAwMTFcYlRnRnOmkVSNQzHlgFx1MDAwNo2pXHUwMDA1qN2bKbZcdTAwMDSKoZnYZvxvRsimXHUwMDA2seC9YkhcdTAwMDFcdTAwMDBZqaaMKjlmL0dKXHUwMDFkgdyIXGIuUPNgXHUwMDEye+N2s+lzI0esYsq+XCJcdTAwMDVcdTAwMThcdTAwMTNKo9aKb2kmXHUwMDFkXGZuJIlcdTAwMDSI3Ss0btMqYdl6ojPbT8yNk8Ds08tcctbcdtv2dnmD1kC/rpVf+lx1MDAwMMOnXFy7r3n9zXjc/XJcdTAwMTN8bMdXUJ9cdTAwMTaJPPusf/716a//XHUwMDAxsk3fXHUwMDAxIn0= + + + + App()Screen()Header()Footer()Container( id="dialog")Horizontal( classes="buttons")Button( "Yes", variant="success")Button( "No", variant="error")Static( QUESTION, classes="questions") \ No newline at end of file diff --git a/testbed/Textualize__textual/docs/images/events/bubble1.excalidraw.svg b/testbed/Textualize__textual/docs/images/events/bubble1.excalidraw.svg new file mode 100644 index 0000000000000000000000000000000000000000..f4b79d10111a9d9a40e96a814aa7040bba9372a4 --- /dev/null +++ b/testbed/Textualize__textual/docs/images/events/bubble1.excalidraw.svg @@ -0,0 +1,16 @@ + + + eyJ2ZXJzaW9uIjoiMSIsImVuY29kaW5nIjoiYnN0cmluZyIsImNvbXByZXNzZWQiO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AXHUwMDEzXGYpxHXqj1x1MDAwMZkpQzCMOaeKXHUwMDBi/qJXw+ZQXHUwMDE5NVx1MDAxOMijxFx1MDAwNM4kKKUpVEZcZlx1MDAwMcJcdTAwMDR0iVJcdTAwMTIxltnv/Vh0oUpcYs1AvKyXzJgmXHUwMDE5sfQvktlcdTAwMGVQXHUwMDA3lVx1MDAwMCTMQEpKJsgkdYCjKbhZUVxuLCM0aM7n0Vl+1XTMqMQmXHUwMDA07UEkSEz0hFEw/UQgcCeiXHUwMDE45CdWr5rOdmaHc3JMXHUwMDA28lx1MDAxM1x0LbdcXCwzr7OOcVx1MDAxYeeYwaLCXHUwMDE3L1x1MDAxNvNcdTAwMWatfetL7XDvwlx1MDAxM7FC3S46vmttOqdcdEZcckWJgHDjXHUwMDEyKzZZK9ZUKFhQYGXNvlT2nPddmSWcO87YJKVcdTAwMTGR9pxcdTAwMTaKM1vQXHUwMDFlOEtCqqVhTp7xXGJoXHUwMDFlZ1xyw2pKyaLt69L9j6/V71cq+u53j3ixcVJ9eSWkKE87ptM+/G7+1Y0vT2k1qsYzXHUwMDFl+i6pXHUwMDEyMn0gabePiJrN36BcdTAwMDKUeMrjsFxccM6qhEiSkzrBIVx1MDAwNVx1MDAxNotcdTAwMDMzf/o2XHUwMDE2mCpcdTAwMGaYmsHStCRg5qpccsKnQJNMpEZcdTAwMThcdTAwMDNXcs7Uup/OPjFcdTAwMWPTWU9cdTAwMGIhmUeGI4WQdJCPhVx1MDAxMKeT2GR8cHpvXHUwMDFhTu/9deHiujDjXHUwMDA1Tj3y46W9wDlnkVx1MDAxOa92TDd4gMmtXHUwMDA3oFx1MDAxN8xW6zxcdTAwMDa/XHUwMDBlXHUwMDA1XGZMnWs/OCf1ZaHjOt29Kbx+1z+SXvs4T1x1MDAwMOUkXHUwMDEz9/PX1q//XHUwMDAxXHUwMDA3vCMgIn0= + + + + App()Container( id="dialog")Button( "Yes", variant="success")Button( "No", variant="error")events.Key(key="T") \ No newline at end of file diff --git a/testbed/Textualize__textual/docs/images/events/bubble2.excalidraw.svg b/testbed/Textualize__textual/docs/images/events/bubble2.excalidraw.svg new file mode 100644 index 0000000000000000000000000000000000000000..e3e4d207913d61c1dbd74083483a7b09cb75b1d2 --- /dev/null +++ b/testbed/Textualize__textual/docs/images/events/bubble2.excalidraw.svg @@ -0,0 +1,16 @@ + + + eyJ2ZXJzaW9uIjoiMSIsImVuY29kaW5nIjoiYnN0cmluZyIsImNvbXByZXNzZWQiOnRydWUsImVuY29kZWQiOiJ4nO1cXG1T4spcdTAwMTL+7q+wOF/2Vq3ZeX85VVu3XHUwMDE01PXdVVddr6e2YohcdTAwMTBcdFx0Jlx1MDAwMcSt/e+ngyxJeFx0iODi3U1ZXHUwMDAymaHT09P9zNOdXHTfV1ZXXHUwMDBiUadhXHUwMDE3/l4t2Fx1MDAwZpbpOuXAbFx1MDAxN97H51t2XHUwMDEwOr5cdTAwMDdNpPs59JuB1e1ZjaJG+PeHXHUwMDBmdTOo2VHDNS3baDlh03TDqFl2fMPy61x1MDAxZpzIrof/jf9cdTAwMWaadftjw6+Xo8BILrJml53IXHUwMDBmnq5lu3bd9qJcdTAwMTCk/1x1MDAwZj6vrn7v/k9pV3bMuu+Vu927XHKJekKiwbOHvtdVVWpMJNOc9js4YVx0Llx1MDAxNtllaL1cdTAwMDWF7aQlPlVwS+dccr0vNre3qvdRdHrepHf1teSqt47rnkZcdTAwMWT3yVx1MDAwZaZVbVx1MDAwNnbSXHUwMDFhRoFfsy+cclSFdjxwvv+90Fx1MDAwN1x1MDAxMyTfXG78ZqXq2WGY+Y7fMC0n6sTnUDI+06t0ZSRnXHUwMDFl4lx1MDAxZVx1MDAxOFx1MDAxYlgozjiTQlLBkvF2es1cXCiKNSWSQC86oFnRd2EmQLO/UPdIdLsxrVpcdTAwMDVcdTAwMTT0yklcdTAwMWZFLI1To27/XHUwMDFjr6JcdTAwMDZjlFx1MDAxMEmJplx1MDAxYVx1MDAxMd7vUrWdSjWK+1x1MDAxMGIo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()Container( id="dialog")Button( "Yes", variant="success")Button( "No", variant="error")events.Key(key="T")events.Key(key="T")bubble \ No newline at end of file diff --git a/testbed/Textualize__textual/docs/images/events/bubble3.excalidraw.svg b/testbed/Textualize__textual/docs/images/events/bubble3.excalidraw.svg new file mode 100644 index 0000000000000000000000000000000000000000..afc97dc2f0a5cfc98d98fbba096eb0e23d449f77 --- /dev/null +++ b/testbed/Textualize__textual/docs/images/events/bubble3.excalidraw.svg @@ -0,0 +1,16 @@ + + + eyJ2ZXJzaW9uIjoiMSIsImVuY29kaW5nIjoiYnN0cmluZyIsImNvbXByZXNzZWQiOnRydWUsImVuY29kZWQiOiJ4nO1cXGtT4lhcdTAwMTP+7q+w2C/zVlxy2XO/bNXWW4p3XHUwMDFkXHUwMDFkXHUwMDA1dZzXLStAhFxmgWBcdTAwMTK8zNb+97dcdTAwMGYqXHS3XHUwMDEwlTgwO1QpkFx1MDAxYzqdPt1Pnu7Tyd8rq6uF6KHrXHUwMDE0/lgtOPc123PrgX1X+Gi23zpB6PpcdTAwMWTYRfrfQ79cdTAwMTfU+iObUdRccv/4/fe2XHUwMDFktJyo69k1x7p1w57thVGv7vpWzW//7kZOO/yv+X9ot50/u367XHUwMDFlXHUwMDA1VnyQolN3Iz94PJbjOW2nXHUwMDEzhSD9f/B9dfXv/v+EdnXXbvuden94f0esXHUwMDFl13p066Hf6auKmWBMak3jXHUwMDExbrhcdTAwMDFHi5w67L5cdTAwMDaNnXiP2VRAZVxc/LZ3vr7+5UpUrtTa3XkobuPDXrueV45cdTAwMWW8R0PYtWYvcOK9YVx1MDAxNPgt59ytR01z9JHtg9+FPtgg/lXg91x1MDAxYc2OXHUwMDEzhkO/8bt2zY1cdTAwMWXMNoRcdTAwMDZb7U6jLyPeclx1MDAwZt+KmEhLIaQ5ZZxJitRgd19cdTAwMDDllmJKI0a1YFxu61x1MDAxMcVKvlx1MDAwNzNcdTAwMDGK/Yb6r1i1ql1rNUC/Tj1cdTAwMWWjSE3jxEnfPZ+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MT5dLzzNWh5/jXHUwMDA2zF9rJMCI2DzCLNHN8bw4zCxBuVx1MDAxNppIhVx1MDAxOWj+3NPxwqfLpcfu6tCKNaJEKTgq4qbpR3MxrpayXHUwMDAwdDVkrlxcKUSVYGNaLdUqdJpP91x1MDAwN4y7cyxzJfn+Yr6RuJyNXHUwMDAwXHUwMDFiU5pcIk1Zdrpx4GyfXpVON4vnVcq/ke1cdTAwMTLZrp0sPLBJYVx1MDAxMbP2jzhcdTAwMDZGQYZxjUjz5DlOzJ2KXG6ihOXXJpgowMRkY6xvxviAIFi9a7VcdTAwMDbYXHUwMDE45TSvxaPxrt9qr1pNXHUwMDEygSS5UEOjs3byRn53XHUwMDFhr1x1MDAxODqLUVx1MDAxMvGkyWNsrTxFcMHudstcdTAwMTFYaFx1MDAwMHgwXHRu/ek0Y3mFW9e5W59QXHUwMDFhuO6/jNR+vJrIcMxcdTAwMTT8/c/KP/9cdTAwMDeoXHUwMDAzMlx1MDAwNiJ9 + + + + App()Container( id="dialog")Button( "Yes", variant="success")Button( "No", variant="error")events.Key(key="T")events.Key(key="T")events.Key(key="T")bubble \ No newline at end of file diff --git a/testbed/Textualize__textual/docs/images/events/naming.excalidraw.svg b/testbed/Textualize__textual/docs/images/events/naming.excalidraw.svg new file mode 100644 index 0000000000000000000000000000000000000000..5a9a2fb4ca4df91780ef32824528075e016b002d --- /dev/null +++ b/testbed/Textualize__textual/docs/images/events/naming.excalidraw.svg @@ -0,0 +1,16 @@ + + + eyJ2ZXJzaW9uIjoiMSIsImVuY29kaW5nIjoiYnN0cmluZyIsImNvbXByZXNzZWQiOnRydWUsImVuY29kZWQiOiJ4nNVaa0/byFx1MDAxYf7eX1x1MDAxMeV8OStcdTAwMTV37pdKq1x1MDAxNbC0hZSKXHUwMDE2SludripjT1x1MDAxMlx1MDAxN8c29oTLVvz3845cdLGdXHUwMDFiJFx1MDAwNJaNXHUwMDA0iWcm9ut3nud5L86vXHUwMDE3rVbbXmWm/brVNpeBXHUwMDFm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wNDditpqSLX7S0rRcdEmCXHUwMDA1lLRKYoqRXHUwMDE0fMomXHUwMDA1abBEXHUwMDAyYVxydkGWPG3Uv0nKNuaCuZydwvHalIyrudVcdTAwMTZWIJ5Y1blxl5QtTsv/XHUwMDAxKVN3VltaeKrsW0OgRnDHXHUwMDEzWZlcdTAwMDAoUijFXHUwMDFj7sX8xlxubFs3kKsqXHUwMDE5cTVcdTAwMWRkN1x1MDAxYVx1MDAwNFWDINVcdTAwMTKuKinDwnNSi7iCilx1MDAwYik5lZRp95iB1DvfT5OVrVos3VPKXHUwMDE2l/CNXHUwMDA0XGLCsqZcXFNcbuVcdTAwMDSkZOCQXHUwMDFhjUa6IT1QXGbwn1x1MDAwMGAzwlx1MDAxOF1NzFx1MDAxNj8wa1olmGBaXHUwMDBipIWSkFxyztJXXHL7XHUwMDBmlTSDRIVCMf3v1rL5cC6np5G8pJrN61x1MDAxY1x1MDAxMTz3iSiBbFx1MDAwNMKJXFyidbQ48W5qWd9cdTAwMGb6w9zMU7N1NY/0nSUmV56mXHUwMDAwJii1QdpcdTAwMTVrylx1MDAxOVXSQ1gypLSm5IE/XGawuZ9cdTAwMTSZn1x1MDAwMyVm5GZcdTAwMTJcIlx1MDAxNilcdTAwMDFfnmlGbkaxJ1x1MDAxNSbAjNGrZs2oyoRbgJJ4lVx1MDAxZlxiPNcnR5hJcEu1tyv2loTHXHUwMDE0XHUwMDE0Nje+hZdsrFx1MDAxYfeamt1cImdwmvxcYtxcdTAwMDb+OFx1MDAxOVpcdTAwMGJcdTAwMDdcdTAwMDVQILCmkYOPu02Ez92hp3icNNfWXHUwMDE3t74u/dz2s+zQgpfHalxyMInCkauqK7TPI3OxNetnWOXLnbVcdTAwMTRcdTAwMWPHbONA8uv6xfX/XHUwMDAx2ibQXHUwMDAzIn0= + + + + Makes the methoda message handlerMessage namespace(outer class)Name ofmessage classon_color_button_selected \ No newline at end of file diff --git a/testbed/Textualize__textual/docs/images/events/queue.excalidraw.svg b/testbed/Textualize__textual/docs/images/events/queue.excalidraw.svg new file mode 100644 index 0000000000000000000000000000000000000000..45230f41baf29fc566b1e0f4d8fc7b697ce1f462 --- /dev/null +++ b/testbed/Textualize__textual/docs/images/events/queue.excalidraw.svg @@ -0,0 +1,16 @@ + + + eyJ2ZXJzaW9uIjoiMSIsImVuY29kaW5nIjoiYnN0cmluZyIsImNvbXByZXNzZWQiOnRydWUsImVuY29kZWQiOiJ4nO1cXGtT28hcdTAwMTL9zq+g2C97q4Iyj57XVm3dXG6Eh8NcdTAwMWJCSPbuXHUwMDE2JWzZViw/sGRcZknlv99cdTAwMWVcdTAwMDGWLEu2McaYutdcdFx1MDAxOEujUVvTp/ucnpF+rqyurkV3XHUwMDFkb+2P1TXvtuxcdTAwMDZ+pev2197Z7TdeN/TbLdzF4s9hu9ctxy3rUdRcdP94/77pdlx1MDAxYl7UXHTcsufc+GHPXHLCqFfx20653XzvR14z/Lf9feg2vT877WYl6jrJSda9ilx1MDAxZrW79+fyXHUwMDAyr+m1olx1MDAxMHv/XHUwMDBmfl5d/Vx1MDAxOf9OWVx1MDAxN/gtL25cdTAwMWJvTWzjhGW3XHUwMDFltluxnYxpJYFcbjlo4IdcdTAwMWbxTJFXwb1VtNZL9thNa3ew7a9v1GuNw6P92uXn453d/r5Mzlr1g+Asulx1MDAwYu4vgluu97opm8Ko2254XHUwMDE3fiWqP16z1PbBcVx1MDAxNTeso1x1MDAwMYPd3XavVm95of3udLC13XHLfnRnt1x1MDAxMTLY6rZqcSfJllv8XHUwMDA0TDlcXFFiuFx1MDAxMoNcdTAwMWT2UC7AoZRRZncxo1x1MDAxNM9cdTAwMTi12Vx1MDAwZXBcdTAwMDTQqN9I/EqsunLLjVx1MDAxYZrWqlxm2kRdt1x1MDAxNXbcLo5T0q7/+HVcdTAwMWRJQSpcbmBwREApXHUwMDE4NKl7fq1cdTAwMWVZczRzXHUwMDE4lZRcbs2pXHUwMDAyloxL6MVDXCK0XHUwMDA2LiE51FrQKVVit/gne0Hrbrfzc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dTAwMDCEdOzDkYjUklx1MDAxMmDPm8ii7ErrvHvX5lx1MDAxMlNcdTAwMDHiqDpLXHUwMDA1fGlcXHX8o1x1MDAwM3Rx4UNrJGmM8enDqiq3dvfDm1x1MDAxZF1vymr3MvhQqvpmtsLH4vgqRUnlUKGZNMo+XHUwMDA3avg2S8GIozVFSYNcdTAwMTRcdTAwMDFkXHUwMDE2RfNjq9xcdTAwMTBHWSdcdTAwMTSA0VvTvFx0XHUwMDFi7iBcdTAwMTNcdTAwMDVqn+oh7TrQrL9yaiTmhtd43Fx1MDAwN1+Iu45Zxc9cdTAwMDE4t3Cd2lt31zuNnb1bV1x1MDAxZl/pfr9zXHUwMDFjnFx1MDAxZpr9ZVx1MDAwZq2KO0rZKVx1MDAxMeuvOlWHi52VY9RcdTAwMDP0JFx1MDAwZZpcdTAwMTIqnuWtXHUwMDBmRfmc0KpcdTAwMWNcdTAwMTR3qGONQHVl1ySPuirTjp2HQkuJoExcdTAwMTgyqqwk2FuDXHUwMDA0vEJsfbqzrjxcdTAwMTSp19xO5yzCLtdcdTAwMWXn9NBqv/JQ2Uu6Wbvxvf5GXHUwMDFls4pftiRcdTAwMTZcdTAwMDPAeplnbf75a+XXf1x1MDAwMfpa2G0ifQ== + + + + events.Key(key="T")events.Key(key="e")events.Key(key="x")Message queueon_key(event)Event handlerevents.Key(key="t") \ No newline at end of file diff --git a/testbed/Textualize__textual/docs/images/events/queue2.excalidraw.svg b/testbed/Textualize__textual/docs/images/events/queue2.excalidraw.svg new file mode 100644 index 0000000000000000000000000000000000000000..d4ed6be006822c4e2ddfe2eef297aa997b775f0c --- /dev/null +++ b/testbed/Textualize__textual/docs/images/events/queue2.excalidraw.svg @@ -0,0 +1,16 @@ + + + eyJ2ZXJzaW9uIjoiMSIsImVuY29kaW5nIjoiYnN0cmluZyIsImNvbXByZXNzZWQiOnRydWUsImVuY29kZWQiOiJ4nO1daXPbOLb93r9cIpX+8l5Vi1xy3Fx1MDAwYlxcXHUwMDAwUzX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MDA27KZ4rq5veyjt4EJr3+uCT8/DY305MbRsfV3BXHUwMDFjfcpcdTAwMWTa7fVjzK5uhZtccnszfTX8v3zYUbX74TfsXHUwMDBl+/LdwnRNYlx1MDAxZiCZzOf1IZiRQo+vZtJcdTAwMWbzslx1MDAxNu9BpatcdTAwMTlcdTAwMGWcXHUwMDE1XHUwMDA3rEJcdTAwMTjfXHUwMDFicY5qhkarmSHFe3ROk1Y/YvvQN+Vme1x1MDAxYlx1MDAwMVx0tvNGKfZcdTAwMDaI/1xi6rkqvXhcdTAwMWbFn/Scq/cj7OeQ6n00RfneQvJcdTAwMGVHXHUwMDE2pfKZj/EzrNnzfFttnn2l/f1wd0OYnZvPoV1uR1x1MDAxNYVcbsjvU+1cdTAwMTe/KG1s31xuQ41s+i1pY3zLrFx1MDAxZVx1MDAwZeaM+1x1MDAwMVx0XHUwMDAyo3zlnuLNe+OJKl+0l4o/woe6XHUwMDAzjqpB1Fx1MDAxNlx1MDAxMN5FUPXbi0X6mG82j1wiXHUwMDFlkk9/gy7Pulp8kdruMFx1MDAxZu+r4cPqsEC18/FcItBcdTAwMTFcdTAwMDBcdTAwMGay0M/5r79/+/s/t9XlXHUwMDAwIn0= + + + + events.Key(key="e")events.Key(key="x")events.Key(key="t")Tevents.Key(key="x")events.Key(key="t")Teevents.Key(key="t")TexText \ No newline at end of file diff --git a/testbed/Textualize__textual/docs/images/input/coords.excalidraw.svg b/testbed/Textualize__textual/docs/images/input/coords.excalidraw.svg new file mode 100644 index 0000000000000000000000000000000000000000..fb925e22c347de6d5a9ab51232618ea38edd6875 --- /dev/null +++ b/testbed/Textualize__textual/docs/images/input/coords.excalidraw.svg @@ -0,0 +1,16 @@ + + + eyJ2ZXJzaW9uIjoiMSIsImVuY29kaW5nIjoiYnN0cmluZyIsImNvbXByZXNzZWQiOnRydWUsImVuY29kZWQiOiJ4nO1ba0/bSFx1MDAxNP3eX1x1MDAxMaVfdqUynfej0mpcdTAwMDVcdTAwMDGaQHktXHUwMD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yQ9Lr17tMBFq90+jmGEik9lKphcdTAwMDS3/viY2fWKN67d3Vx1MDAxOIeC9JNcXDXlZ8JcdTAwMDU7mYJcdTAwMWZcdTAwMGbvXHUwMDFl/lx1MDAwNeEmVVx1MDAxOCJ9 + + + + XyXy(0, 0)(0, 0)Widget \ No newline at end of file diff --git a/testbed/Textualize__textual/docs/images/layout/align.excalidraw.svg b/testbed/Textualize__textual/docs/images/layout/align.excalidraw.svg new file mode 100644 index 0000000000000000000000000000000000000000..fd2f8e94fb932e7a7c1ed413aaa115e6ee229b86 --- /dev/null +++ b/testbed/Textualize__textual/docs/images/layout/align.excalidraw.svg @@ -0,0 +1,16 @@ + + + eyJ2ZXJzaW9uIjoiMSIsImVuY29kaW5nIjoiYnN0cmluZyIsImNvbXByZXNzZWQiOnRydWUsImVuY29kZWQiOiJ4nN2ZW1PbOFx1MDAxNMff+Vx1MDAxNJn0tXGtozszOzuUy5altEOBXHUwMDAy2d1hXHUwMDE0W0nU+FbbIUCH776yk8FJSCBAmmY3XHUwMDBmmVhcdTAwMTfrSOd3pP9RfmzUavX8JtH1zVpdX3sqMH6qXHUwMDA29bdF+ZVOM1x1MDAxM0e2XG7K5yzup17ZspvnSbb57l2o0p7Ok0B52rkyWV9cdTAwMDVZ3vdN7Hhx+M7kOsx+L74/qVD/lsShn6dONUhD+yaP0+FYOtChjvLMvv0v+1xcq/0ov8esS7WXq6hcdTAwMTPoskNZVVx1MDAxOYhcdTAwMTibLv1cdTAwMTRHpbHAXHUwMDEwYEJcdTAwMTm9b2CyXHUwMDFkO1xcrn1b27Ym66qmKKpnW1x1MDAwM6EvTz5cdTAwMWOdnr3fa1x1MDAxZJxkUVx1MDAwMnvVqG1cdTAwMTNcdTAwMDTH+U1QWuWlcZY1uir3ulWLLE/jnj4zft4tbJsqv++bxXYhql5p3O90I51lXHUwMDEzfeJEeSa/KcpcXPe+dLhcdTAwMTCbtark2j41sHQkRoy4XGaq6Vx1MDAxNn1cdTAwMDGowySarFx1MDA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0lynNvVtV2GXHUwMDExaVx1MDAxZGj80Vx1MDAxMlUrWr8yevB+Nj1cdTAwMDVAXHUwMDFio7guQkhcdTAwMTfu+3G3cfcvaFx1MDAxZGxTIn0= + + + + align-horizontal: leftalign-horizontal: centeralign-horizontal: right \ No newline at end of file diff --git a/testbed/Textualize__textual/docs/images/layout/center.excalidraw.svg b/testbed/Textualize__textual/docs/images/layout/center.excalidraw.svg new file mode 100644 index 0000000000000000000000000000000000000000..b9e15e7a9b530fe7a0af2b24702e8e448dc3323f --- /dev/null +++ b/testbed/Textualize__textual/docs/images/layout/center.excalidraw.svg @@ -0,0 +1,16 @@ + + + eyJ2ZXJzaW9uIjoiMSIsImVuY29kaW5nIjoiYnN0cmluZyIsImNvbXByZXNzZWQiOnRydWUsImVuY29kZWQiOiJ4nNWXW2/bNlx1MDAxNMff+ylcZve1UXhcdTAwMTdcdTAwMTlgXHUwMDE4nHRZ0mxuV6fpsmFcdTAwMThcdTAwMTiJllx0U5eJtHNDvvsoObUsx1x1MDAwZbzUMDI9XGLQ4eVcdTAwMWPy/Pg/4v2bTqfrblx1MDAwYtU96HTVTSSNjkt53X1X2aeqtDrPfFx1MDAxM6q/bT4po7rnyLnCXHUwMDFl7O+nslx1MDAxYytXXHUwMDE4XHUwMDE5qWCq7URcdTAwMWHrJrHOgyhP97VTqf2xevdlqn4o8jR2ZdA42VOxdnk586WMSlXmrJ/9T//d6dzX74XoSlx1MDAxNTmZJUbVXHUwMDAz6qaFXHUwMDAwXHUwMDAxW7b286xcdTAwMGWWUoxpXGJDMO+g7XvvzqnYt1x1MDAwZX3IqmmpTN2Pn0+MMlx1MDAxZk4tXHUwMDFj9tXPXHUwMDE3VCfclo3XoTZm4G5NXHUwMDFkVVTm1u6NpItGTVx1MDAwZuvKfKy+6tiNfFx1MDAxZrhkn4+1ud+IZlSZT5JRpqxtjclcdTAwMGJcdTAwMTlpd1vZQLOE2UZcdTAwMWN0XHUwMDFhy43/wkBcdTAwMDRIIMF4SOdcct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f5dwcLZcdTAwMDbKkYxGk1K9XHUwMDAyLFx1MDAxOVx1MDAwYsBcbpXEOFxmQkp5XHUwMDFi15fXbbZcdTAwMDJL7zb45qKeiK2gk/tb0PLReOSTcsaxXHUwMDFmvlPF9GXD/83RbfHp1I1bhWbI15HJWMh8XHKHm5dvfX7X+7KX0PjXy/MzejhMU927fe1g+ppcdTAwMTCQZakkSFx1MDAwNP5g0u+WymdvOIw85XCFPFwi4C+9XHUwMDAy7PSi/d/VsUlznrmBvpvdk1vWY5lqc9vKVI2lj9TnPVFucSut8j5nXG7Z6t0zOqnA7Vx1MDAxYTVsXHUwMDEz7XQkzbzZ5Vx1MDAwYiuPvHfppytP4+VV5KVOdCbNeTuS2WHy73qPurIoXHUwMDA2zu+Q7zE7Wj5cdDp+XFxmM193qtX14Spxqp9q1vqAVmdBVSm4f3jz8C/DXFz9NyJ9 + + + + Widget \ No newline at end of file diff --git a/testbed/Textualize__textual/docs/images/layout/dock.excalidraw.svg b/testbed/Textualize__textual/docs/images/layout/dock.excalidraw.svg new file mode 100644 index 0000000000000000000000000000000000000000..fde040991aaafeb1ecddcc618f5547a7bfef6004 --- /dev/null +++ b/testbed/Textualize__textual/docs/images/layout/dock.excalidraw.svg @@ -0,0 +1,16 @@ + + + eyJ2ZXJzaW9uIjoiMSIsImVuY29kaW5nIjoiYnN0cmluZyIsImNvbXByZXNzZWQiOnRydWUsImVuY29kZWQiOiJ4nN2aWXPbNlx1MDAxMIDf8ys0ymvM4D4y0+nItpKocWwnjuOj0+nQJCTSokiWpCxLXHUwMDE5//cuaVXURVx1MDAxZrKqqtGDLWFcdGBcdHy72Fx1MDAwNfDjVa1Wz4axqb+r1c2tY1x1MDAwN76b2IP6m7z8xiSpXHUwMDFmhSBcIsXvNOonTvGkl2Vx+u7t256ddE1cdTAwMTZcdTAwMDe2Y6xcdTAwMWI/7dtBmvVdP7KcqPfWz0wv/TX/e2j3zC9x1HOzxCo72TGun0XJfV8mMD1cdTAwMTNmKbT+O/y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+/WfNcdTAwMDVcdTAwMGbMS4VcdTAwMWawXFyMXHUwMDE01lx1MDAxMHuwXHKb7uHxdYNeKXamlZdcXCeDXHUwMDBmo1x1MDAwMTtYm+lyjMRz9qteZrpcdTAwMDf2MOpnY0tJt8F25zRaMUTn1Vx1MDAxN7RcdTAwMTCh+DnXs1x1MDAxZZ7uLbVdxoVFXHUwMDE5yq/hIaXx1GWL+1x1MDAwMJ1Z+rG7g0q2+dXqRqykhbjGeqzA1MZTadJcdTAwMTBcdTAwMWFUXdeCcsGJ5qusyy9cdNVz81OrmN9TQ/VcdTAwMDdXgtlQXHUwMDFkVpj8SFxcUYihJFXlJJahOrG0QkyonzdWr+SokE4jVFx1MDAxNbK/XHUwMDFhN1634/gkg/meTFx1MDAwZiDlu2OfWb5h/cY3g91lR8vFJ3dJxSjnpm/y9/xx9+rub5B4Q/4ifQ== + + + + Docked widgetLayout widgets \ No newline at end of file diff --git a/testbed/Textualize__textual/docs/images/layout/grid.excalidraw.svg b/testbed/Textualize__textual/docs/images/layout/grid.excalidraw.svg new file mode 100644 index 0000000000000000000000000000000000000000..aed2f9d24fd2924d3c895c71face786f05b014fb --- /dev/null +++ b/testbed/Textualize__textual/docs/images/layout/grid.excalidraw.svg @@ -0,0 +1,16 @@ + + + eyJ2ZXJzaW9uIjoiMSIsImVuY29kaW5nIjoiYnN0cmluZyIsImNvbXByZXNzZWQiOnRydWUsImVuY29kZWQiOiJ4nN2ZW3PaRlx1MDAxNMff8yk85DVsds/eM9PpONimwZc40NZ2O52MkFx1MDAxNiQjkCxcdOM4k+/elUhcdTAwMTFcYpNQyrhcdTAwMDQ9aEZnb8e7P875n/XnXHUwMDE3XHUwMDA3XHUwMDA3texTbGpvXHUwMDBlaubBdcLAS5xJ7VVuvzdJXHUwMDFhRCPbXHUwMDA0xXdcdTAwMWGNXHUwMDEzt+jpZ1mcvnn9eugkXHUwMDAzk8Wh41x1MDAxYXRcdTAwMWakYydMs7FcdTAwMTdEyI2Gr4PMXGbT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rlcdTAwMTCx/1xyofm9PFx1MDAxMXR/XHUwMDAzKdPf0Ka5XHUwMDFlgLl7ju9cdTAwMDH6cVx1MDAxON++T4Pe44fw0L+Pzvw2ucG7XHUwMDBlKLNxlC39X2ZcdTAwMDboVqTpakBcdFx1MDAxM0hPr2FXStPvclxuWFx1MDAxMK2A/Vx1MDAxOJf19l1MWnPiuJPZKW3zlFrrdeB1gkezME3tPjCTt09cdP7iqb34yn7Ol8l9/vzlxZe/XHUwMDAxUO5ccsMifQ== + + + + \ No newline at end of file diff --git a/testbed/Textualize__textual/docs/images/layout/horizontal.excalidraw.svg b/testbed/Textualize__textual/docs/images/layout/horizontal.excalidraw.svg new file mode 100644 index 0000000000000000000000000000000000000000..25ce496f24475240565f5924c99e589e8723e1af --- /dev/null +++ b/testbed/Textualize__textual/docs/images/layout/horizontal.excalidraw.svg @@ -0,0 +1,16 @@ + + + eyJ2ZXJzaW9uIjoiMSIsImVuY29kaW5nIjoiYnN0cmluZyIsImNvbXByZXNzZWQiOnRydWUsImVuY29kZWQiOiJ4nO2aa0/bSFx1MDAxNIa/8ytQ+rVM536ptFpcdTAwMTEuLTQtlNAtdFVVjj1JZnFsYztcdGnFf9+xQ+PE2GxcYlHKatdCSTzX45nnXHUwMDFjvzPDj63t7UY6iXTj9XZD37iOb7zYXHUwMDE5N15m6SNcdTAwMWQnJlxmbFx1MDAxNs7vk3BcdTAwMTi7ecl+mkbJ61evXHUwMDA2Tnyl08h3XFxcckYmXHUwMDE5On6SXHUwMDBlPVx1MDAxM1x1MDAwMjdcdTAwMWO8MqlcdTAwMWUkv2efXHUwMDFmnIH+LVxuXHUwMDA3Xlx1MDAxYYOik1x1MDAxZO2ZNIynfWlfXHUwMDBmdJAmtvU/7f329o/8c866WLupXHUwMDEz9HydV8izXG5cdTAwMDNcdTAwMTFH5dRcdTAwMGZhkFx1MDAxYitcdTAwMDRnTFBOZ1x1MDAwNUyyb7tLtWdzu9ZkXeRkSY1wrHY6o1x1MDAxMbuiT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MDAwZtQ+XHUwMDFmOJff6NklvDa9sVaBOPlr8tw9imJcdTAwMDHKbvPToaDgpf3jX6TsieJ2sUfxpj0qO7T636Oyr3tcdTAwMWXlxHE4rnQpWOtSdrVoXHUwMDAzOH/EnuK3uHnK946uXHUwMDA35uDj8I1vlHmz667mUlx1MDAxYjxcdJSA4vu73FxmXCLwkCtJ0WWdp1x1MDAxY1x1MDAwMTJA+KK7XHUwMDE2+4mAK1U6XHUwMDE4v/MtaHOs4EUr7HHn1q3mW1xmMkVcdTAwMWVz6jJnh1x1MDAxM6dNXHUwMDEzeCbolavowKvJ8Z0k3Vx1MDAwYlx1MDAwN1x1MDAwM5NaM05DXHUwMDEzpOVcdTAwMTJ5u7tcdTAwMTnVfe3cc1x1MDAxMdvyfF5cdTAwMTn/KGux+K+O7Cp+bVx1MDAxN3zkN7PfX19Wlq6Yyewq5rBoYGv++3brrsmGXHUwMDEzRe3UXHUwMDBluDVo6rh2To13XHUwMDE3kYrnaoyMXHUwMDFlN6v2XHUwMDA38ytcdTAwMGJcdTAwMDC5+2d+prOn+3G7dfs38GbaXHUwMDA3In0= + + + + WidgetWidgetWidget \ No newline at end of file diff --git a/testbed/Textualize__textual/docs/images/layout/offset.excalidraw.svg b/testbed/Textualize__textual/docs/images/layout/offset.excalidraw.svg new file mode 100644 index 0000000000000000000000000000000000000000..7e56bed904c523b5d967e7c26eb9cc091f624ac0 --- /dev/null +++ b/testbed/Textualize__textual/docs/images/layout/offset.excalidraw.svg @@ -0,0 +1,16 @@ + + + eyJ2ZXJzaW9uIjoiMSIsImVuY29kaW5nIjoiYnN0cmluZyIsImNvbXByZXNzZWQiOnRydWUsImVuY29kZWQiOiJ4nN2ZWVPbSFx1MDAxMIDf+Vx1MDAxNZTzXHUwMDFhK3NcdTAwMWap2triXlxiS8JcdTAwMTVcYlspSkhjWWtZUqQx2Enx37clXHUwMDFjS744XGZhXHR6sK3p0Uxr5utr/GNpeblhXHUwMDA3qWm8X26YvudGoZ+5V423Rfuly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XHUwMDEw08J8yVx1MDAwMzCt6eFmdjWM/TBcdTAwMGVAWMWBn/8zbN8jXHIuqEq8Xrn7XHUwMDBllpD4gVx1MDAxOeNcItxcdTAwMDG8tU6Bm5ZEO1BcdTAwMTiVNfpQdD1Sx8T+3crcno3UlGlcIlx1MDAwN4FLwVx1MDAwNPJdpTVcdTAwMDRRxKbUUY7kRCvGOIJccuVCTilcdTAwMTW5uV1Lut3QwqJ/SsLYTi5uuYorhXW3jetPSuGl6rJJN5BcdTAwMTYjjofj6tdyZSflzej317cze89luLim6K1GW6p/z/Nf1vTtLPfF0S3uiyNYf0iB7u2/Lq8+dE6PV7+vN9m2/Cy7l3ZggpdcdTAwMWVhsdLgv1x1MDAwNNNMICaAqGpFSv8llFx1MDAwM9ZQxC+tMUTbx4TaW51YLauvju6nj1x1MDAwMSTkpFJcdTAwMTDyzMdcdTAwMDBcdTAwMTTXI9lcdTAwMDP8VCuJ7WH4/SZpXHUwMDFia910u2E0XHUwMDE427iSU9D0Y6uVXHUwMDFiW1/L3MCcJZdqrPdKXHUwMDE0XHUwMDA2cZnemdY44jb03GgktkntzT2Y3YXhsu0pk0+yMFxiYzc6XHUwMDFh1+RcdTAwMTFZLNdkro1xjFx1MDAwNUVS3d/G9pvHXHUwMDFl2ewrlVE//JCGe8dcdTAwMWLu2Vx1MDAxM9uYn1x1MDAxNP7yaZNcdTAwMDTmcKRnnLRRSVx1MDAxZHDv4tf+bfsk5Vx1MDAxYyZcZnKEwlx1MDAxYV5TPVfkyVx1MDAwZq/nloaDNtw0PbQw5Cjqw5qE/tDgq2FcdTAwMWGXoblanVV8lFehcmldXHUwMDA1wKZYkVx1MDAxZtdL1/9cdTAwMDE0elVbIn0= + + + + Offset \ No newline at end of file diff --git a/testbed/Textualize__textual/docs/images/layout/vertical.excalidraw.svg b/testbed/Textualize__textual/docs/images/layout/vertical.excalidraw.svg new file mode 100644 index 0000000000000000000000000000000000000000..fff71ecf95d506431ff65e65f08ae6c6a81cca38 --- /dev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c+/ev918i+JcdTAwMGVcdTAwMTFg/vScWIviXGbymVx1MDAxM6NfZFFYXHUwMDEwXHS53aP/t6i1W9TW475XU3HcNHaGbI2xfdlF8L3H1yz6q937+qG+6IQwv7JecyvN7EFnS/D129a3f1x1MDAwMLFE1Vx1MDAwMCJ9 + + + + WidgetWidgetWidget \ No newline at end of file diff --git a/testbed/Textualize__textual/docs/images/screens/pop_screen.excalidraw.svg b/testbed/Textualize__textual/docs/images/screens/pop_screen.excalidraw.svg new file mode 100644 index 0000000000000000000000000000000000000000..b87957f6a17ef4185705fce6b420fb2421a0c1f5 --- /dev/null +++ b/testbed/Textualize__textual/docs/images/screens/pop_screen.excalidraw.svg @@ -0,0 +1,16 @@ + + + eyJ2ZXJzaW9uIjoiMSIsImVuY29kaW5nIjoiYnN0cmluZyIsImNvbXByZXNzZWQiOnRydWUsImVuY29kZWQiOiJ4nN1cXOtT20hcdTAwMTL/nr+C4r7sVcWz0z3vrbq6XHUwMDAyXHUwMDEyXHUwMDEyQnhsyObB3VZK2MLW4ddaMsZs5X+/XHUwMDFlhSDJQorBxnHiXHUwMDBmXHUwMDE4a+RRa+bX3b9+yH8/2djYTKbDcPO3jc3wqlx1MDAxOXSj1iiYbD71xy/DUVx1MDAxY1xy+jSE6ed4MFx1MDAxZTXTMztJMox/+/XXXjC6XGKTYTdohuwyisdBN07GrWjAmoPer1FcdTAwMTL24n/7v4dBL/zXcNBrJSOWXaRcdTAwMTG2omQw+nKtsFx1MDAxYvbCflx1MDAxMtPs/6HPXHUwMDFiXHUwMDFif6d/c9K1oqA36LfS09OBnHhazFx1MDAxZT1cdTAwMWP0U1FBXHUwMDBiLZW28vaEKH5GXHUwMDE3S8JcdTAwMTaNnpPAYTbiXHUwMDBmbcrRNNFcdTAwMDae897Fx119cmhcdTAwMGZOxyfZVc+jbvckmXZTmeJcdTAwMDHdSjZcdTAwMTYno8FF+D5qJVx1MDAxZH/pmeNV31x1MDAxYVxyxu1OP4zjwndcdTAwMDbDoFx1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MDAwXHS0MVjOl/jSXHUwMDAxRaSr7iF5sFrOSYDqfVGRXHUwMDAwgdCeXHUwMDA3Ulx1MDAxNFxuXHUwMDE2yeHlclx1MDAwNF9cdTAwMTmQZNJvJaBcdTAwMTJcdTAwMWOMeegziPW59qJUXFxcbmPJISljtNEu94NcdTAwMWa3YllmNHFcdTAwMDPaWue4MkKWpPqRSFAlnP2rXHUwMDA05CUxIFGdqCFhUEtcdTAwMGbXue3ZyfXlKzWNj6ZHL+LB5OPWZft479O6MyCK1ohcdTAwMDGh4MSCjK9ZXHUwMDE0XHUwMDEzNUJcdTAwMThGXHUwMDExgnRElFxibvlfUPlOmVx1MDAxYSBcdTAwMWHmIFx1MDAxN1x1MDAxNfzotUPHXHUwMDA1t8LlbmiFmZo15Cm4OE8xrlqvwVx1MDAxN1xyrTXzN6/Ub/2a8lx1MDAxNFxuKsH/mFx1MDAwZjk3w41cdTAwMTC5eCFtXHUwMDEwXHUwMDAwzdAnckxcdTAwMWHai8VcdTAwMWXdrNVr7dtotPDP9/tcdTAwMDdcdTAwMDfhXHUwMDBlLdeGOeu7XHUwMDE2NddWlVx1MDAxYdP8U2zKoV3l7yQspJVz0pR6h7FRKOs4RS9OXHUwMDFiXHUwMDA1WphcXGfyRpZcdTAwMTORXGLCao1cdTAwMWH8XHUwMDEzYuWfJJiLpNT3wszIRFxcSCvyyEJq8lx1MDAxZqIkXHUwMDEzkmfx7Wv+4XY0d7X0/0hcdTAwMTSlXHUwMDEyyOlgXHUwMDExwlVcdTAwMDTlyc3s/jGhk4TwdrtcdTAwMTVcdTAwMDTpqHVjyrNb3LyMwsn2XT056cvbx3QxvVx1MDAxNVxu/Y3+/fnJ5/9cdTAwMDPV4pXXIn0= + + + + Screen 1(hidden)app.pop_screen()Screen 2(hidden)Screen 3(visible)Screen 2(visible) \ No newline at end of file diff --git a/testbed/Textualize__textual/docs/images/screens/push_screen.excalidraw.svg b/testbed/Textualize__textual/docs/images/screens/push_screen.excalidraw.svg new file mode 100644 index 0000000000000000000000000000000000000000..7bfde1748c7d6ce4e12de1cb96f9479fbd4f7429 --- /dev/null +++ b/testbed/Textualize__textual/docs/images/screens/push_screen.excalidraw.svg @@ -0,0 +1,16 @@ + + + eyJ2ZXJzaW9uIjoiMSIsImVuY29kaW5nIjoiYnN0cmluZyIsImNvbXByZXNzZWQiOnRydWUsImVuY29kZWQiOiJ4nOVcXG1z2khcdTAwMTL+nl/h8n3Zq1xu2nnr6Zmturpcbk5cdTAwMWN7XHUwMDEzx/Fb/HK35ZJBgNaAMFx1MDAxMrbxVv779chcdTAwMGVcdTAwMTIvXCJgMEtyVGyMRkitmaeffrpnJn+92tjYTPqdYPO3jc3gvuI3w2rXv9t87Y7fXHUwMDA23TiM2tQk0s9x1OtW0jNcdTAwMWJJ0ol/+/XXlt+9XHUwMDBlkk7Tr1x1MDAwNN5tXHUwMDE49/xmnPSqYeRVotavYVx1MDAxMrTif7vfn/xW8K9O1KomXS+7SSmohknUfbxX0FxmWkE7ienq/6HPXHUwMDFiXHUwMDFif6W/c9ZVQ79cdTAwMTW1q+npaUPOPLSjRz9F7dRUY5hgWqFcdTAwMWGcXHUwMDEwxm/pZklQpdZcdTAwMWFcdTAwMTlcdTAwMWNkLe7QJjQv9MPZWalafuj/WTqqmebJXHUwMDE3nt21XHUwMDE2NptHSb+Z2lx1MDAxNEf0KFlbnHSj6+A0rCZccmrlI8eLvtWNevVGO4jjoe9EXHUwMDFkv1x1MDAxMiZ9d4yxwVG/XU+vkVx1MDAxZLmnT4prjzFccmgtN1x1MDAwMCx7WPd9oYzHuFVWgFx1MDAxMlpxgSOGbUVNXHUwMDFhXHUwMDA2MuxcdTAwMWYsfWWmXfmV6zrZ165m53Dw/aua1tlZd09cdTAwMGasLHjKKIkwaGpcdTAwMDRhvZE4I4z2XGZyZvOtcZCOXHUwMDAyV1ZbhsCzXHUwMDE2d9PObjWFw1x1MDAxZqP92PC7naf+2ozdh5zBztZ3o1jK4yk30sFu9fz86Fg97Fx1MDAxZ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wMDD8rFx1MDAwMqNcdTAwMThT7lVcdTAwMWGH05xcdTAwMTKjkFM0K+RcdTAwMTTQbjGylLNrjOkxY105XHUwMDA1085329qY0E5VjXCKJVx1MDAwNWKYNcYoXHUwMDE0L7Qm2yjPpYaoLaOsg7p9nFLIXHUwMDBlt1KNJCjRXHUwMDFiSW4xXoejhEpxQlHWef9/nFwiaFx1MDAxOK2rXHUwMDE4XHUwMDE56lx1MDAwYs3HOUW6rXCIlIQq1EaQfpzOKUVWTZ9cdTAwMDJcdTAwMWOxijFlJLOKI1GZlVx1MDAxM5jOc5UwTckxxVx1MDAwNUvZxI+9Qa9cdTAwMTDP7lVcdTAwMWGHclx1MDAxMZ29erqDW/x6lFx1MDAxMO5cdTAwMDZcdTAwMDNC0Fx1MDAwZatPSjB7zM3bMLgrT5qRSV9OeKVcdTAwMWTquChwXHUwMDBm+9fXV1//XHUwMDA3mNhRliJ9 + + + + Screen 1(hidden)Screen 2 (visible)app.push_screen(screen3)Screen 3 (visible)hidden \ No newline at end of file diff --git a/testbed/Textualize__textual/docs/images/screens/switch_screen.excalidraw.svg b/testbed/Textualize__textual/docs/images/screens/switch_screen.excalidraw.svg new file mode 100644 index 0000000000000000000000000000000000000000..beddc0d3b3f8847391dfcffd0c9732eeb007aff5 --- /dev/null +++ b/testbed/Textualize__textual/docs/images/screens/switch_screen.excalidraw.svg @@ -0,0 +1,16 @@ + + + eyJ2ZXJzaW9uIjoiMSIsImVuY29kaW5nIjoiYnN0cmluZyIsImNvbXByZXNzZWQiOnRydWUsImVuY29kZWQiOiJ4nN1cXG1T20hcdTAwMTL+nl9BcV/2qsLsTPe8btXVXHUwMDE1XHUwMDAxNlx1MDAwMVx1MDAxMpNccuH17opcdTAwMTK2bGsxsrFlXGZs5b9fjyCWLL9gg3DIKlXY1sjj1szTTz/dM8pfb1ZWVpPbTrj628pqeFNcclpRrVx1MDAxYlxmVt/689dht1x1MDAxN7VjaoL0c6/d71bTK5tJ0un99uuvl0H3XCJMOq2g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nSDuNdcdLrkXHUwMDEwXHUwMDEztEkuxc20ybi058I/s/xcIlx1MDAwYuGztMmL7vuS4DRmkm9pT391w8v2dV7m/nBlktn0NF2SX+YperT0iSwp7Pk9evakL+TRS9zXXCItU9zHdK7AXHUwMDA3hsLzXHUwMDEyfl+LzzMoeZbGuGetos/0aFx1MDAwMaSB/Fx1MDAxNlNOXHUwMDFhSXOZ+48gsno1MFx1MDAwNc5vMjHoXHUwMDFmRCu6u0/wpXJmmdXq5/jjnOpkdqgoKFx1MDAwMUupo6LwbqSQOlx1MDAxYqJMnnCGXHUwMDE0XHUwMDE40Vx1MDAxMI+npamnqZPZu5hHXHUwMDE0XHUwMDEzd1xuaL6Ms1r6xYRxmyhqkDiRaK2jTFx1MDAwMIT6uZ/9mlx1MDAwZWV/rFx1MDAxNVE8TZ68efhcdTAwMDG/eWg/IcxccqeDYFx1MDAxZNVcdTAwMWWIPLvL1esoXHUwMDFjvJu0nzo9PEem4+mZKPT3+te3N9/+XHUwMDBmJe3LnyJ9 + + + + Screen 1(hidden)Screen 2 (visible)app.switch_screen(screen3)Screen 3 (visible)Screen 2 removed \ No newline at end of file diff --git a/testbed/Textualize__textual/docs/images/stopwatch.excalidraw.svg b/testbed/Textualize__textual/docs/images/stopwatch.excalidraw.svg new file mode 100644 index 0000000000000000000000000000000000000000..365a10ff516066457d9155d1f8611c686b2e1721 --- /dev/null +++ b/testbed/Textualize__textual/docs/images/stopwatch.excalidraw.svg @@ -0,0 +1,16 @@ + + + eyJ2ZXJzaW9uIjoiMSIsImVuY29kaW5nIjoiYnN0cmluZyIsImNvbXByZXNzZWQiOnRydWUsImVuY29kZWQiOiJ4nNVcXGlP40pcdTAwMTb93r9cdTAwMDIxX2akxq/2paXRqFx1MDAwM4R9XHUwMDBiW8PMXHUwMDEzMrFDXGbxguNA4Kn/+5SddOwktuM4S/tFLVx1MDAxYVxcjuu66tx77lJVf33Z2NhcZj48c/PbxqbZb+pcdTAwMWTL8PX3za/h9TfT71quo5pQ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DAxMFxczINe/7GGM3gj71jDL0Pl3dQ97zJQ4zZyStTUWMbw5eOx2nyzzPda9kl8X4a6XHUwMDFiKolcdTAwMTlOzF8/v/z8P1xiXCJcdTAwMWT6In0= + + + + StopReset00:00:07.21Start00:00:00.00HeaderFooterStart00:00:00.00StopwatchStopwatch(started)Reset \ No newline at end of file diff --git a/testbed/Textualize__textual/docs/images/stopwatch_widgets.excalidraw.svg b/testbed/Textualize__textual/docs/images/stopwatch_widgets.excalidraw.svg new file mode 100644 index 0000000000000000000000000000000000000000..5dca9fb959890c402a0a9f9a405ba894dd498c4a --- /dev/null +++ b/testbed/Textualize__textual/docs/images/stopwatch_widgets.excalidraw.svg @@ -0,0 +1,16 @@ + + + eyJ2ZXJzaW9uIjoiMSIsImVuY29kaW5nIjoiYnN0cmluZyIsImNvbXByZXNzZWQiOnRydWUsImVuY29kZWQiOiJ4nO1cXGlT40hcdTAwMTL93r/Cwe7Hdk3dR0dsbIChgaG5mqO7d2diQkjCViNbakvm8MT8901cdLBuY4xNm4lVXHUwMDEwgFVSVaoyX+XLrJT/fNdqrcV3obv2obXm3tqW7zlD62btfXL+2lx1MDAxZEZeMIAmmn6OgtHQTq/sxXFcdTAwMTh9+OWXvjW8cuPQt2xcdTAwMTdde9HI8qN45HhcdTAwMDGyg/4vXuz2o38nv1x1MDAwZqy++68w6DvxXHUwMDEwZYO0XceLg+H9WK7v9t1BXHUwMDFjQe//hc+t1p/p75x0Q9eOrUHXd9NcdTAwMWLSpkxAqWn57EEwSIVl2lAmqSaTXHUwMDBivGhcdTAwMTOGi11cdTAwMDdaL0FkN2tJTq2dnp9f9e6+XHUwMDFkn3S6t39cdTAwMDTc3/A+n5Fs1EvP90/iOz+VKlxu4GGytihcdTAwMWVcdTAwMDZX7lx1MDAxN8+Je9BKSueb7lx1MDAxYVx1MDAwNqNub+BGUeGeILRsL75LXHUwMDFlXHUwMDAxT07ez8CHVnbmNtGPYVxia2Y0Z0pMWpJbKedI6tzJe0k6gVx1MD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411hcdTAwMDPfMIIkO9qGq6yXezai0XJLt2lcdTAwMTLLY82ESjhPUvJQRb1cdTAwMDRcdTAwMTEhklx1MDAxMFx1MDAxOEiRVEbWZD8hxKRGiVfOiCQwXUQ1TVx1MDAxM1xymO41ioxcdTAwMDRzoaRkQlx1MDAwYkY1XHUwMDE1mVwiJzyAYFx1MDAwNLOcaHM+UjL9S22K0lx1MDAwMLflSmtsYIJcdTAwMTRhplwiXGb4a5pcdTAwMDSIoDdGMVx1MDAxM287XHUwMDE50m4247S5YsFcdTAwMGJcIimUNpdcdTAwMDKSpEZUMzX7XHUwMDAy5l9dbv+wP5newa72+1x1MDAxZsVmcOZcZld9XHUwMDAx41x1MDAxYdh4qfIgXbpcdTAwMThFklx1MDAxMrzUqniiamr/qiRFY2U0qP+VX1r7XHUwMDE2fVxyZW/zx+2FP+j9uNnvXHUwMDBl+782fInJXHUwMDFjXHUwMDFjXHUwMDA1rF3OlVx1MDAwZZ6Lo2SaadmJan5cdTAwMWJ4UeufoTVw/baTfIfYoE1Wg6nMJOl8fIU0v2ZcdTAwMDZol8IwIWZPfk43j1x1MDAxNYW7kFx1MDAwMtWAnXK03C+CkM1lgkai0pfBTF5WNVx1MDAxMDlcdTAwMDGFfGVaMjcyZ6Ql0/1EiZZcYsW0Tt7M4lx1MDAwMmtMeO6yx0xcdLjGNGk9nZa82cLiiukkR3tiNU1U4N1Dh2tWXHUwMDE4nsSg4olGwIo852FcdTAwMDXNnmrt2nNvNmpeub5Mj2TJSWc2XHUwMDAxtps8259/vfvrf4F0XHUwMDFiRyJ9 + + + + Start00:00:00.00Reset5 lineshorizontal layout1 cell margin1 cell paddingaround buttonsbackground coloris $panel-darken-1 \ No newline at end of file diff --git a/testbed/Textualize__textual/docs/images/styles/border_box.excalidraw.svg b/testbed/Textualize__textual/docs/images/styles/border_box.excalidraw.svg new file mode 100644 index 0000000000000000000000000000000000000000..1d488e24adeb825f6b790d0bbd4f7d427154bcc2 --- /dev/null +++ b/testbed/Textualize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YII5ljUsXHUwMDAzlk/VtjsoamaL88+b4vy8W7zMQoe/fb9xctN1dzB4XHUwMDFm4y3HhIjv2m8/pD7pbda/+N7tZsmGyVx1MDAxN8lhTU5egsWHZ9/0399++/Z/3Vx1MDAxNVx1MDAwZVx1MDAwMiJ9 + + + + MarginPaddingContent areaBorderHeightWidth \ No newline at end of file diff --git a/testbed/Textualize__textual/docs/images/styles/box.excalidraw.svg b/testbed/Textualize__textual/docs/images/styles/box.excalidraw.svg new file mode 100644 index 0000000000000000000000000000000000000000..56ffe17585a9be2d5d765bba0776f12113d94da5 --- /dev/null +++ b/testbed/Textualize__textual/docs/images/styles/box.excalidraw.svg @@ -0,0 +1,16 @@ + + + eyJ2ZXJzaW9uIjoiMSIsImVuY29kaW5nIjoiYnN0cmluZyIsImNvbXByZXNzZWQiOnRydWUsImVuY29kZWQiOiJ4nO1cXGtT2txcdTAwMTb+3l/h+H4tu/t+6cyZM9VqrbfWevfMO51cYlx1MDAwMaJAaFx1MDAxMlx1MDAxNHyn//2sXHUwMDFklCSERFCw6Dn50EpcdTAwMTKSxd7redaz1r78825lZTVcdTAwMWF03dWPK6tuv+q0vFrg3K6+t+dv3CD0/Fx1MDAwZVxcovHn0O9cdTAwMDXV+M5mXHUwMDE0dcOPXHUwMDFmPrSd4NqNui2n6qJcdTAwMWIv7DmtMOrVPFx1MDAxZlX99lx1MDAwNy9y2+G/7b/7Ttv9V9dv16JcdTAwMDAlL6m4NS/yg+G73JbbdjtRXGJP/1x1MDAwZnxeWfkn/jdlXeBWI6fTaLnxXHUwMDE34kuJgZzT8bP7fic2llBFleCck9FcdTAwMWRe+Fx1MDAxOd5cdTAwMTe5NbhcXFx1MDAwN5vd5Io9tTo46Tt6Y//TbvubXHUwMDFmnISHXHUwMDFkv16tJa+te63WYTRoXHKbwqk2e0HKqDBcbvxr99SrRU379rHzo+/V/MhcdTAwMWEwulx1MDAxY/i9RrPjhmHmS37XqXrRwJ7DeHR22FxmXHUwMDFmV5Izfdtcd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TAwMThnXHUwMDBlf1ZlXHUwMDAyXHUwMDEzO81cdTAwMTAzXGJcdTAwMGbAw8JM2nfEqlwiXHUwMDAxYcFcdTAwMTZBIUayXFxcbmOkgUeItzdZsUiClO8tMFx1MDAxMlx1MDAxN1x1MDAxMlx1MDAxOWm1uuTSjk7zlJhP0lx1MDAxZrtcdTAwMDCUXHUwMDAw30L+w6lcdTAwMDHflzlcdTAwMDXymnRGpcSn4ut5d5pRaFx1MDAxNOcwqmRcdTAwMDcjIZmgRE5PLOWb3CwtsVDEscF2koFcdTAwMTFybPKkXHUwMDA0satBXGZcdTAwMTOFXHUwMDAxPCUrKZ/PK5rH0/ol1liI9JKqpDKikVx1MDAwNPlHIKM1oI7YhFx1MDAwNVlgpmBY0SdswbBcZrxSuD6idG+sLDdASlwiuYYkRoNOJGpCZUTYtTKScFx1MDAwNUhcdTAwMTOg3lx1MDAxZiqNby2BqVx1MDAxNDuVPfLuNCOtlG7rYkjhts5cdTAwMTRDjMaE0umzmIprjs+jy7NQRc2Ts1x1MDAwZebru79cdTAwMGVcbqhlubZ10Vx1MDAxONJlu1kpt9BMVyaG27pcdTAwMThky3eGXHRNKFBNMcM8f1tcdTAwMTeCXHUwMDE4J0VcdTAwMGIrqKCIMUj9qWRcdTAwMDVcdTAwMTO1IeBcdTAwMWFcdTAwMGXukrTEsq/jLs1yXHUwMDE2ur+LgoQwtfXmtPu7vLt/6KrT7Vx1MDAxZUbwyFx1MDAxMSlCW3u1++wneczqjeferk3Y1bhcdTAwMWVcdTAwMWbW5LhcdTAwMTEsQlxc29L//H73+7/nXHUwMDBiXHUwMDAzXCIifQ== + + + + MarginPaddingContent areaBorderHeightWidth \ No newline at end of file diff --git a/testbed/Textualize__textual/docs/images/styles/content_box.excalidraw.svg b/testbed/Textualize__textual/docs/images/styles/content_box.excalidraw.svg new file mode 100644 index 0000000000000000000000000000000000000000..ac94e2e6d8c6ecb93ca1df14d9c89750ff21a318 --- /dev/null +++ b/testbed/Textualize__textual/docs/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qa3jlX279I5lHrut0nQIGgTshcdTAwMGWluP15rZvFgi5nJYUuli4v3/+Fe6SUXGZcdTAwMTZtXHUwMDAwIzxcdTAwMDBhXHUwMDE41aFgpjZcdTAwMTlcdTAwMTEhkU8yU/vfnWCet1x1MDAxM8yb+5su+p3OYUS3fCRFauuwdlx1MDAxZv8kt1m8XG6DwfKInZrP4sNVOW5cdTAwMDSHkMC19D8/3/z8P1KdJ/cifQ== + + + + MarginPaddingContent areaBorderHeightWidth \ No newline at end of file diff --git a/testbed/Textualize__textual/docs/index.md b/testbed/Textualize__textual/docs/index.md new file mode 100644 index 0000000000000000000000000000000000000000..66e83adb7ef8b717cddb148a124469ed65eb91a2 --- /dev/null +++ b/testbed/Textualize__textual/docs/index.md @@ -0,0 +1,83 @@ + +# Introduction + +Welcome to the [Textual](https://github.com/Textualize/textual) framework documentation. Built with ❤️ by [Textualize.io](https://www.textualize.io) + +
+ +Textual is a framework for building applications that run within your terminal. Text User Interfaces (TUIs) have a number of advantages over web and desktop apps. + +
+ +- :material-clock-fast:{ .lg .middle } :material-language-python:{. lg .middle } __Rapid development__ + + --- + + Uses your existing Python skills to build beautiful user interfaces. + + +- :material-raspberry-pi:{ .lg .middle } __Low requirements__ + + --- + + Low system requirements. Run Textual on a single board computer if you want to. + + + +- :material-microsoft-windows:{ .lg .middle } :material-apple:{ .lg .middle } :fontawesome-brands-linux:{ .lg .middle } __Cross platform__ + + --- + + Textual runs just about everywhere. + + + +- :material-network:{ .lg .middle } __Remote__ + + --- + + Textual apps can run over SSH. + + +- :fontawesome-solid-terminal:{ .lg .middle } __CLI Integration__ + + --- + + Textual apps can be launched and run from the command prompt. + + + +- :material-scale-balance:{ .lg .middle } __Open Source, MIT__ + + --- + + Textual is licensed under MIT. + + +
+ + +
+ + +```{.textual path="examples/calculator.py" columns=100 lines=41 press="3,.,1,4,5,9,2,_,_,_,_,_,_,_,_"} +``` + +```{.textual path="examples/pride.py"} +``` + +```{.textual path="docs/examples/tutorial/stopwatch.py" columns="100" lines="30" press="d,tab,enter,_,_"} +``` + + +```{.textual path="docs/examples/events/dictionary.py" columns="100" lines="30" press="tab,_,t,e,x,t,_,_,_,_,_,_,_,_,_,_,_,_,_"} +``` + + +```{.textual path="docs/examples/guide/layout/combining_layouts.py" columns="100", lines="30"} +``` + +```{.textual path="docs/examples/app/widgets01.py"} +``` + + diff --git a/testbed/Textualize__textual/docs/reference/app.md b/testbed/Textualize__textual/docs/reference/app.md new file mode 100644 index 0000000000000000000000000000000000000000..3a797ce06f1deb8b301a147087736fa48bebdbae --- /dev/null +++ b/testbed/Textualize__textual/docs/reference/app.md @@ -0,0 +1 @@ +::: textual.app diff --git a/testbed/Textualize__textual/docs/reference/binding.md b/testbed/Textualize__textual/docs/reference/binding.md new file mode 100644 index 0000000000000000000000000000000000000000..55aa039ab2ee276bdf195dcef771193a228f470b --- /dev/null +++ b/testbed/Textualize__textual/docs/reference/binding.md @@ -0,0 +1 @@ +::: textual.binding.Binding diff --git a/testbed/Textualize__textual/docs/reference/button.md b/testbed/Textualize__textual/docs/reference/button.md new file mode 100644 index 0000000000000000000000000000000000000000..26d6b63cfe1fd04f720626e17fb51ed2f33b8a69 --- /dev/null +++ b/testbed/Textualize__textual/docs/reference/button.md @@ -0,0 +1 @@ +::: textual.widgets.Button diff --git a/testbed/Textualize__textual/docs/reference/color.md b/testbed/Textualize__textual/docs/reference/color.md new file mode 100644 index 0000000000000000000000000000000000000000..0d1d717596bb46a2b445c83b15c49f25ace5e071 --- /dev/null +++ b/testbed/Textualize__textual/docs/reference/color.md @@ -0,0 +1 @@ +::: textual.color diff --git a/testbed/Textualize__textual/docs/reference/containers.md b/testbed/Textualize__textual/docs/reference/containers.md new file mode 100644 index 0000000000000000000000000000000000000000..f65b508681851b7169af30d88a03972466d06500 --- /dev/null +++ b/testbed/Textualize__textual/docs/reference/containers.md @@ -0,0 +1 @@ +::: textual.containers diff --git a/testbed/Textualize__textual/docs/reference/data_table.md b/testbed/Textualize__textual/docs/reference/data_table.md new file mode 100644 index 0000000000000000000000000000000000000000..c8ac87cde5bda0607d973c62f35ecc7cb6c63180 --- /dev/null +++ b/testbed/Textualize__textual/docs/reference/data_table.md @@ -0,0 +1 @@ +::: textual.widgets.DataTable diff --git a/testbed/Textualize__textual/docs/reference/dom_node.md b/testbed/Textualize__textual/docs/reference/dom_node.md new file mode 100644 index 0000000000000000000000000000000000000000..90e75c8d98364060e24a38b255dd6b9e5884c866 --- /dev/null +++ b/testbed/Textualize__textual/docs/reference/dom_node.md @@ -0,0 +1 @@ +::: textual.dom.DOMNode diff --git a/testbed/Textualize__textual/docs/reference/events.md b/testbed/Textualize__textual/docs/reference/events.md new file mode 100644 index 0000000000000000000000000000000000000000..0be7c28687a807386a3539971d4bc8813186727c --- /dev/null +++ b/testbed/Textualize__textual/docs/reference/events.md @@ -0,0 +1 @@ +::: textual.events diff --git a/testbed/Textualize__textual/docs/reference/footer.md b/testbed/Textualize__textual/docs/reference/footer.md new file mode 100644 index 0000000000000000000000000000000000000000..604c2ef6a68423ab413e02ec7a7ab2c24a375c26 --- /dev/null +++ b/testbed/Textualize__textual/docs/reference/footer.md @@ -0,0 +1 @@ +::: textual.widgets.Footer diff --git a/testbed/Textualize__textual/docs/reference/geometry.md b/testbed/Textualize__textual/docs/reference/geometry.md new file mode 100644 index 0000000000000000000000000000000000000000..6f31de5e4da1d85a96feceb608d873235ab492d9 --- /dev/null +++ b/testbed/Textualize__textual/docs/reference/geometry.md @@ -0,0 +1 @@ +::: textual.geometry diff --git a/testbed/Textualize__textual/docs/reference/header.md b/testbed/Textualize__textual/docs/reference/header.md new file mode 100644 index 0000000000000000000000000000000000000000..e6cfc0e4417e13e4bc750be828826341f529c210 --- /dev/null +++ b/testbed/Textualize__textual/docs/reference/header.md @@ -0,0 +1 @@ +::: textual.widgets.Header diff --git a/testbed/Textualize__textual/docs/reference/index.md b/testbed/Textualize__textual/docs/reference/index.md new file mode 100644 index 0000000000000000000000000000000000000000..8e129acd16e29f5056f66799ccb4e2d7476d178c --- /dev/null +++ b/testbed/Textualize__textual/docs/reference/index.md @@ -0,0 +1,3 @@ +# Reference + +A reference to the Textual public APIs. diff --git a/testbed/Textualize__textual/docs/reference/input.md b/testbed/Textualize__textual/docs/reference/input.md new file mode 100644 index 0000000000000000000000000000000000000000..259ea86f9f3cc1374eb276a43e42e1a8e4cbd4c7 --- /dev/null +++ b/testbed/Textualize__textual/docs/reference/input.md @@ -0,0 +1 @@ +::: textual.widgets.Input diff --git a/testbed/Textualize__textual/docs/reference/message.md b/testbed/Textualize__textual/docs/reference/message.md new file mode 100644 index 0000000000000000000000000000000000000000..fcb6f76c31634a7dc2fb0c5bda9d437e8eba17b0 --- /dev/null +++ b/testbed/Textualize__textual/docs/reference/message.md @@ -0,0 +1 @@ +::: textual.message.Message diff --git a/testbed/Textualize__textual/docs/reference/message_pump.md b/testbed/Textualize__textual/docs/reference/message_pump.md new file mode 100644 index 0000000000000000000000000000000000000000..79b0dc45877f8bae841444e1c79589291bd1a5e9 --- /dev/null +++ b/testbed/Textualize__textual/docs/reference/message_pump.md @@ -0,0 +1,5 @@ +A message pump is a class that processes messages. + +It is a base class for the `App`, `Screen`, and `Widget` classes. + +::: textual.message_pump.MessagePump diff --git a/testbed/Textualize__textual/docs/reference/query.md b/testbed/Textualize__textual/docs/reference/query.md new file mode 100644 index 0000000000000000000000000000000000000000..313755809d636c36ac77e7ac791110ebe275a60a --- /dev/null +++ b/testbed/Textualize__textual/docs/reference/query.md @@ -0,0 +1 @@ +::: textual.css.query diff --git a/testbed/Textualize__textual/docs/reference/reactive.md b/testbed/Textualize__textual/docs/reference/reactive.md new file mode 100644 index 0000000000000000000000000000000000000000..759c7af264b37fc9ddd8cde533993fef7c2202d7 --- /dev/null +++ b/testbed/Textualize__textual/docs/reference/reactive.md @@ -0,0 +1 @@ +::: textual.reactive diff --git a/testbed/Textualize__textual/docs/reference/screen.md b/testbed/Textualize__textual/docs/reference/screen.md new file mode 100644 index 0000000000000000000000000000000000000000..c7054aef5d484424c83af1d33e59643e92bbdd1a --- /dev/null +++ b/testbed/Textualize__textual/docs/reference/screen.md @@ -0,0 +1 @@ +::: textual.screen diff --git a/testbed/Textualize__textual/docs/reference/static.md b/testbed/Textualize__textual/docs/reference/static.md new file mode 100644 index 0000000000000000000000000000000000000000..709b442ef673bc1d15c1910690f5d85782d0ff07 --- /dev/null +++ b/testbed/Textualize__textual/docs/reference/static.md @@ -0,0 +1 @@ +::: textual.widgets.Static diff --git a/testbed/Textualize__textual/docs/reference/timer.md b/testbed/Textualize__textual/docs/reference/timer.md new file mode 100644 index 0000000000000000000000000000000000000000..01b5fa1acbee26a09a6b909ad265fc6ad175a58f --- /dev/null +++ b/testbed/Textualize__textual/docs/reference/timer.md @@ -0,0 +1 @@ +::: textual.timer diff --git a/testbed/Textualize__textual/docs/reference/widget.md b/testbed/Textualize__textual/docs/reference/widget.md new file mode 100644 index 0000000000000000000000000000000000000000..aa67df889452e97bf0125dc9c7ade82593891a89 --- /dev/null +++ b/testbed/Textualize__textual/docs/reference/widget.md @@ -0,0 +1 @@ +::: textual.widget.Widget diff --git a/testbed/Textualize__textual/docs/styles/align.md b/testbed/Textualize__textual/docs/styles/align.md new file mode 100644 index 0000000000000000000000000000000000000000..15bbcbed9eb6ea809f659fb51deeb6328b37b04c --- /dev/null +++ b/testbed/Textualize__textual/docs/styles/align.md @@ -0,0 +1,68 @@ +# Align + +The `align` style aligns children within a container. + +## Syntax + +``` +align: ; +align-horizontal: ; +align-vertical: ; +``` + + +### Values + +#### `HORIZONTAL` + +| Value | Description | +| ---------------- | -------------------------------------------------- | +| `left` (default) | Align content on the left of the horizontal axis | +| `center` | Align content in the center of the horizontal axis | +| `right` | Align content on the right of the horizontal axis | + +#### `VERTICAL` + +| Value | Description | +| --------------- | ------------------------------------------------ | +| `top` (default) | Align content at the top of the vertical axis | +| `middle` | Align content in the middle of the vertical axis | +| `bottom` | Align content at the bottom of the vertical axis | + + +## Example + +=== "align.py" + + ```python + --8<-- "docs/examples/styles/align.py" + ``` + +=== "align.css" + + ```scss hl_lines="2" + --8<-- "docs/examples/styles/align.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/styles/align.py"} + + ``` + +## CSS + +```sass +/* Align child widgets to the center. */ +align: center middle; +/* Align child widget to th top right */ +align: right top; +``` + +## Python +```python +# Align child widgets to the center +widget.styles.align = ("center", "middle") +# Align child widgets to the top right +widget.styles.align = ("right", "top") +``` diff --git a/testbed/Textualize__textual/docs/styles/background.md b/testbed/Textualize__textual/docs/styles/background.md new file mode 100644 index 0000000000000000000000000000000000000000..1cf5283c771607a95502aade1e0e7fe05263e152 --- /dev/null +++ b/testbed/Textualize__textual/docs/styles/background.md @@ -0,0 +1,57 @@ +# Background + +The `background` rule sets the background color of the widget. + +## Syntax + +``` +background: []; +``` + +## Example + +This example creates three widgets and applies a different background to each. + +=== "background.py" + + ```python + --8<-- "docs/examples/styles/background.py" + ``` + +=== "background.css" + + ```sass + --8<-- "docs/examples/styles/background.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/styles/background.py"} + ``` + +## CSS + +```sass +/* Blue background */ +background: blue; + +/* 20% red backround */ +background: red 20%; + +/* RGB color */ +background: rgb(100,120,200); +``` + +## Python + +You can use the same syntax as CSS, or explicitly set a `Color` object for finer-grained control. + +```python +# Set blue background +widget.styles.background = "blue" + +from textual.color import Color +# Set with a color object +widget.styles.background = Color.parse("pink") +widget.styles.background = Color(120, 60, 100) +``` diff --git a/testbed/Textualize__textual/docs/styles/border.md b/testbed/Textualize__textual/docs/styles/border.md new file mode 100644 index 0000000000000000000000000000000000000000..757ce988bb6f6dc094793e597ac4041c7060c946 --- /dev/null +++ b/testbed/Textualize__textual/docs/styles/border.md @@ -0,0 +1,86 @@ +# Border + +The `border` rule enables the drawing of a box around a widget. A border is set with a border value (see below) followed by a color. + +Borders may also be set individually for the four edges of a widget with the `border-top`, `border-right`, `border-bottom` and `border-left` rules. + +## Syntax + +``` +border: [] []; +border-top: [] []; +border-right: [] []; +border-bottom: [] []; +border-left: [] []; +``` + +### Values + +| Border value | Description | +|--------------|---------------------------------------------------------| +| `"ascii"` | A border with plus, hyphen, and vertical bar | +| `"blank"` | A blank border (reserves space for a border) | +| `"dashed"` | Dashed line border | +| `"double"` | Double lined border | +| `"heavy"` | Heavy border | +| `"hidden"` | Alias for "none" | +| `"hkey"` | Horizontal key-line border | +| `"inner"` | Thick solid border | +| `"none"` | Disabled border | +| `"outer"` | Think solid border with additional space around content | +| `"round"` | Rounded corners | +| `"solid"` | Solid border | +| `"tall"` | Solid border with extras space top and bottom | +| `"vkey"` | Vertical key-line border | +| `"wide"` | Solid border with additional space left and right | + +For example, `heavy white` would display a heavy white line around a widget. + +## Border command + +The `textual` CLI has a subcommand which will let you explore the various border types: + +``` +textual borders +``` + +## Example + +This examples shows three widgets with different border styles. + +=== "border.py" + + ```python + --8<-- "docs/examples/styles/border.py" + ``` + +=== "border.css" + + ```css + --8<-- "docs/examples/styles/border.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/styles/border.py"} + ``` + +## CSS + +```sass +/* Set a heavy white border */ +border: heavy white; + +/* set a red border on the left */ +border-left: outer red; +``` + +## Python + +```python +# Set a heavy white border +widget.border = ("heavy", "white") + +# Set a red border on the left +widget.border_left = ("outer", "red") +``` diff --git a/testbed/Textualize__textual/docs/styles/box_sizing.md b/testbed/Textualize__textual/docs/styles/box_sizing.md new file mode 100644 index 0000000000000000000000000000000000000000..bc089ad443fb62b320f66426f72ed5c52a0762a8 --- /dev/null +++ b/testbed/Textualize__textual/docs/styles/box_sizing.md @@ -0,0 +1,59 @@ +# Box-sizing + +The `box-sizing` property determines how the width and height of a widget are calculated. + +## Syntax + +``` +box-sizing: [border-box|content-box]; +``` + +### Values + +| Values | Description | +|------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `border-box` (default) | Padding and border are included in the width and height. If you add padding and/or border the widget will not change in size, but you will have less space for content. | +| `content-box` | Padding and border will increase the size of the widget, leaving the content area unaffected. | + +## Example + +Both widgets in this example have the same height (5). +The top widget has `box-sizing: border-box` which means that padding and border reduces the space for content. +The bottom widget has `box-sizing: content-box` which increases the size of the widget to compensate for padding and border. + +=== "box_sizing.py" + + ```python + --8<-- "docs/examples/styles/box_sizing.py" + ``` + +=== "box_sizing.css" + + ```css + --8<-- "docs/examples/styles/box_sizing.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/styles/box_sizing.py"} + ``` + +## CSS + +```sass +/* Set box sizing to border-box (default) */ +box-sizing: border-box; + +/* Set box sizing to content-box */ +box-sizing: content-box; +``` + +## Python + +```python +# Set box sizing to border-box (default) +widget.box_sizing = "border-box" + +# Set box sizing to content-box +widget.box_sizing = "content-box" +``` diff --git a/testbed/Textualize__textual/docs/styles/color.md b/testbed/Textualize__textual/docs/styles/color.md new file mode 100644 index 0000000000000000000000000000000000000000..0fae0a0b0fae4c687c1abe7c258aeaf421f1ca51 --- /dev/null +++ b/testbed/Textualize__textual/docs/styles/color.md @@ -0,0 +1,60 @@ +# Color + +The `color` rule sets the text color of a Widget. + +## Syntax + +``` +color: | auto []; +``` + +## Example + +This example sets a different text color to three different widgets. + +=== "color.py" + + ```python + --8<-- "docs/examples/styles/color.py" + ``` + +=== "color.css" + + ```css + --8<-- "docs/examples/styles/color.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/styles/color.py"} + ``` + +## CSS + +```sass +/* Blue text */ +color: blue; + +/* 20% red text */ +color: red 20%; + +/* RGB color */ +color: rgb(100,120,200); + +/* Automatically choose color with suitable contrast for readability */ +color: auto; +``` + +## Python + +You can use the same syntax as CSS, or explicitly set a `Color` object. + +```python +# Set blue text +widget.styles.color = "blue" + +from textual.color import Color +# Set with a color object +widget.styles.color = Color.parse("pink") + +``` diff --git a/testbed/Textualize__textual/docs/styles/content_align.md b/testbed/Textualize__textual/docs/styles/content_align.md new file mode 100644 index 0000000000000000000000000000000000000000..35a4a4c57ca5a8b0c05129a818a20a8814e72f60 --- /dev/null +++ b/testbed/Textualize__textual/docs/styles/content_align.md @@ -0,0 +1,65 @@ +# Content-align + +The `content-align` style aligns content _inside_ a widget. + +You can specify the alignment of content on both the horizontal and vertical axes. + +## Syntax + +``` +content-align: ; +``` + +### Values + +#### `HORIZONTAL` + +| Value | Description | +| ---------------- | -------------------------------------------------- | +| `left` (default) | Align content on the left of the horizontal axis | +| `center` | Align content in the center of the horizontal axis | +| `right` | Align content on the right of the horizontal axis | + +#### `VERTICAL` + +| Value | Description | +| --------------- | ------------------------------------------------ | +| `top` (default) | Align content at the top of the vertical axis | +| `middle` | Align content in the middle of the vertical axis | +| `bottom` | Align content at the bottom of the vertical axis | + +## Example + +=== "content_align.py" + + ```python + --8<-- "docs/examples/styles/content_align.py" + ``` + +=== "content_align.css" + + ```scss + --8<-- "docs/examples/styles/content_align.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/styles/content_align.py"} + ``` + +## CSS + +```sass +/* Align content in the very center of a widget */ +content-align: center middle; +/* Align content at the top right of a widget */ +content-align: right top; +``` + +## Python +```python +# Align content in the very center of a widget +widget.styles.content_align = ("center", "middle") +# Align content at the top right of a widget +widget.styles.content_align = ("right", "top") +``` diff --git a/testbed/Textualize__textual/docs/styles/display.md b/testbed/Textualize__textual/docs/styles/display.md new file mode 100644 index 0000000000000000000000000000000000000000..9628389396738e768a0fc035db6104fc9514caec --- /dev/null +++ b/testbed/Textualize__textual/docs/styles/display.md @@ -0,0 +1,67 @@ +# Display + +The `display` property defines whether a widget is displayed or not. + +## Syntax + +``` +display: [none|block]; +``` + +### Values + +| Value | Description | +|-------------------|---------------------------------------------------------------------------| +| `block` (default) | Display the widget as normal | +| `none` | The widget not be displayed, and space will no longer be reserved for it. | + +## Example + +Note that the second widget is hidden by adding the "hidden" class which sets the display style to None. + +=== "display.py" + + ```python + --8<-- "docs/examples/styles/display.py" + ``` + +=== "display.css" + + ```css + --8<-- "docs/examples/styles/display.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/styles/display.py"} + ``` + +## CSS + +```sass +/* Widget is on screen */ +display: block; + +/* Widget is not on the screen */ +display: none; +``` + +## Python + +```python +# Hide the widget +self.styles.display = "none" + +# Show the widget again +self.styles.display = "block" +``` + +There is also a shortcut to show / hide a widget. The `display` property on `Widget` may be set to `True` or `False` to show or hide the widget. + +```python +# Hide the widget +widget.display = False + +# Show the widget +widget.display = True +``` diff --git a/testbed/Textualize__textual/docs/styles/dock.md b/testbed/Textualize__textual/docs/styles/dock.md new file mode 100644 index 0000000000000000000000000000000000000000..8753586142c36f1e99872462ef36fc3dbca00d83 --- /dev/null +++ b/testbed/Textualize__textual/docs/styles/dock.md @@ -0,0 +1,45 @@ +# Dock + +The `dock` property is used to fix a widget to the edge of a container (which may be the entire terminal window). + +## Syntax + +``` +dock: top|right|bottom|left; +``` + +## Example + +The example below shows a `left` docked sidebar. +Notice that even though the content is scrolled, the sidebar remains fixed. + +=== "Output" + + ```{.textual path="docs/examples/guide/layout/dock_layout1_sidebar.py" press="pagedown,down,down,_,_,_,_,_"} + ``` + +=== "dock_layout1_sidebar.py" + + ```python + --8<-- "docs/examples/guide/layout/dock_layout1_sidebar.py" + ``` + +=== "dock_layout1_sidebar.css" + + ```sass hl_lines="2" + --8<-- "docs/examples/guide/layout/dock_layout1_sidebar.css" + ``` + +## CSS + +```sass +/* Dock the widget on the left edge of its parent container */ +dock: left; +``` + +## Python + +```python +# Dock the widget on the left edge of its parent container +widget.styles.dock = "left" +``` diff --git a/testbed/Textualize__textual/docs/styles/grid.md b/testbed/Textualize__textual/docs/styles/grid.md new file mode 100644 index 0000000000000000000000000000000000000000..9f7bbc1fdb9f12f25a142b0706b686d534b59104 --- /dev/null +++ b/testbed/Textualize__textual/docs/styles/grid.md @@ -0,0 +1,54 @@ +# Grid + +There are a number of properties relating to the Textual `grid` layout. + +For an in-depth look at the grid layout, visit the grid [guide](../guide/layout.md#grid). + +| Property | Description | +|----------------|------------------------------------------------| +| `grid-size` | Number of columns and rows in the grid layout. | +| `grid-rows` | Height of grid rows. | +| `grid-columns` | Width of grid columns. | +| `grid-gutter` | Spacing between grid cells. | +| `row-span` | Number of rows a cell spans. | +| `column-span` | Number of columns a cell spans. | + +## Syntax + +```sass +grid-size: []; +/* columns first, then rows */ +grid-rows: . . .; +grid-columns: . . .; +grid-gutter: ; +row-span: ; +column-span: ; +``` + +## Example + +The example below shows all the properties above in action. +The `grid-size: 3 4;` declaration sets the grid to 3 columns and 4 rows. +The first cell of the grid, tinted magenta, shows a cell spanning multiple rows and columns. +The spacing between grid cells is because of the `grid-gutter` declaration. + +=== "Output" + + ```{.textual path="docs/examples/styles/grid.py"} + ``` + +=== "grid.py" + + ```python + --8<-- "docs/examples/styles/grid.py" + ``` + +=== "grid.css" + + ```sass + --8<-- "docs/examples/styles/grid.css" + ``` + +!!! warning + + The properties listed on this page will only work when the layout is `grid`. diff --git a/testbed/Textualize__textual/docs/styles/height.md b/testbed/Textualize__textual/docs/styles/height.md new file mode 100644 index 0000000000000000000000000000000000000000..5898068150deda1f873375440c4c29eb5504d0c5 --- /dev/null +++ b/testbed/Textualize__textual/docs/styles/height.md @@ -0,0 +1,51 @@ +# Height + +The `height` rule sets a widget's height. By default, it sets the height of the content area, but if `box-sizing` is set to `border-box` it sets the height of the border area. + +## Syntax + +``` +height: ; +``` + +## Example + +This examples creates a widget with a height of 50% of the screen. + +=== "height.py" + + ```python + --8<-- "docs/examples/styles/height.py" + ``` + +=== "height.css" + + ```python + --8<-- "docs/examples/styles/height.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/styles/height.py"} + ``` + +## CSS + +```sass +/* Explicit cell height */ +height: 10; + +/* Percentage height */ +height: 50%; + +/* Automatic height */ +width: auto +``` + +## Python + +```python +self.styles.height = 10 +self.styles.height = "50% +self.styles.height = "auto" +``` diff --git a/testbed/Textualize__textual/docs/styles/index.md b/testbed/Textualize__textual/docs/styles/index.md new file mode 100644 index 0000000000000000000000000000000000000000..67b6f6c85088085d241b871612865dc8c0befada --- /dev/null +++ b/testbed/Textualize__textual/docs/styles/index.md @@ -0,0 +1,3 @@ +# Styles + +A reference to Widget [styles](../guide/styles.md). diff --git a/testbed/Textualize__textual/docs/styles/layer.md b/testbed/Textualize__textual/docs/styles/layer.md new file mode 100644 index 0000000000000000000000000000000000000000..383e745b265a64cc0f08ba2926c9c903c6c8404b --- /dev/null +++ b/testbed/Textualize__textual/docs/styles/layer.md @@ -0,0 +1,50 @@ +# Layer + +The `layer` property is used to assign widgets to a layer. +The value of the `layer` property must be the name of a layer defined using a `layers` declaration. +Layers control the order in which widgets are painted on screen. +More information on layers can be found in the [guide](../guide/layout.md#layers). + +## Syntax + +``` +layer: ; +``` + +## Example + +In the example below, `#box1` is yielded before `#box2`. +However, since `#box1` is on the higher layer, it is drawn on top of `#box2`. + +[//]: # (NOTE: the example below also appears in the guide and 'layers.md'.) + +=== "Output" + + ```{.textual path="docs/examples/guide/layout/layers.py"} + ``` + +=== "layers.py" + + ```python + --8<-- "docs/examples/guide/layout/layers.py" + ``` + +=== "layers.css" + + ```sass hl_lines="3 15 19" + --8<-- "docs/examples/guide/layout/layers.css" + ``` + +## CSS + +```sass +/* Draw the widget on the layer called 'below' */ +layer: below; +``` + +## Python + +```python +# Draw the widget on the layer called 'below' +widget.layer = "below" +``` diff --git a/testbed/Textualize__textual/docs/styles/layers.md b/testbed/Textualize__textual/docs/styles/layers.md new file mode 100644 index 0000000000000000000000000000000000000000..9eed3156ddb5ef4531442fde7ea81cb837ff37dc --- /dev/null +++ b/testbed/Textualize__textual/docs/styles/layers.md @@ -0,0 +1,50 @@ +# Layers + +The `layers` property allows you to define an ordered set of layers. +These `layers` can later be referenced using the `layer` property. +Layers control the order in which widgets are painted on screen. +More information on layers can be found in the [guide](../guide/layout.md#layers). + +## Syntax + +``` +layers: ...; +``` + +## Example + +In the example below, `#box1` is yielded before `#box2`. +However, since `#box1` is on the higher layer, it is drawn on top of `#box2`. + +[//]: # (NOTE: the example below also appears in the guide and 'layer.md'.) + +=== "Output" + + ```{.textual path="docs/examples/guide/layout/layers.py"} + ``` + +=== "layers.py" + + ```python + --8<-- "docs/examples/guide/layout/layers.py" + ``` + +=== "layers.css" + + ```sass hl_lines="3 15 19" + --8<-- "docs/examples/guide/layout/layers.css" + ``` + +## CSS + +```sass +/* Bottom layer is called 'below', layer above it is called 'above' */ +layers: below above; +``` + +## Python + +```python +# Bottom layer is called 'below', layer above it is called 'above' +widget.layers = ("below", "above") +``` diff --git a/testbed/Textualize__textual/docs/styles/layout.md b/testbed/Textualize__textual/docs/styles/layout.md new file mode 100644 index 0000000000000000000000000000000000000000..332209219029ede9a2faf246a341d1168e234c4f --- /dev/null +++ b/testbed/Textualize__textual/docs/styles/layout.md @@ -0,0 +1,52 @@ +# Layout + +The `layout` property defines how a widget arranges its children. + +See [layout](../guide/layout.md) guide for more information. + +## Syntax + +``` +layout: [center|grid|horizontal|vertical]; +``` + +### Values + +| Value | Description | +| -------------------- | ----------------------------------------------------------------------------- | +| `grid` | Child widgets will be arranged in a grid. | +| `horizontal` | Child widgets will be arranged along the horizontal axis, from left to right. | +| `vertical` (default) | Child widgets will be arranged along the vertical axis, from top to bottom. | + +## Example + +Note how the `layout` property affects the arrangement of widgets in the example below. + +=== "layout.py" + + ```python + --8<-- "docs/examples/styles/layout.py" + ``` + +=== "layout.css" + + ```sass + --8<-- "docs/examples/styles/layout.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/styles/layout.py"} + ``` + +## CSS + +```sass +layout: horizontal; +``` + +## Python + +```python +widget.layout = "horizontal" +``` diff --git a/testbed/Textualize__textual/docs/styles/margin.md b/testbed/Textualize__textual/docs/styles/margin.md new file mode 100644 index 0000000000000000000000000000000000000000..21cab8c619a969077e059398f52f643c8107dd0d --- /dev/null +++ b/testbed/Textualize__textual/docs/styles/margin.md @@ -0,0 +1,54 @@ +# Margin + +The `margin` rule adds space around the entire widget. Margin may be specified with 1, 2 or 4 values. + +| Example | Description | +|--------------------|---------------------------------------------------------------------| +| `margin: 1;` | A single value sets a margin of 1 around all 4 edges | +| `margin: 1 2;` | Two values sets the margin for the top/bottom and left/right edges | +| `margin: 1 2 3 4;` | Four values sets top, right, bottom, and left margins independently | + +Margin may also be set individually by setting `margin-top`, `margin-right`, `margin-bottom`, or `margin-left` to a single value. + +## Syntax + +``` +margin: ; +margin: ; +margin: ; +``` + +## Example + +In this example we add a large margin to some static text. + +=== "margin.py" + + ```python + --8<-- "docs/examples/styles/margin.py" + ``` + +=== "margin.css" + + ```css + --8<-- "docs/examples/styles/margin.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/styles/margin.py"} + ``` + +## CSS + +```sass +/* Set margin of 2 on the top and bottom edges, and 4 on the left and right */ +margin: 2 4; +``` + +## Python + +```python +# In Python you can set the margin as a tuple of integers +widget.styles.margin = (2, 3) +``` diff --git a/testbed/Textualize__textual/docs/styles/max_height.md b/testbed/Textualize__textual/docs/styles/max_height.md new file mode 100644 index 0000000000000000000000000000000000000000..e80d996fecf18addb61cf73919a386009655b297 --- /dev/null +++ b/testbed/Textualize__textual/docs/styles/max_height.md @@ -0,0 +1,31 @@ +# Max-height + +The `max-height` rule sets a maximum height for a widget. + +## Syntax + +``` +max-height: ; +``` + +## CSS + +```sass + +/* Set a maximum height of 10 rows */ +max-height: 10; + +/* Set a maximum height of 25% of the screen height */ +max-height: 25vh; +``` + +## Python + +```python +# Set the maximum height to 10 rows +widget.styles.max_height = 10 + +# Set the maximum height to 25% of the screen height +widget.styles.max_height = "25vh" + +``` diff --git a/testbed/Textualize__textual/docs/styles/max_width.md b/testbed/Textualize__textual/docs/styles/max_width.md new file mode 100644 index 0000000000000000000000000000000000000000..c6ce4ef6795bf04fc92609dcf13e24a7cd5734a5 --- /dev/null +++ b/testbed/Textualize__textual/docs/styles/max_width.md @@ -0,0 +1,30 @@ +# Max-width + +The `max-width` rule sets a maximum width for a widget. + +## Syntax + +``` +max-width: ; +``` + +## CSS + +```sass + +/* Set a maximum width of 10 cells */ +max-width: 10; + +/* Set a maximum width of 25% of the screen width */ +max-width: 25vw; +``` + +## Python + +```python +# Set the maximum width to 10 cells +widget.styles.max_width = 10 + +# Set the maximum width to 25% of the screen width +widget.styles.max_width = "25vw" +``` diff --git a/testbed/Textualize__textual/docs/styles/min_height.md b/testbed/Textualize__textual/docs/styles/min_height.md new file mode 100644 index 0000000000000000000000000000000000000000..b110e190ebcd3e0e3971c4e7655ae4b154d58cc6 --- /dev/null +++ b/testbed/Textualize__textual/docs/styles/min_height.md @@ -0,0 +1,31 @@ +# Min-height + +The `min-height` rule sets a minimum height for a widget. + +## Syntax + +``` +min-height: ; +``` + +## CSS + +```sass + +/* Set a minimum height of 10 rows */ +min-height: 10; + +/* Set a minimum height of 25% of the screen height */ +min-height: 25vh; +``` + +## Python + +```python +# Set the minimum height to 10 rows +self.styles.min_height = 10 + +# Set the minimum height to 25% of the screen height +self.styles.min_height = "25vh" + +``` diff --git a/testbed/Textualize__textual/docs/styles/min_width.md b/testbed/Textualize__textual/docs/styles/min_width.md new file mode 100644 index 0000000000000000000000000000000000000000..81331469ac186a94cfda09a54a9b438e10614321 --- /dev/null +++ b/testbed/Textualize__textual/docs/styles/min_width.md @@ -0,0 +1,30 @@ +# Min-width + +The `min-width` rules sets a minimum width for a widget. + +## Syntax + +``` +min-width: ; +``` + +## CSS + +```sass + +/* Set a minimum width of 10 cells */ +min-width: 10; + +/* Set a minimum width of 25% of the screen width */ +min-width: 25vw; +``` + +## Python + +```python +# Set the minimum width to 10 cells +widget.styles.min_width = 10 + +# Set the minimum width to 25% of the screen width +widget.styles.min_width = "25vw" +``` diff --git a/testbed/Textualize__textual/docs/styles/offset.md b/testbed/Textualize__textual/docs/styles/offset.md new file mode 100644 index 0000000000000000000000000000000000000000..059a1edbe7e21183951bdc04fe7de95bb5e6182f --- /dev/null +++ b/testbed/Textualize__textual/docs/styles/offset.md @@ -0,0 +1,46 @@ +# Offset + +The `offset` rule adds an offset to the widget's position. The offset is given as two values. + +Coordinates may be specified individually with `offset-x` and `offset-y`. + +## Syntax + +``` +offset: ; +``` + +## Example + +In this example, we have 3 widgets with differing offsets. + +=== "offset.py" + + ```python + --8<-- "docs/examples/styles/offset.py" + ``` + +=== "offset.css" + + ```css + --8<-- "docs/examples/styles/offset.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/styles/offset.py"} + ``` + +## CSS + +```sass +/* Move the widget 2 cells in the x direction, and 4 in the y direction. */ +offset: 2 4; +``` + +## Python + +```python +# Move the widget 2 cells in the x direction, and 4 in the y direction. +widget.styles.offset = (2, 4) +``` diff --git a/testbed/Textualize__textual/docs/styles/opacity.md b/testbed/Textualize__textual/docs/styles/opacity.md new file mode 100644 index 0000000000000000000000000000000000000000..1ccff5458ddb547dc57ccd9490d14a28ceeb8554 --- /dev/null +++ b/testbed/Textualize__textual/docs/styles/opacity.md @@ -0,0 +1,54 @@ +# Opacity + +The `opacity` property can be used to make a widget partially or fully transparent. + + +## Syntax + +``` +opacity: ; +``` + +### Values + +As a fractional property, `opacity` can be set to either a float (between 0 and 1), +or a percentage, e.g. `45%`. +Float values will be clamped between 0 and 1. +Percentage values will be clamped between 0% and 100%. + +## Example + +This example shows, from top to bottom, increasing opacity values. + +=== "opacity.py" + + ```python + --8<-- "docs/examples/styles/opacity.py" + ``` + +=== "opacity.css" + + ```scss + --8<-- "docs/examples/styles/opacity.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/styles/opacity.py"} + ``` + +## CSS + +```sass +/* Fade the widget to 50% against its parent's background */ +Widget { + opacity: 50%; +} +``` + +## Python + +```python +# Fade the widget to 50% against its parent's background +widget.styles.opacity = "50%" +``` diff --git a/testbed/Textualize__textual/docs/styles/outline.md b/testbed/Textualize__textual/docs/styles/outline.md new file mode 100644 index 0000000000000000000000000000000000000000..2267fedb77ca6424ed287726d93e0e036cf37a99 --- /dev/null +++ b/testbed/Textualize__textual/docs/styles/outline.md @@ -0,0 +1,83 @@ +# Outline + +The `outline` rule enables the drawing of a box around a widget. Similar to `border`, but unlike border, outline will +draw _over_ the content area. This rule can be useful for emphasis if you want to display an outline for a brief time to +draw the user's attention to it. + +An outline is set with a border value (see table below) followed by a color. + +Outlines may also be set individually with the `outline-top`, `outline-right`, `outline-bottom` and `outline-left` +rules. + +## Syntax + +``` +outline: [] []; +outline-top: [] []; +outline-right: [] []; +outline-bottom: [] []; +outline-left: [] []; +``` + +### Values + +| Border value | Description | +|--------------|---------------------------------------------------------| +| `"ascii"` | A border with plus, hyphen, and vertical bar | +| `"blank"` | A blank border (reserves space for a border) | +| `"dashed"` | Dashed line border | +| `"double"` | Double lined border | +| `"heavy"` | Heavy border | +| `"hidden"` | Alias for "none" | +| `"hkey"` | Horizontal key-line border | +| `"inner"` | Thick solid border | +| `"none"` | Disabled border | +| `"outer"` | Think solid border with additional space around content | +| `"round"` | Rounded corners | +| `"solid"` | Solid border | +| `"tall"` | Solid border with extras space top and bottom | +| `"vkey"` | Vertical key-line border | +| `"wide"` | Solid border with additional space left and right | + +For example, `heavy white` would display a heavy white line around a widget. + +## Example + +This examples shows a widget with an outline. Note how the outline occludes the text area. + +=== "outline.py" + + ```python + --8<-- "docs/examples/styles/outline.py" + ``` + +=== "outline.css" + + ```css + --8<-- "docs/examples/styles/outline.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/styles/outline.py"} + ``` + +## CSS + +```sass +/* Set a heavy white outline */ +outline:heavy white; + +/* set a red outline on the left */ +outline-left:outer red; +``` + +## Python + +```python +# Set a heavy white outline +widget.outline = ("heavy", "white) + + # Set a red outline on the left + widget.outline_left = ("outer", "red) +``` diff --git a/testbed/Textualize__textual/docs/styles/overflow.md b/testbed/Textualize__textual/docs/styles/overflow.md new file mode 100644 index 0000000000000000000000000000000000000000..f850281a1f47d0e3456a5cc4dd9b4c0c491e0f35 --- /dev/null +++ b/testbed/Textualize__textual/docs/styles/overflow.md @@ -0,0 +1,72 @@ +# Overflow + +The `overflow` rule specifies if and when scrollbars should be displayed on the `x` and `y` axis. +The rule takes two overflow values; one for the horizontal bar (x-axis), followed by the vertical bar (y-axis). + +The default value for overflow is `"auto auto"` which will show scrollbars automatically for both scrollbars if content doesn't fit within container. + +Overflow may also be set independently by setting the `overflow-x` rule for the horizontal bar, and `overflow-y` for the vertical bar. + +## Syntax + +``` +overflow: [auto|hidden|scroll]; +overflow-x: [auto|hidden|scroll]; +overflow-y: [auto|hidden|scroll]; +``` + +### Values + +| Value | Description | +|------------------|---------------------------------------------------------| +| `auto` (default) | Automatically show the scrollbar if content doesn't fit | +| `hidden` | Never show the scrollbar | +| `scroll` | Always show the scrollbar | + +## Example + +Here we split the screen in to left and right sections, each with three vertically scrolling widgets that do not fit in to the height of the terminal. + +The left side has `overflow-y: auto` (the default) and will automatically show a scrollbar. +The right side has `overflow-y: hidden` which will prevent a scrollbar from being shown. + +=== "overflow.py" + + ```python + --8<-- "docs/examples/styles/overflow.py" + ``` + +=== "overflow.css" + + ```css + --8<-- "docs/examples/styles/overflow.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/styles/overflow.py"} + ``` + +## CSS + +```sass +/* Automatic scrollbars on both axies (the default) */ +overflow: auto auto; + +/* Hide the vertical scrollbar */ +overflow-y: hidden; + +/* Always show the horizontal scrollbar */ +overflow-x: scroll; +``` + +## Python + +```python +# Hide the vertical scrollbar +widget.styles.overflow_y = "hidden" + +# Always show the horizontal scrollbar +widget.styles.overflow_x = "scroll" + +``` diff --git a/testbed/Textualize__textual/docs/styles/padding.md b/testbed/Textualize__textual/docs/styles/padding.md new file mode 100644 index 0000000000000000000000000000000000000000..6336a3d5f1d00d95a8ec4ff33e86e96d516693dc --- /dev/null +++ b/testbed/Textualize__textual/docs/styles/padding.md @@ -0,0 +1,54 @@ +# Padding + +The padding rule adds space around the content of a widget. You can specify padding with 1, 2 or 4 numbers. + +| example | | +| ------------------- | ------------------------------------------------------------------- | +| `padding: 1;` | A single value sets a padding of 1 around all 4 edges | +| `padding: 1 2;` | Two values sets the padding for the top/bottom and left/right edges | +| `padding: 1 2 3 4;` | Four values sets top, right, bottom, and left padding independently | + +Padding may also be set individually by setting `padding-top`, `padding-right`, `padding-bottom`, or `padding-left` to a single value. + +## Syntax + +``` +padding: ; +padding: ; +padding: ; +``` + +## Example + +This example adds padding around static text. + +=== "padding.py" + + ```python + --8<-- "docs/examples/styles/padding.py" + ``` + +=== "padding.css" + + ```css + --8<-- "docs/examples/styles/padding.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/styles/padding.py"} + ``` + +## CSS + +```sass +/* Set padding of 2 on the top and bottom edges, and 4 on the left and right */ +padding: 2 4; +``` + +## Python + +```python +# In Python you can set the padding as a tuple of integers +widget.styles.padding = (2, 3) +``` diff --git a/testbed/Textualize__textual/docs/styles/scrollbar.md b/testbed/Textualize__textual/docs/styles/scrollbar.md new file mode 100644 index 0000000000000000000000000000000000000000..3a4ec1f336882b8b6c538c221035e359bef5da65 --- /dev/null +++ b/testbed/Textualize__textual/docs/styles/scrollbar.md @@ -0,0 +1,63 @@ +# Scrollbar colors + +There are a number of rules to set the colors used in Textual scrollbars. +You won't typically need to do this, as the default themes have carefully chosen colors, but you can if you want to. + +| Rule | Color | +|-------------------------------|---------------------------------------------------------| +| `scrollbar-color` | Scrollbar "thumb" (movable part) | +| `scrollbar-color-hover` | Scrollbar thumb when the mouse is hovering over it | +| `scrollbar-color-active` | Scrollbar thumb when it is active (being dragged) | +| `scrollbar-background` | Scrollbar background | +| `scrollbar-background-hover` | Scrollbar background when the mouse is hovering over it | +| `scrollbar-background-active` | Scrollbar background when the thumb is being dragged | +| `scrollbar-corner-color` | The gap between the horizontal and vertical scrollbars | + +## Syntax + +``` +scrollbar-color: ; +scrollbar-color-hover: ; +scrollbar-color-active: ; +scrollbar-background: ; +scrollbar-background-hover: ; +scrollbar-background-active: ; +scrollbar-corner-color: ; +``` + +## Example + +In this example we have two panels with different scrollbar colors set for each. + +=== "scrollbars.py" + + ```python + --8<-- "docs/examples/styles/scrollbars.py" + ``` + +=== "scrollbars.css" + + ```css + --8<-- "docs/examples/styles/scrollbars.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/styles/scrollbars.py"} + ``` + +## CSS + +```sass +/* Set widget scrollbar color to yellow */ +Widget { + scrollbar-color: yellow; +} +``` + +## Python + +```python +# Set the scrollbar color to yellow +widget.styles.scrollbar_color = "yellow" +``` diff --git a/testbed/Textualize__textual/docs/styles/scrollbar_gutter.md b/testbed/Textualize__textual/docs/styles/scrollbar_gutter.md new file mode 100644 index 0000000000000000000000000000000000000000..7c2ed5e443e0c1b3e4f2f962b0da94dfa11cd681 --- /dev/null +++ b/testbed/Textualize__textual/docs/styles/scrollbar_gutter.md @@ -0,0 +1,53 @@ +# Scrollbar-gutter + +The `scrollbar-gutter` rule allows authors to reserve space for the vertical scrollbar. + +Setting the value to `stable` prevents unwanted layout changes when the scrollbar becomes visible. + +## Syntax + +``` +scrollbar-gutter: [auto|stable]; +``` + +### Values + +| Value | Description | +|------------------|--------------------------------------------------| +| `auto` (default) | No space is reserved for the vertical scrollbar. | +| `stable` | Space is reserved for the vertical scrollbar. | + +## Example + +In the example below, notice the gap reserved for the scrollbar on the right side of the +terminal window. + +=== "scrollbar_gutter.py" + + ```python + --8<-- "docs/examples/styles/scrollbar_gutter.py" + ``` + +=== "scrollbar_gutter.css" + + ```scss + --8<-- "docs/examples/styles/scrollbar_gutter.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/styles/scrollbar_gutter.py"} + ``` + +## CSS + +```sass +/* Reserve space for vertical scrollbar */ +scrollbar-gutter: stable; +``` + +## Python + +```python +self.styles.scrollbar_gutter = "stable" +``` diff --git a/testbed/Textualize__textual/docs/styles/scrollbar_size.md b/testbed/Textualize__textual/docs/styles/scrollbar_size.md new file mode 100644 index 0000000000000000000000000000000000000000..a6bfbcce8962a9f7f2e6b598a3703424243295bb --- /dev/null +++ b/testbed/Textualize__textual/docs/styles/scrollbar_size.md @@ -0,0 +1,49 @@ +# Scrollbar-size + +The `scrollbar-size` rule changes the size of the scrollbars. It takes 2 integers for horizontal and vertical scrollbar size respectively. + +The scrollbar dimensions may also be set individually with `scrollbar-size-horizontal` and `scrollbar-size-vertical`. + +## Syntax + +``` +scrollbar-size: ; +``` + +## Example + +In this example we modify the size of the widgets scrollbar to be _much_ larger than usual. + +=== "scrollbar_size.py" + + ```python + --8<-- "docs/examples/styles/scrollbar_size.py" + ``` + +=== "scrollbar_size.css" + + ```css + --8<-- "docs/examples/styles/scrollbar_size.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/styles/scrollbar_size.py"} + ``` + +## CSS + +```sass +/* Set horizontal scrollbar to 10, and vertical scrollbar to 4 */ +Widget { + scrollbar-size: 10 4; +} +``` + +## Python + +```python +# Set horizontal scrollbar to 10, and vertical scrollbar to 4 +widget.styles.horizontal_scrollbar = 10 +widget.styles.vertical_scrollbar = 10 +``` diff --git a/testbed/Textualize__textual/docs/styles/text_align.md b/testbed/Textualize__textual/docs/styles/text_align.md new file mode 100644 index 0000000000000000000000000000000000000000..1fc9b515c857547ccae9b8ebefff97385d43b60d --- /dev/null +++ b/testbed/Textualize__textual/docs/styles/text_align.md @@ -0,0 +1,57 @@ +# Text-align + +The `text-align` rule aligns text within a widget. + +## Syntax + +``` +text-align: [left|start|center|right|end|justify]; +``` + +### Values + +| Value | Description | +|-----------|----------------------------------| +| `left` | Left aligns text in the widget | +| `start` | Left aligns text in the widget | +| `center` | Center aligns text in the widget | +| `right` | Right aligns text in the widget | +| `end` | Right aligns text in the widget | +| `justify` | Justifies text in the widget | + +## Example + +This example shows, from top to bottom: `left`, `center`, `right`, and `justify` text alignments. + +=== "text_align.py" + + ```python + --8<-- "docs/examples/styles/text_align.py" + ``` + +=== "text_align.css" + + ```css + --8<-- "docs/examples/styles/text_align.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/styles/text_align.py"} + ``` + +## CSS + +```sass +/* Set text in all Widgets to be right aligned */ +Widget { + text-align: right; +} +``` + +## Python + +```python +# Set text in the widget to be right aligned +widget.styles.text_align = "right" +``` diff --git a/testbed/Textualize__textual/docs/styles/text_opacity.md b/testbed/Textualize__textual/docs/styles/text_opacity.md new file mode 100644 index 0000000000000000000000000000000000000000..5a0e1c6c5b10c4a598938097fd93e67a43c11fc3 --- /dev/null +++ b/testbed/Textualize__textual/docs/styles/text_opacity.md @@ -0,0 +1,53 @@ +# Text-opacity + +The `text-opacity` blends the color of the content of a widget with the color of the background. + +## Syntax + +``` +text-opacity: ; +``` + +### Values + +As a fractional property, `text-opacity` can be set to either a float (between 0 and 1), +or a percentage, e.g. `45%`. +Float values will be clamped between 0 and 1. +Percentage values will be clamped between 0% and 100%. + +## Example + +This example shows, from top to bottom, increasing text-opacity values. + +=== "text_opacity.py" + + ```python + --8<-- "docs/examples/styles/text_opacity.py" + ``` + +=== "text_opacity.css" + + ```css + --8<-- "docs/examples/styles/text_opacity.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/styles/text_opacity.py"} + ``` + +## CSS + +```sass +/* Set the text to be "half-faded" against the background of the widget */ +Widget { + text-opacity: 50%; +} +``` + +## Python + +```python +# Set the text to be "half-faded" against the background of the widget +widget.styles.text_opacity = "50%" +``` diff --git a/testbed/Textualize__textual/docs/styles/text_style.md b/testbed/Textualize__textual/docs/styles/text_style.md new file mode 100644 index 0000000000000000000000000000000000000000..b54a1f2aad7696d486690617ee838f37c9d22448 --- /dev/null +++ b/testbed/Textualize__textual/docs/styles/text_style.md @@ -0,0 +1,55 @@ +# Text-style + +The `text-style` rule enables a number of different ways of displaying text. + +Text styles may be set in combination. +For example `bold underline` or `reverse underline strike`. + +## Syntax + +``` +text-style: ...; +``` + +### Values + +| Value | Description | +|-------------|----------------------------------------------------------------| +| `bold` | **bold text** | +| `italic` | _italic text_ | +| `reverse` | reverse video text (foreground and background colors reversed) | +| `underline` | underline text | +| `strike` | strikethrough text | + +## Example + +Each of the three text panels has a different text style. + +=== "text_style.py" + + ```python + --8<-- "docs/examples/styles/text_style.py" + ``` + +=== "text_style.css" + + ```css + --8<-- "docs/examples/styles/text_style.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/styles/text_style.py"} + ``` + +## CSS + +```sass +text-style: italic; +``` + +## Python + +```python +widget.styles.text_style = "italic" +``` diff --git a/testbed/Textualize__textual/docs/styles/tint.md b/testbed/Textualize__textual/docs/styles/tint.md new file mode 100644 index 0000000000000000000000000000000000000000..dde7e3aaf7bc3af329a1dd76e530e9dc2e5b30c7 --- /dev/null +++ b/testbed/Textualize__textual/docs/styles/tint.md @@ -0,0 +1,51 @@ +# Tint + +The tint rule blends a color with the widget. The color should likely have an _alpha_ component, or the end result would obscure the widget content. + +## Syntax + +``` +tint: []; +``` + +## Example + +This examples shows a green tint with gradually increasing alpha. + +=== "tint.py" + + ```python + --8<-- "docs/examples/styles/tint.py" + ``` + +=== "tint.css" + + ```css + --8<-- "docs/examples/styles/tint.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/styles/tint.py"} + ``` + +## CSS + +```sass +/* A red tint (could indicate an error) */ +tint: red 20% + +/* A green tint */ +tint: rgba(0, 200, 0, 0.3); +``` + +# Python + +```python +# A red tint +from textual.color import Color +widget.styles.tint = Color.parse("red").with_alpha(0.2); + +# A green tint +widget.styles.tint = "rgba(0, 200, 0, 0.3): +``` diff --git a/testbed/Textualize__textual/docs/styles/visibility.md b/testbed/Textualize__textual/docs/styles/visibility.md new file mode 100644 index 0000000000000000000000000000000000000000..d864487b007c0fb46f4f154d10a131ed674d87dc --- /dev/null +++ b/testbed/Textualize__textual/docs/styles/visibility.md @@ -0,0 +1,67 @@ +# Visibility + +The `visibility` rule may be used to make a widget invisible while still reserving spacing for it. + +## Syntax + +``` +visibility: [visible|hidden]; +``` + +### Values + +| Value | Description | +|---------------------|----------------------------------------| +| `visible` (default) | The widget will be displayed as normal | +| `hidden` | The widget will be invisible | + +## Example + +Note that the second widget is hidden, while leaving a space where it would have been rendered. + +=== "visibility.py" + + ```python + --8<-- "docs/examples/styles/visibility.py" + ``` + +=== "visibility.css" + + ```css + --8<-- "docs/examples/styles/visibility.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/styles/visibility.py"} + ``` + +## CSS + +```sass +/* Widget is on screen */ +visibility: visible; + +/* Widget is not on the screen */ +visibility: hidden; +``` + +## Python + +```python +# Widget is invisible +self.styles.visibility = "hidden" + +# Widget is visible +self.styles.visibility = "visible" +``` + +There is also a shortcut to set a Widget's visibility. The `visible` property on `Widget` may be set to `True` or `False`. + +```python +# Make a widget invisible +widget.visible = False + +# Make the widget visible again +widget.visible = True +``` diff --git a/testbed/Textualize__textual/docs/styles/width.md b/testbed/Textualize__textual/docs/styles/width.md new file mode 100644 index 0000000000000000000000000000000000000000..499048483a46b2c0dadbd484f0be6af8c44ded53 --- /dev/null +++ b/testbed/Textualize__textual/docs/styles/width.md @@ -0,0 +1,51 @@ +# Width + +The `width` rule sets a widget's width. By default, it sets the width of the content area, but if `box-sizing` is set to `border-box` it sets the width of the border area. + +## Syntax + +``` +width: ; +``` + +## Example + +This example adds a widget with 50% width of the screen. + +=== "width.py" + + ```python + --8<-- "docs/examples/styles/width.py" + ``` + +=== "width.css" + + ```css + --8<-- "docs/examples/styles/width.css" + ``` + +=== "Output" + + ```{.textual path="docs/examples/styles/width.py"} + ``` + +## CSS + +```sass +/* Explicit cell width */ +width: 10; + +/* Percentage width */ +width: 50%; + +/* Automatic width */ +width: auto +``` + +## Python + +```python +self.styles.width = 10 +self.styles.width = "50% +self.styles.width = "auto" +``` diff --git a/testbed/Textualize__textual/docs/stylesheets/custom.css b/testbed/Textualize__textual/docs/stylesheets/custom.css new file mode 100644 index 0000000000000000000000000000000000000000..ea1639ef1043c876e6d8448e5c299fc7af211488 --- /dev/null +++ b/testbed/Textualize__textual/docs/stylesheets/custom.css @@ -0,0 +1,26 @@ +h2.doc.doc-heading { + border-top: 1px solid rgba(0, 0, 0, 0.1); + padding-top: 48px; +} + +h3 .doc-heading code { + font-size: 16px; +} + +.doc-heading code { + font-weight: normal; + font-family: "Roboto Mono", "SFMono-Regular", Consolas, "Courier New", Courier, + monospace; +} + +body[data-md-color-primary="black"] .excalidraw svg { + filter: invert(100%) hue-rotate(180deg); +} + +body[data-md-color-primary="black"] .excalidraw svg rect { + fill: transparent; +} + +.excalidraw { + text-align: center; +} diff --git a/testbed/Textualize__textual/docs/tutorial.md b/testbed/Textualize__textual/docs/tutorial.md new file mode 100644 index 0000000000000000000000000000000000000000..c9e03c89e681c07f3ac036902f8987cea4f076ba --- /dev/null +++ b/testbed/Textualize__textual/docs/tutorial.md @@ -0,0 +1,456 @@ +--- +hide: + - navigation +--- + +# Tutorial + +Welcome to the Textual Tutorial! + +By the end of this page you should have a solid understanding of app development with Textual. + +!!! quote + + If you want people to build things, make it fun. + + — **Will McGugan** (creator of Rich and Textual) + + +## Stopwatch Application + +We're going to build a stopwatch application. This application should show a list of stopwatches with buttons to start, stop, and reset the stopwatches. We also want the user to be able to add and remove stopwatches as required. + +This will be a simple yet **fully featured** app — you could distribute this app if you wanted to! + +Here's what the finished app will look like: + + +```{.textual path="docs/examples/tutorial/stopwatch.py" press="tab,enter,_,tab,enter,_,tab,_,enter,_,tab,enter,_,_"} +``` + +### Get the code + +If you want to try the finished Stopwatch app and follow along with the code, first make sure you have [Textual installed](getting_started.md) then check out the [Textual](https://github.com/Textualize/textual) repository: + +=== "HTTPS" + + ```bash + git clone -b css https://github.com/Textualize/textual.git + ``` + +=== "SSH" + + ```bash + git clone -b css git@github.com:Textualize/textual.git + ``` + +=== "GitHub CLI" + + ```bash + gh repo clone Textualize/textual + ``` + + +With the repository cloned, navigate to `docs/examples/tutorial` and run `stopwatch.py`. + +```bash +cd textual/docs/examples/tutorial +python stopwatch.py +``` + +## Type hints (in brief) + +!!! tip inline end + + Type hints are entirely optional in Textual. We've included them in the example code but it's up to you whether you add them to your own projects. + +We're a big fan of Python type hints at Textualize. If you haven't encountered type hinting, it's a way to express the types of your data, parameters, and return values. Type hinting allows tools like [Mypy](https://mypy.readthedocs.io/en/stable/) to catch bugs before your code runs. + +The following function contains type hints: + +```python +def repeat(text: str, count: int) -> str: + """Repeat a string a given number of times.""" + return text * count +``` + +Parameter types follow a colon. So `text: str` indicates that `text` requires a string and `count: int` means that `count` requires an integer. + +Return types follow `->`. So `-> str:` indicates this method returns a string. + + +## The App class + +The first step in building a Textual app is to import and extend the `App` class. Here's a basic app class we will use as a starting point for the stopwatch app. + +```python title="stopwatch01.py" +--8<-- "docs/examples/tutorial/stopwatch01.py" +``` + +If you run this code, you should see something like the following: + + +```{.textual path="docs/examples/tutorial/stopwatch01.py"} +``` + +Hit the ++d++ key to toggle between light and dark mode. + +```{.textual path="docs/examples/tutorial/stopwatch01.py" press="d" title="TimerApp + dark"} +``` + +Hit ++ctrl+c++ to exit the app and return to the command prompt. + +### A closer look at the App class + +Let's examine stopwatch01.py in more detail. + +```python title="stopwatch01.py" hl_lines="1 2" +--8<-- "docs/examples/tutorial/stopwatch01.py" +``` + +The first line imports the Textual `App` class, which we will use as the base class for our App. The second line imports two builtin widgets: `Footer` which shows a bar at the bottom of the screen with current keys, and `Header` which shows a title and the current time at the top of the screen. Widgets are re-usable components responsible for managing a part of the screen. We will cover how to build widgets in this tutorial. + +The following lines define the app itself: + +```python title="stopwatch01.py" hl_lines="5-17" +--8<-- "docs/examples/tutorial/stopwatch01.py" +``` + +The App class is where most of the logic of Textual apps is written. It is responsible for loading configuration, setting up widgets, handling keys, and more. + +Here's what the above app defines: + +- `BINDINGS` is a list of tuples that maps (or *binds*) keys to actions in your app. The first value in the tuple is the key; the second value is the name of the action; the final value is a short description. We have a single binding which maps the ++d++ key on to the "toggle_dark" action. See [key bindings](./guide/input.md#bindings) in the guide for details. + +- `compose()` is where we construct a user interface with widgets. The `compose()` method may return a list of widgets, but it is generally easier to _yield_ them (making this method a generator). In the example code we yield an instance of each of the widget classes we imported, i.e. `Header()` and `Footer()`. + +- `action_toggle_dark()` defines an _action_ method. Actions are methods beginning with `action_` followed by the name of the action. The `BINDINGS` list above tells Textual to run this action when the user hits the ++d++ key. See [actions](./guide/actions.md) in the guide for details. + +```python title="stopwatch01.py" hl_lines="20-22" +--8<-- "docs/examples/tutorial/stopwatch01.py" +``` + +The final three lines create an instance of the app and calls the [run()][textual.app.App.run] method which puts your terminal in to *application mode* and runs the app until you exit with ++ctrl+c++. This happens within a `__name__ == "__main__"` block so we could run the app with `python stopwatch01.py` or import it as part of a larger project. + +## Designing a UI with widgets + +Textual comes with a number of builtin widgets, like Header and Footer, which are versatile and re-usable. We will need to build some custom widgets for the stopwatch. Before we dive in to that, let's first sketch a design for the app — so we know what we're aiming for. + +
+--8<-- "docs/images/stopwatch.excalidraw.svg" +
+ +### Custom widgets + +We need a `Stopwatch` widget composed of the following _child_ widgets: + +- A "Start" button +- A "Stop" button +- A "Reset" button +- A time display + +Textual has a builtin `Button` widget which takes care of the first three components. All we need to build is the time display widget which will show the elapsed time and the stopwatch widget itself. + +Let's add those to the app. Just a skeleton for now, we will add the rest of the features as we go. + +```python title="stopwatch02.py" hl_lines="2-3 6-7 10-18 30" +--8<-- "docs/examples/tutorial/stopwatch02.py" +``` + +We've imported two new widgets in this code: `Button`, which creates a clickable button, and `Static` which is a base class for a simple control. We've also imported `Container` from `textual.containers` which (as the name suggests) is a Widget which contains other widgets. + +We've defined an empty `TimeDisplay` widget by extending `Static`. We will flesh this out later. + +The Stopwatch widget class also extends `Static`. This class has a `compose()` method which yields child widgets, consisting of three `Button` objects and a single `TimeDisplay` object. These widgets will form the stopwatch in our sketch. + +#### The buttons + +The Button constructor takes a label to be displayed in the button (`"Start"`, `"Stop"`, or `"Reset"`). Additionally some of the buttons set the following parameters: + +- `id` is an identifier we can use to tell the buttons apart in code and apply styles. More on that later. +- `variant` is a string which selects a default style. The "success" variant makes the button green, and the "error" variant makes it red. + +### Composing the widgets + +To add widgets to our application we first need to yield them from the app's `compose()` method: + +The new line in `Stopwatch.compose()` yields a single `Container` object which will create a scrolling list of stopwatches. When classes contain other widgets (like `Container`) they will typically accept their child widgets as positional arguments. We want to start the app with three stopwatches, so we construct three `Stopwatch` instances and pass them to the container's constructor. + + +### The unstyled app + +Let's see what happens when we run "stopwatch02.py". + +```{.textual path="docs/examples/tutorial/stopwatch02.py" title="stopwatch02.py"} +``` + +The elements of the stopwatch application are there. The buttons are clickable and you can scroll the container but it doesn't look like the sketch. This is because we have yet to apply any _styles_ to our new widgets. + +## Writing Textual CSS + +Every widget has a `styles` object with a number of attributes that impact how the widget will appear. Here's how you might set white text and a blue background for a widget: + +```python +self.styles.background = "blue" +self.styles.color = "white" +``` + +While it's possible to set all styles for an app this way, it is rarely necessary. Textual has support for CSS (Cascading Style Sheets), a technology used by web browsers. CSS files are data files loaded by your app which contain information about styles to apply to your widgets. + +!!! info + + The dialect of CSS used in Textual is greatly simplified over web based CSS and much easier to learn. + + +CSS makes it easy to iterate on the design of your app and enables [live-editing](./guide/devtools.md#live-editing) — you can edit CSS and see the changes without restarting the app! + + +Let's add a CSS file to our application. + +```python title="stopwatch03.py" hl_lines="24" +--8<-- "docs/examples/tutorial/stopwatch03.py" +``` + +Adding the `CSS_PATH` class variable tells Textual to load the following file when the app starts: + +```sass title="stopwatch03.css" +--8<-- "docs/examples/tutorial/stopwatch03.css" +``` + +If we run the app now, it will look *very* different. + +```{.textual path="docs/examples/tutorial/stopwatch03.py" title="stopwatch03.py"} +``` + +This app looks much more like our sketch. let's look at how the Textual uses `stopwatch03.css` to apply styles. + +### CSS basics + +CSS files contain a number of _declaration blocks_. Here's the first such block from `stopwatch03.css` again: + +```sass +Stopwatch { + layout: horizontal; + background: $boost; + height: 5; + padding: 1; + margin: 1; +} +``` + +The first line tells Textual that the styles should apply to the `Stopwatch` widget. The lines between the curly brackets contain the styles themselves. + +Here's how this CSS code changes how the `Stopwatch` widget is displayed. + +
+--8<-- "docs/images/stopwatch_widgets.excalidraw.svg" +
+ +- `layout: horizontal` aligns child widgets horizontally from left to right. +- `background: $boost` sets the background color to `$boost`. The `$` prefix picks a pre-defined color from the builtin theme. There are other ways to specify colors such as `"blue"` or `rgb(20,46,210)`. +- `height: 5` sets the height of our widget to 5 lines of text. +- `padding: 1` sets a padding of 1 cell around the child widgets. +- `margin: 1` sets a margin of 1 cell around the Stopwatch widget to create a little space between widgets in the list. + + +Here's the rest of `stopwatch03.css` which contains further declaration blocks: + +```sass +TimeDisplay { + content-align: center middle; + opacity: 60%; + height: 3; +} + +Button { + width: 16; +} + +#start { + dock: left; +} + +#stop { + dock: left; + display: none; +} + +#reset { + dock: right; +} +``` + +The `TimeDisplay` block aligns text to the center (`content-align`), fades it slightly (`opacity`), and sets its height (`height`) to 3 lines. + +The `Button` block sets the width (`width`) of buttons to 16 cells (character widths). + +The last 3 blocks have a slightly different format. When the declaration begins with a `#` then the styles will be applied to widgets with a matching "id" attribute. We've set an ID on the Button widgets we yielded in compose. For instance the first button has `id="start"` which matches `#start` in the CSS. + +The buttons have a `dock` style which aligns the widget to a given edge. The start and stop buttons are docked to the left edge, while the reset button is docked to the right edge. + +You may have noticed that the stop button (`#stop` in the CSS) has `display: none;`. This tells Textual to not show the button. We do this because we don't want to display the stop button when the timer is *not* running. Similarly we don't want to show the start button when the timer is running. We will cover how to manage such dynamic user interfaces in the next section. + +### Dynamic CSS + +We want our Stopwatch widget to have two states: a default state with a Start and Reset button; and a _started_ state with a Stop button. When a stopwatch is started it should also have a green background and bold text. + +
+--8<-- "docs/images/css_stopwatch.excalidraw.svg" +
+ + +We can accomplish this with a CSS _class_. Not to be confused with a Python class, a CSS class is like a tag you can add to a widget to modify its styles. + +Here's the new CSS: + +```sass title="stopwatch04.css" hl_lines="33-53" +--8<-- "docs/examples/tutorial/stopwatch04.css" +``` + +These new rules are prefixed with `.started`. The `.` indicates that `.started` refers to a CSS class called "started". The new styles will be applied only to widgets that have this CSS class. + +Some of the new styles have more than one selector separated by a space. The space indicates that the rule should match the second selector if it is a child of the first. Let's look at one of these styles: + +```sass +.started #start { + display: none +} +``` + +The `.started` selector matches any widget with a `"started"` CSS class. While `#start` matches a child widget with an ID of "start". So it matches the Start button only for Stopwatches in a started state. + +The rule is `"display: none"` which tells Textual to hide the button. + +### Manipulating classes + +Modifying a widget's CSS classes is a convenient way to update visuals without introducing a lot of messy display related code. + +You can add and remove CSS classes with the [add_class()][textual.dom.DOMNode.add_class] and [remove_class()][textual.dom.DOMNode.remove_class] methods. We will use these methods to connect the started state to the Start / Stop buttons. + +The following code will start or stop the stopwatches in response to clicking a button. + +```python title="stopwatch04.py" hl_lines="13-18" +--8<-- "docs/examples/tutorial/stopwatch04.py" +``` + +The `on_button_pressed` method is an *event handler*. Event handlers are methods called by Textual in response to an *event* such as a key press, mouse click, etc. Event handlers begin with `on_` followed by the name of the event they will handler. Hence `on_button_pressed` will handle the button pressed event. + +If you run "stopwatch04.py" now you will be able to toggle between the two states by clicking the first button: + +```{.textual path="docs/examples/tutorial/stopwatch04.py" title="stopwatch04.py" press="tab,tab,tab,_,enter,_,_,_"} +``` + +## Reactive attributes + +A recurring theme in Textual is that you rarely need to explicitly update a widget. It is possible: you can call [refresh()][textual.widget.Widget.refresh] to display new data. However, Textual prefers to do this automatically via _reactive_ attributes. + +You can declare a reactive attribute with [reactive][textual.reactive.reactive]. Let's use this feature to create a timer that displays elapsed time and keeps it updated. + +```python title="stopwatch05.py" hl_lines="1 5 12-27" +--8<-- "docs/examples/tutorial/stopwatch05.py" +``` + +We have added two reactive attributes: `start_time` will contain the time in seconds when the stopwatch was started, and `time` will contain the time to be displayed on the Stopwatch. + +Both attributes will be available on `self` as if you had assigned them in `__init__`. If you write to either of these attributes the widget will update automatically. + +!!! info + + The `monotonic` function in this example is imported from the standard library `time` module. It is similar to `time.time` but won't go backwards if the system clock is changed. + +The first argument to `reactive` may be a default value or a callable that returns the default value. The default for `start_time` is `monotonic`. When `TimeDisplay` is added to the app, the `start_time` attribute will be set to the result of `monotonic()`. + +The `time` attribute has a simple float as the default value, so `self.time` will be `0` on start. + + +The `on_mount` method is an event handler called then the widget is first added to the application (or _mounted_). In this method we call [set_interval()][textual.message_pump.MessagePump.set_interval] to create a timer which calls `self.update_time` sixty times a second. This `update_time` method calculates the time elapsed since the widget started and assigns it to `self.time`. Which brings us to one of Reactive's super-powers. + +If you implement a method that begins with `watch_` followed by the name of a reactive attribute (making it a _watch method_), that method will be called when the attribute is modified. + +Because `watch_time` watches the `time` attribute, when we update `self.time` 60 times a second we also implicitly call `watch_time` which converts the elapsed time in to a string and updates the widget with a call to `self.update`. + +The end result is that the `Stopwatch` widgets show the time elapsed since the widget was created: + +```{.textual path="docs/examples/tutorial/stopwatch05.py" title="stopwatch05.py"} +``` + +We've seen how we can update widgets with a timer, but we still need to wire up the buttons so we can operate Stopwatches independently. + +### Wiring buttons + +We need to be able to start, stop, and reset each stopwatch independently. We can do this by adding a few more methods to the `TimeDisplay` class. + + +```python title="stopwatch06.py" hl_lines="14 18 30-44 50-61" +--8<-- "docs/examples/tutorial/stopwatch06.py" +``` + +Here's a summary of the changes made to `TimeDisplay`. + +- We've added a `total` reactive attribute to store the total time elapsed between clicking that start and stop buttons. +- The call to `set_interval` has grown a `pause=True` argument which starts the timer in pause mode (when a timer is paused it won't run until [resume()][textual.timer.Timer.resume] is called). This is because we don't want the time to update until the user hits the start button. +- We've stored the result of `set_interval` which returns a Timer object. We will use this later to _resume_ the timer when we start the Stopwatch. +- We've added `start()`, `stop()`, and `reset()` methods. + +In addition, the `on_button_pressed` method on `Stopwatch` has grown some code to manage the time display when the user clicks a button. Let's look at that in detail: + +```python + def on_button_pressed(self, event: Button.Pressed) -> None: + """Event handler called when a button is pressed.""" + button_id = event.button.id + time_display = self.query_one(TimeDisplay) + if button_id == "start": + time_display.start() + self.add_class("started") + elif button_id == "stop": + time_display.stop() + self.remove_class("started") + elif button_id == "reset": + time_display.reset() +``` + +This code supplies missing features and makes our app useful. We've made the following changes. + +- The first line retrieves `id` attribute of the button that was pressed. We can use this to decide what to do in response. +- The second line calls `query_one` to get a reference to the `TimeDisplay` widget. +- We call the method on `TimeDisplay` that matches the pressed button. +- We add the "started" class when the Stopwatch is started (`self.add_class("started)`), and remove it (`self.remove_class("started")`) when it is stopped. This will update the Stopwatch visuals via CSS. + +If you run stopwatch06.py you will be able to use the stopwatches independently. + +```{.textual path="docs/examples/tutorial/stopwatch06.py" title="stopwatch06.py" press="tab,enter,_,_,tab,enter,_,tab"} +``` + +The only remaining feature of the Stopwatch app left to implement is the ability to add and remove stopwatches. + +## Dynamic widgets + +The Stopwatch app creates widgets when it starts via the `compose` method. We will also need to create new widgets while the app is running, and remove widgets we no longer need. We can do this by calling [mount()][textual.widget.Widget.mount] to add a widget, and [remove()][textual.widget.Widget.remove] to remove a widget. + +Let's use these methods to implement adding and removing stopwatches to our app. + +```python title="stopwatch.py" hl_lines="78-79 88-92 94-98" +--8<-- "docs/examples/tutorial/stopwatch.py" +``` + +Here's a summary of the changes: + +- The Container object in StopWatchApp grew a "timers" ID. +- Added `action_add_stopwatch` to add a new stopwatch. +- Added `action_remove_stopwatch` to remove a stopwatch. +- Added keybindings for the actions. + +The `action_add_stopwatch` method creates and mounts a new stopwatch. Note the call to [query_one()][textual.dom.DOMNode.query_one] with a CSS selector of `"#timers"` which gets the timer's container via its ID. Once mounted, the new Stopwatch will appear in the terminal. That last line in `action_add_stopwatch` calls [scroll_visible()][textual.widget.Widget.scroll_visible] which will scroll the container to make the new Stopwatch visible (if required). + +The `action_remove_stopwatch` function calls [query()][textual.dom.DOMNode.query] with a CSS selector of `"Stopwatch"` which gets all the `Stopwatch` widgets. If there are stopwatches then the action calls [last()][textual.css.query.DOMQuery.last] to get the last stopwatch, and [remove()][textual.css.query.DOMQuery.remove] to remove it. + +If you run `stopwatch.py` now you can add a new stopwatch with the ++a++ key and remove a stopwatch with ++r++. + +```{.textual path="docs/examples/tutorial/stopwatch.py" press="d,a,a,a,a,a,a,a,tab,enter,_,_,_,_,tab,_"} +``` + +## What next? + +Congratulations on building your first Textual application! This tutorial has covered a lot of ground. If you are the type that prefers to learn a framework by coding, feel free. You could tweak stopwatch.py or look through the examples. + +Read the guide for the full details on how to build sophisticated TUI applications with Textual. diff --git a/testbed/Textualize__textual/docs/widgets/button.md b/testbed/Textualize__textual/docs/widgets/button.md new file mode 100644 index 0000000000000000000000000000000000000000..1387ffdf22293c53462f74dd77b7d37034131b87 --- /dev/null +++ b/testbed/Textualize__textual/docs/widgets/button.md @@ -0,0 +1,58 @@ +# Button + + +A simple button widget which can be pressed using a mouse click or by pressing ++return++ +when it has focus. + +- [x] Focusable +- [ ] Container + +## Example + +The example below shows each button variant, and its disabled equivalent. +Clicking any of the non-disabled buttons in the example app below will result in a ring of the terminal bell. + +=== "Output" + + ```{.textual path="docs/examples/widgets/button.py"} + ``` + +=== "button.py" + + ```python + --8<-- "docs/examples/widgets/button.py" + ``` + +=== "button.css" + + ```css + --8<-- "docs/examples/widgets/button.css" + ``` + +## Reactive Attributes + +| Name | Type | Default | Description | +| ---------- | ------ | ----------- | --------------------------------------------------------------------------------------------------------------------------------- | +| `label` | `str` | `""` | The text that appears inside the button. | +| `variant` | `str` | `"default"` | Semantic styling variant. One of `default`, `primary`, `success`, `warning`, `error`. | +| `disabled` | `bool` | `False` | Whether the button is disabled or not. Disabled buttons cannot be focused or clicked, and are styled in a way that suggests this. | + +## Messages + +### Pressed + +The `Button.Pressed` message is sent when the button is pressed. + +- [x] Bubbles + +#### Attributes + +_No other attributes_ + +## Additional Notes + +* The spacing between the text and the edges of a button are due to border, _not_ padding. To create a button with zero visible padding, use the `border: none;` declaration. + +## See Also + +* [Button](../reference/button.md) code reference diff --git a/testbed/Textualize__textual/docs/widgets/data_table.md b/testbed/Textualize__textual/docs/widgets/data_table.md new file mode 100644 index 0000000000000000000000000000000000000000..ce7f25bf53c6612d0d12146ff761ba46e2f1907e --- /dev/null +++ b/testbed/Textualize__textual/docs/widgets/data_table.md @@ -0,0 +1,38 @@ +# DataTable + +A data table widget. + +- [x] Focusable +- [ ] Container + +## Example + +The example below populates a table with CSV data. + +=== "Output" + + ```{.textual path="docs/examples/widgets/table.py"} + ``` + +=== "table.py" + + ```python + --8<-- "docs/examples/widgets/table.py" + ``` + + +## Reactive Attributes + +| Name | Type | Default | Description | +| --------------- | ------ | ------- | ---------------------------------- | +| `show_header` | `bool` | `True` | Show the table header | +| `fixed_rows` | `int` | `0` | Number of fixed rows | +| `fixed_columns` | `int` | `0` | Number of fixed columns | +| `zebra_stripes` | `bool` | `False` | Display alternating colors on rows | +| `header_height` | `int` | `1` | Height of header row | +| `show_cursor` | `bool` | `True` | Show a cell cursor | + + +## See Also + +* [DataTable][textual.widgets.DataTable] code reference diff --git a/testbed/Textualize__textual/docs/widgets/footer.md b/testbed/Textualize__textual/docs/widgets/footer.md new file mode 100644 index 0000000000000000000000000000000000000000..01717b2256d8dd4aeb2cd78bb9fcf5cb44a08bb4 --- /dev/null +++ b/testbed/Textualize__textual/docs/widgets/footer.md @@ -0,0 +1,42 @@ +# Footer + +A simple footer widget which is docked to the bottom of its parent container. Displays +available keybindings for the currently focused widget. + +- [ ] Focusable +- [ ] Container + +## Example + +The example below shows an app with a single keybinding that contains only a `Footer` +widget. Notice how the `Footer` automatically displays the keybind. + +=== "Output" + + ```{.textual path="docs/examples/widgets/footer.py"} + ``` + +=== "footer.py" + + ```python + --8<-- "docs/examples/widgets/footer.py" + ``` + +## Reactive Attributes + +| Name | Type | Default | Description | +| --------------- | ----- | ------- | --------------------------------------------------------------------------------------------------------- | +| `highlight_key` | `str` | `None` | Stores the currently highlighted key. This is typically the key the cursor is hovered over in the footer. | + +## Messages + +This widget sends no messages. + +## Additional Notes + +* You can prevent keybindings from appearing in the footer by setting the `show` argument of the `Binding` to `False`. +* You can customize the text that appears for the key itself in the footer using the `key_display` argument of `Binding`. + +## See Also + +* [Footer](../reference/footer.md) code reference diff --git a/testbed/Textualize__textual/docs/widgets/header.md b/testbed/Textualize__textual/docs/widgets/header.md new file mode 100644 index 0000000000000000000000000000000000000000..685ce04ee74be512a8f867368323c4154e5170a3 --- /dev/null +++ b/testbed/Textualize__textual/docs/widgets/header.md @@ -0,0 +1,35 @@ +# Header + +A simple header widget which docks itself to the top of the parent container. + +- [ ] Focusable +- [ ] Container + +## Example + +The example below shows an app with a `Header`. + +=== "Output" + + ```{.textual path="docs/examples/widgets/header.py"} + ``` + +=== "header.py" + + ```python + --8<-- "docs/examples/widgets/header.py" + ``` + +## Reactive Attributes + +| Name | Type | Default | Description | +| ------ | ------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `tall` | `bool` | `True` | Whether the `Header` widget is displayed as tall or not. The tall variant is 3 cells tall by default. The non-tall variant is a single cell tall. This can be toggled by clicking on the header. | + +## Messages + +This widget sends no messages. + +## See Also + +* [Header](../reference/header.md) code reference diff --git a/testbed/Textualize__textual/docs/widgets/index.md b/testbed/Textualize__textual/docs/widgets/index.md new file mode 100644 index 0000000000000000000000000000000000000000..90c80104e51ab985e805b0a889cecddde9c7844f --- /dev/null +++ b/testbed/Textualize__textual/docs/widgets/index.md @@ -0,0 +1,3 @@ +# Widgets + +A reference to the builtin [widgets](../guide/widgets.md). diff --git a/testbed/Textualize__textual/docs/widgets/input.md b/testbed/Textualize__textual/docs/widgets/input.md new file mode 100644 index 0000000000000000000000000000000000000000..e98d27b23b75883c8f87cff72e31ecf97ee1e7cb --- /dev/null +++ b/testbed/Textualize__textual/docs/widgets/input.md @@ -0,0 +1,67 @@ +# Input + +A single-line text input widget. + +- [x] Focusable +- [ ] Container + +## Example + +The example below shows how you might create a simple form using two `Input` widgets. + +=== "Output" + + ```{.textual path="docs/examples/widgets/input.py" press="tab,D,a,r,r,e,n"} + ``` + +=== "input.py" + + ```python + --8<-- "docs/examples/widgets/input.py" + ``` + +## Reactive Attributes + +| Name | Type | Default | Description | +| ----------------- | ------ | ------- | --------------------------------------------------------------- | +| `cursor_blink` | `bool` | `True` | True if cursor blinking is enabled. | +| `value` | `str` | `""` | The value currently in the text input. | +| `cursor_position` | `int` | `0` | The index of the cursor in the value string. | +| `placeholder` | `str` | `str` | The dimmed placeholder text to display when the input is empty. | +| `password` | `bool` | `False` | True if the input should be masked. | + +## Messages + +### Changed + +The `Input.Changed` message is sent when the value in the text input changes. + +- [x] Bubbles + +#### Attributes + +| attribute | type | purpose | +| --------- | ----- | -------------------------------- | +| `value` | `str` | The new value in the text input. | + + +### Submitted + +The `Input.Submitted` message is sent when you press ++enter++ with the text field submitted. + +- [x] Bubbles + +#### Attributes + +| attribute | type | purpose | +| --------- | ----- | -------------------------------- | +| `value` | `str` | The new value in the text input. | + + +## Additional Notes + +* The spacing around the text content is due to border. To remove it, set `border: none;` in your CSS. + +## See Also + +* [Input](../reference/input.md) code reference diff --git a/testbed/Textualize__textual/docs/widgets/static.md b/testbed/Textualize__textual/docs/widgets/static.md new file mode 100644 index 0000000000000000000000000000000000000000..3ed68ac95a37cc2262a93c64b5742ec03d922652 --- /dev/null +++ b/testbed/Textualize__textual/docs/widgets/static.md @@ -0,0 +1,34 @@ +# Static + +A widget which displays static content. +Can be used for simple text labels, but can also contain more complex Rich renderables. + +- [ ] Focusable +- [x] Container + +## Example + +The example below shows how you can use a `Static` widget as a simple text label. + +=== "Output" + + ```{.textual path="docs/examples/widgets/static.py"} + ``` + +=== "static.py" + + ```python + --8<-- "docs/examples/widgets/static.py" + ``` + +## Reactive Attributes + +This widget has no reactive attributes. + +## Messages + +This widget sends no messages. + +## See Also + +* [Static](../reference/static.md) code reference diff --git a/testbed/Textualize__textual/docs/widgets/tree_control.md b/testbed/Textualize__textual/docs/widgets/tree_control.md new file mode 100644 index 0000000000000000000000000000000000000000..1155acfcc082006cf24f71885bf95851e6577803 --- /dev/null +++ b/testbed/Textualize__textual/docs/widgets/tree_control.md @@ -0,0 +1 @@ +# TreeControl diff --git a/testbed/Textualize__textual/examples/calculator.css b/testbed/Textualize__textual/examples/calculator.css new file mode 100644 index 0000000000000000000000000000000000000000..3a65ed1c06f404627b5d8c6a3b61bb0a51115d2c --- /dev/null +++ b/testbed/Textualize__textual/examples/calculator.css @@ -0,0 +1,32 @@ +Screen { + overflow: auto; +} + +#calculator { + layout: grid; + grid-size: 4; + grid-gutter: 1 2; + grid-columns: 1fr; + grid-rows: 2fr 1fr 1fr 1fr 1fr 1fr; + margin: 1 2; + min-height: 25; + min-width: 26; +} + +Button { + width: 100%; + height: 100%; +} + +#numbers { + column-span: 4; + content-align: right middle; + padding: 0 1; + height: 100%; + background: $primary-lighten-2; + color: $text; +} + +#number-0 { + column-span: 2; +} diff --git a/testbed/Textualize__textual/examples/calculator.py b/testbed/Textualize__textual/examples/calculator.py new file mode 100644 index 0000000000000000000000000000000000000000..9477b6cdd3b643224a735d34db8b9147424e6e8a --- /dev/null +++ b/testbed/Textualize__textual/examples/calculator.py @@ -0,0 +1,143 @@ +from decimal import Decimal + +from textual.app import App, ComposeResult +from textual import events +from textual.containers import Container +from textual.reactive import var +from textual.widgets import Button, Static + + +class CalculatorApp(App): + """A working 'desktop' calculator.""" + + CSS_PATH = "calculator.css" + + numbers = var("0") + show_ac = var(True) + left = var(Decimal("0")) + right = var(Decimal("0")) + value = var("") + operator = var("plus") + + KEY_MAP = { + "+": "plus", + "-": "minus", + ".": "point", + "*": "multiply", + "/": "divide", + "_": "plus-minus", + "%": "percent", + "=": "equals", + } + + def watch_numbers(self, value: str) -> None: + """Called when numbers is updated.""" + # Update the Numbers widget + self.query_one("#numbers", Static).update(value) + + def compute_show_ac(self) -> bool: + """Compute switch to show AC or C button""" + return self.value in ("", "0") and self.numbers == "0" + + def watch_show_ac(self, show_ac: bool) -> None: + """Called when show_ac changes.""" + self.query_one("#c").display = not show_ac + self.query_one("#ac").display = show_ac + + def compose(self) -> ComposeResult: + """Add our buttons.""" + yield Container( + Static(id="numbers"), + Button("AC", id="ac", variant="primary"), + Button("C", id="c", variant="primary"), + Button("+/-", id="plus-minus", variant="primary"), + Button("%", id="percent", variant="primary"), + Button("÷", id="divide", variant="warning"), + Button("7", id="number-7"), + Button("8", id="number-8"), + Button("9", id="number-9"), + Button("×", id="multiply", variant="warning"), + Button("4", id="number-4"), + Button("5", id="number-5"), + Button("6", id="number-6"), + Button("-", id="minus", variant="warning"), + Button("1", id="number-1"), + Button("2", id="number-2"), + Button("3", id="number-3"), + Button("+", id="plus", variant="warning"), + Button("0", id="number-0"), + Button(".", id="point"), + Button("=", id="equals", variant="warning"), + id="calculator", + ) + + def on_key(self, event: events.Key) -> None: + """Called when the user presses a key.""" + + def press(button_id: str) -> None: + self.query_one(f"#{button_id}", Button).press() + self.set_focus(None) + + key = event.key + if key.isdecimal(): + press(f"number-{key}") + elif key == "c": + press("c") + press("ac") + elif key in self.KEY_MAP: + press(self.KEY_MAP[key]) + + def on_button_pressed(self, event: Button.Pressed) -> None: + """Called when a button is pressed.""" + + button_id = event.button.id + assert button_id is not None + + self.bell() # Terminal bell + + def do_math() -> None: + """Does the math: LEFT OPERATOR RIGHT""" + try: + if self.operator == "plus": + self.left += self.right + elif self.operator == "minus": + self.left -= self.right + elif self.operator == "divide": + self.left /= self.right + elif self.operator == "multiply": + self.left *= self.right + self.numbers = str(self.left) + self.value = "" + except Exception: + self.numbers = "Error" + + if button_id.startswith("number-"): + number = button_id.partition("-")[-1] + self.numbers = self.value = self.value.lstrip("0") + number + elif button_id == "plus-minus": + self.numbers = self.value = str(Decimal(self.value or "0") * -1) + elif button_id == "percent": + self.numbers = self.value = str(Decimal(self.value or "0") / Decimal(100)) + elif button_id == "point": + if "." not in self.value: + self.numbers = self.value = (self.value or "0") + "." + elif button_id == "ac": + self.value = "" + self.left = self.right = Decimal(0) + self.operator = "plus" + self.numbers = "0" + elif button_id == "c": + self.value = "" + self.numbers = "0" + elif button_id in ("plus", "minus", "divide", "multiply"): + self.right = Decimal(self.value or "0") + do_math() + self.operator = button_id + elif button_id == "equals": + if self.value: + self.right = Decimal(self.value) + do_math() + + +if __name__ == "__main__": + CalculatorApp().run() diff --git a/testbed/Textualize__textual/examples/code_browser.css b/testbed/Textualize__textual/examples/code_browser.css new file mode 100644 index 0000000000000000000000000000000000000000..2a58b68e1b829202e7249450f62131d2c29b521e --- /dev/null +++ b/testbed/Textualize__textual/examples/code_browser.css @@ -0,0 +1,29 @@ +Screen { + background: $surface-darken-1; +} + +#tree-view { + display: none; + scrollbar-gutter: stable; + width: auto; +} + +CodeBrowser.-show-tree #tree-view { + display: block; + dock: left; + height: 100%; + max-width: 50%; + background: #151C25; +} + +DirectoryTree { + padding-right: 1; +} + +#code-view { + overflow: auto scroll; + min-width: 100%; +} +#code { + width: auto; +} diff --git a/testbed/Textualize__textual/examples/code_browser.py b/testbed/Textualize__textual/examples/code_browser.py new file mode 100644 index 0000000000000000000000000000000000000000..86b54665a65861b85a562d747bfe5de7e3d2ec89 --- /dev/null +++ b/testbed/Textualize__textual/examples/code_browser.py @@ -0,0 +1,70 @@ +""" +Code browser example. + +Run with: + + python code_browser.py PATH + +""" + +import sys + +from rich.syntax import Syntax +from rich.traceback import Traceback +from textual.app import App, ComposeResult +from textual.containers import Container, Vertical +from textual.reactive import var +from textual.widgets import DirectoryTree, Footer, Header, Static + + +class CodeBrowser(App): + """Textual code browser app.""" + + CSS_PATH = "code_browser.css" + BINDINGS = [ + ("f", "toggle_files", "Toggle Files"), + ("q", "quit", "Quit"), + ] + + show_tree = var(True) + + def watch_show_tree(self, show_tree: bool) -> None: + """Called when show_tree is modified.""" + self.set_class(show_tree, "-show-tree") + + def compose(self) -> ComposeResult: + """Compose our UI.""" + path = "./" if len(sys.argv) < 2 else sys.argv[1] + yield Header() + yield Container( + Vertical(DirectoryTree(path), id="tree-view"), + Vertical(Static(id="code", expand=True), id="code-view"), + ) + yield Footer() + + def on_directory_tree_file_click(self, event: DirectoryTree.FileClick) -> None: + """Called when the user click a file in the directory tree.""" + code_view = self.query_one("#code", Static) + try: + syntax = Syntax.from_path( + event.path, + line_numbers=True, + word_wrap=False, + indent_guides=True, + theme="github-dark", + ) + except Exception: + code_view.update(Traceback(theme="github-dark", width=None)) + self.sub_title = "ERROR" + else: + code_view.update(syntax) + self.query_one("#code-view").scroll_home(animate=False) + self.sub_title = event.path + + def action_toggle_files(self) -> None: + """Called in response to key binding.""" + self.show_tree = not self.show_tree + + +if __name__ == "__main__": + CodeBrowser().run() diff --git a/testbed/Textualize__textual/examples/dictionary.css b/testbed/Textualize__textual/examples/dictionary.css new file mode 100644 index 0000000000000000000000000000000000000000..8850249c46105593fc11f5a745797e3622dabbf0 --- /dev/null +++ b/testbed/Textualize__textual/examples/dictionary.css @@ -0,0 +1,26 @@ +Screen { + background: $panel; +} + +Input { + dock: top; + margin: 1 0; +} + +#results { + width: auto; + min-height: 100%; + padding: 0 1; +} + +#results-container { + background: $background 50%; + margin: 0; + height: 100%; + overflow: hidden auto; + border: tall $background; +} + +#results-container:focus { + border: tall $accent; +} diff --git a/testbed/Textualize__textual/examples/dictionary.py b/testbed/Textualize__textual/examples/dictionary.py new file mode 100644 index 0000000000000000000000000000000000000000..80936ac011f7ad33661dbcc54652ce40c2b2d6db --- /dev/null +++ b/testbed/Textualize__textual/examples/dictionary.py @@ -0,0 +1,68 @@ +from __future__ import annotations + +import asyncio +from typing import Any + +try: + import httpx +except ImportError: + raise ImportError("Please install httpx with 'pip install httpx' ") + +from rich.markdown import Markdown + +from textual.app import App, ComposeResult +from textual.containers import Content +from textual.widgets import Static, Input + + +class DictionaryApp(App): + """Searches ab dictionary API as-you-type.""" + + CSS_PATH = "dictionary.css" + + def compose(self) -> ComposeResult: + yield Input(placeholder="Search for a word") + yield Content(Static(id="results"), id="results-container") + + async def on_input_changed(self, message: Input.Changed) -> None: + """A coroutine to handle a text changed message.""" + if message.value: + # Look up the word in the background + asyncio.create_task(self.lookup_word(message.value)) + else: + # Clear the results + self.query_one("#results", Static).update() + + async def lookup_word(self, word: str) -> None: + """Looks up a word.""" + url = f"https://api.dictionaryapi.dev/api/v2/entries/en/{word}" + async with httpx.AsyncClient() as client: + results = (await client.get(url)).json() + + if word == self.query_one(Input).value: + markdown = self.make_word_markdown(results) + self.query_one("#results", Static).update(Markdown(markdown)) + + def make_word_markdown(self, results: object) -> str: + """Convert the results in to markdown.""" + lines = [] + if isinstance(results, dict): + lines.append(f"# {results['title']}") + lines.append(results["message"]) + elif isinstance(results, list): + for result in results: + lines.append(f"# {result['word']}") + lines.append("") + for meaning in result.get("meanings", []): + lines.append(f"_{meaning['partOfSpeech']}_") + lines.append("") + for definition in meaning.get("definitions", []): + lines.append(f" - {definition['definition']}") + lines.append("---") + + return "\n".join(lines) + + +if __name__ == "__main__": + app = DictionaryApp() + app.run() diff --git a/testbed/Textualize__textual/examples/pride.py b/testbed/Textualize__textual/examples/pride.py new file mode 100644 index 0000000000000000000000000000000000000000..5253e0851e1fb00566b669870307155ffb5ef5a0 --- /dev/null +++ b/testbed/Textualize__textual/examples/pride.py @@ -0,0 +1,19 @@ +from textual.app import App +from textual.widgets import Static + + +class PrideApp(App): + """Displays a pride flag.""" + + COLORS = ["red", "orange", "yellow", "green", "blue", "purple"] + + def compose(self): + for color in self.COLORS: + stripe = Static() + stripe.styles.height = "1fr" + stripe.styles.background = color + yield stripe + + +if __name__ == "__main__": + PrideApp().run() diff --git a/testbed/Textualize__textual/imgs/codebrowser.svg b/testbed/Textualize__textual/imgs/codebrowser.svg new file mode 100644 index 0000000000000000000000000000000000000000..1181ec0370eda6b002c10c9ab6d6106fd784dff1 --- /dev/null +++ b/testbed/Textualize__textual/imgs/codebrowser.svg @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CodeBrowser + + + + + + + + + + +CodeBrowser — ./calculator.py15:39:34 + +📂 .  9  +├── 📁 .mypy_cache 10 classCalculatorApp(App):▆▆ +├── 📁 __pycache__ 11 │   """A working 'desktop' calculator.""" +├── 📄 README.md 12 │    +├── 📄 borders.py 13 │   numbers = var("0") +├── 📄 calculator.css 14 │   show_ac = var(True)▃▃ +├── 📄 calculator.py 15 │   left = var(Decimal("0")) +├── 📄 code_browser.css 16 │   right = var(Decimal("0")) +├── 📄 code_browser.py 17 │   value = var("") +└── 📄 pride.py 18 │   operator = var("plus") + 19 │    + 20 │   KEY_MAP = { + 21 │   │   "+""plus", + 22 │   │   "-""minus", + 23 │   │   ".""point", + 24 │   │   "*""multiply", + 25 │   │   "/""divide", + 26 │   │   "_""plus-minus", + 27 │   │   "%""percent", + 28 │   │   "=""equals", + 29 │   } + 30 │    + 31 │   defwatch_numbers(self, value: str) ->None: + 32 │   │   """Called when numbers is updated.""" + 33 │   │   # Update the Numbers widget + F  Toggle Files  Q  Quit  + + + diff --git a/testbed/Textualize__textual/imgs/stopwatch_dark.svg b/testbed/Textualize__textual/imgs/stopwatch_dark.svg new file mode 100644 index 0000000000000000000000000000000000000000..018fe69c39cff5b6b3d82a6f45a60051dc5b7318 --- /dev/null +++ b/testbed/Textualize__textual/imgs/stopwatch_dark.svg @@ -0,0 +1,199 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + StopwatchApp + + + + + + + + + + +StopwatchApp16:11:30 + + Start 00:00:00.00 Reset  +▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + + + +▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ + Stop 00:00:15.21 +▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + + + +▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ + Stop 00:00:13.96 +▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▃▃ + + + +▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ + Start 00:00:00.00 Reset  +▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + + + +▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ + Start 00:00:00.00 Reset  +▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + + + D  Toggle dark mode  A  Add  R  Remove  + + + diff --git a/testbed/Textualize__textual/imgs/stopwatch_light.svg b/testbed/Textualize__textual/imgs/stopwatch_light.svg new file mode 100644 index 0000000000000000000000000000000000000000..f2652cea165b6869bd7f44a1110b06973d22c266 --- /dev/null +++ b/testbed/Textualize__textual/imgs/stopwatch_light.svg @@ -0,0 +1,199 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + StopwatchApp + + + + + + + + + + +StopwatchApp16:11:33 + + Start 00:00:00.00 Reset  +▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + + + +▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ + Stop 00:00:18.33 +▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + + + +▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ + Stop 00:00:17.08 +▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▃▃ + + + +▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ + Start 00:00:00.00 Reset  +▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + + + +▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ + Start 00:00:00.00 Reset  +▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + + + D  Toggle dark mode  A  Add  R  Remove  + + + diff --git a/testbed/Textualize__textual/notes/layout.md b/testbed/Textualize__textual/notes/layout.md new file mode 100644 index 0000000000000000000000000000000000000000..70cd13af06dfd9f0151ca7b12195afb570e12a00 --- /dev/null +++ b/testbed/Textualize__textual/notes/layout.md @@ -0,0 +1,5 @@ +# Layout + +## rich.layout.Layout + +The Layout class is responsible for arranging widget within a defined area. There are several concrete Layout objects with different strategies for positioning widgets. diff --git a/testbed/Textualize__textual/notes/refresh.md b/testbed/Textualize__textual/notes/refresh.md new file mode 100644 index 0000000000000000000000000000000000000000..25e94cdb4deeae2b4441bd53f546a2fba724e5b5 --- /dev/null +++ b/testbed/Textualize__textual/notes/refresh.md @@ -0,0 +1,11 @@ +# Refresh system + +This note describes how Textual updates widgets on-screen. + +if widget has made some changes and wishes to update visuals it can call Widget.refresh. There are two flags on this method; `repaint` which will repaint just the widget, and `layout` which will re-layout the screen. A layout must be done if the widget has changed size / position / visibility. Otherwise repaint will refresh just the widget area. + +A refresh won't happen immediately when `refresh()` is called, rather it sets internal flags. The `on_idle` method of Widget checks these flags. This is so that multiple changes made to the UI while processing events don't cause excessive repainting of the screen (which makes the UI slow and jumpy). + +In the case of a repaint. The Widget.on_idle handler will emit (send to the parent) an UpdateMessage. This message will be handled by the parent view, which will update the widget (a particular part of the screen). + +In the case of a layout. The Widget.on_idle handler will emit a LayoutMessage. This message will be handled by the parent view, which calls refresh_layout on the root view, which will layout and repaint the entire screen. diff --git a/testbed/Textualize__textual/src/textual/__init__.py b/testbed/Textualize__textual/src/textual/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6177521479544a831aa96085d9ac340fe57bf1ee --- /dev/null +++ b/testbed/Textualize__textual/src/textual/__init__.py @@ -0,0 +1,130 @@ +from __future__ import annotations + +import sys +import inspect +from typing import Callable, TYPE_CHECKING + +import rich.repr +from rich.console import RenderableType + +__all__ = ["log", "panic"] + + +from ._context import active_app +from ._log import LogGroup, LogVerbosity + +if TYPE_CHECKING: + from .app import App + +if sys.version_info >= (3, 10): + from typing import TypeAlias +else: # pragma: no cover + from typing_extensions import TypeAlias + + +LogCallable: TypeAlias = "Callable" + + +class LoggerError(Exception): + """Raised when the logger failed.""" + + +@rich.repr.auto +class Logger: + """A Textual logger.""" + + def __init__( + self, + log_callable: LogCallable | None, + group: LogGroup = LogGroup.INFO, + verbosity: LogVerbosity = LogVerbosity.NORMAL, + ) -> None: + self._log = log_callable + self._group = group + self._verbosity = verbosity + + @property + def log(self) -> LogCallable: + if self._log is None: + try: + app = active_app.get() + except LookupError: + raise LoggerError("Unable to log without an active app.") from None + return app._log + return self._log + + def __rich_repr__(self) -> rich.repr.Result: + yield self._group, LogGroup.INFO + yield self._verbosity, LogVerbosity.NORMAL + + def __call__(self, *args: object, **kwargs) -> None: + caller = inspect.stack()[1] + try: + self.log( + self._group, + self._verbosity, + *args, + _textual_calling_frame=caller, + **kwargs, + ) + except LoggerError: + # If there is not active app, try printing + print_args = (*args, *[f"{key}={value!r}" for key, value in kwargs.items()]) + print(*print_args) + + def verbosity(self, verbose: bool) -> Logger: + """Get a new logger with selective verbosity. + + Args: + verbose (bool): True to use HIGH verbosity, otherwise NORMAL. + + Returns: + Logger: New logger. + """ + verbosity = LogVerbosity.HIGH if verbose else LogVerbosity.NORMAL + return Logger(self._log, self._group, verbosity) + + @property + def verbose(self) -> Logger: + """A verbose logger.""" + return Logger(self._log, self._group, LogVerbosity.HIGH) + + @property + def event(self) -> Logger: + """Logs events.""" + return Logger(self._log, LogGroup.EVENT) + + @property + def debug(self) -> Logger: + """Logs debug messages.""" + return Logger(self._log, LogGroup.DEBUG) + + @property + def info(self) -> Logger: + """Logs information.""" + return Logger(self._log, LogGroup.INFO) + + @property + def warning(self) -> Logger: + """Logs warnings.""" + return Logger(self._log, LogGroup.WARNING) + + @property + def error(self) -> Logger: + """Logs errors.""" + return Logger(self._log, LogGroup.ERROR) + + @property + def system(self) -> Logger: + """Logs system information.""" + return Logger(self._log, LogGroup.SYSTEM) + + +log = Logger(None) + + +def panic(*args: RenderableType) -> None: + from ._context import active_app + + app = active_app.get() + app.panic(*args) diff --git a/testbed/Textualize__textual/src/textual/_animator.py b/testbed/Textualize__textual/src/textual/_animator.py new file mode 100644 index 0000000000000000000000000000000000000000..b628a23f7bc9e10e74605619c6d35f186b71b0f6 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/_animator.py @@ -0,0 +1,344 @@ +from __future__ import annotations + +import asyncio +import sys +from abc import ABC, abstractmethod +from dataclasses import dataclass +from functools import partial +from typing import Any, Callable, TypeVar, TYPE_CHECKING + +from . import _clock +from ._callback import invoke +from ._easing import DEFAULT_EASING, EASING +from ._types import CallbackType +from .timer import Timer + +if sys.version_info >= (3, 8): + from typing import Protocol, runtime_checkable +else: # pragma: no cover + from typing_extensions import Protocol, runtime_checkable + +if TYPE_CHECKING: + from textual.app import App + +EasingFunction = Callable[[float], float] + +T = TypeVar("T") + + +@runtime_checkable +class Animatable(Protocol): + def blend(self: T, destination: T, factor: float) -> T: # pragma: no cover + ... + + +class Animation(ABC): + on_complete: CallbackType | None = None + """Callback to run after animation completes""" + + @abstractmethod + def __call__(self, time: float) -> bool: # pragma: no cover + """Call the animation, return a boolean indicating whether animation is in-progress or complete. + + Args: + time (float): The current timestamp + + Returns: + bool: True if the animation has finished, otherwise False. + """ + raise NotImplementedError("") + + def __eq__(self, other: object) -> bool: + return False + + +@dataclass +class SimpleAnimation(Animation): + obj: object + attribute: str + start_time: float + duration: float + start_value: float | Animatable + end_value: float | Animatable + final_value: object + easing: EasingFunction + on_complete: CallbackType | None = None + + def __call__(self, time: float) -> bool: + if self.duration == 0: + setattr(self.obj, self.attribute, self.final_value) + return True + + factor = min(1.0, (time - self.start_time) / self.duration) + eased_factor = self.easing(factor) + + if factor == 1.0: + value = self.final_value + elif isinstance(self.start_value, Animatable): + assert isinstance( + self.end_value, Animatable + ), "end_value must be animatable" + value = self.start_value.blend(self.end_value, eased_factor) + else: + assert isinstance( + self.start_value, (int, float) + ), f"`start_value` must be float, not {self.start_value!r}" + assert isinstance( + self.end_value, (int, float) + ), f"`end_value` must be float, not {self.end_value!r}" + if self.end_value > self.start_value: + eased_factor = self.easing(factor) + value = ( + self.start_value + + (self.end_value - self.start_value) * eased_factor + ) + else: + eased_factor = 1 - self.easing(factor) + value = ( + self.end_value + (self.start_value - self.end_value) * eased_factor + ) + setattr(self.obj, self.attribute, value) + return factor >= 1 + + def __eq__(self, other: object) -> bool: + if isinstance(other, SimpleAnimation): + return ( + self.final_value == other.final_value + and self.duration == other.duration + ) + return False + + +class BoundAnimator: + def __init__(self, animator: Animator, obj: object) -> None: + self._animator = animator + self._obj = obj + + def __call__( + self, + attribute: str, + value: float | Animatable, + *, + final_value: object = ..., + duration: float | None = None, + speed: float | None = None, + delay: float = 0.0, + easing: EasingFunction | str = DEFAULT_EASING, + on_complete: CallbackType | None = None, + ) -> None: + """Animate an attribute. + + Args: + attribute (str): Name of the attribute to animate. + value (float | Animatable): The value to animate to. + final_value (object, optional): The final value of the animation. Defaults to `value` if not set. + duration (float | None, optional): The duration of the animate. Defaults to None. + speed (float | None, optional): The speed of the animation. Defaults to None. + delay (float, optional): A delay (in seconds) before the animation starts. Defaults to 0.0. + easing (EasingFunction | str, optional): An easing method. Defaults to "in_out_cubic". + on_complete (CallbackType | None, optional): A callable to invoke when the animation is finished. Defaults to None. + + """ + easing_function = EASING[easing] if isinstance(easing, str) else easing + return self._animator.animate( + self._obj, + attribute=attribute, + value=value, + final_value=final_value, + duration=duration, + speed=speed, + delay=delay, + easing=easing_function, + on_complete=on_complete, + ) + + +class Animator: + """An object to manage updates to a given attribute over a period of time.""" + + def __init__(self, app: App, frames_per_second: int = 60) -> None: + self._animations: dict[tuple[object, str], Animation] = {} + self.app = app + self._timer = Timer( + app, + 1 / frames_per_second, + app, + name="Animator", + callback=self, + pause=True, + ) + self._idle_event = asyncio.Event() + + async def start(self) -> None: + """Start the animator task.""" + self._idle_event.set() + self._timer.start() + + async def stop(self) -> None: + """Stop the animator task.""" + try: + await self._timer.stop() + except asyncio.CancelledError: + pass + + def bind(self, obj: object) -> BoundAnimator: + """Bind the animator to a given objects.""" + return BoundAnimator(self, obj) + + def animate( + self, + obj: object, + attribute: str, + value: Any, + *, + final_value: object = ..., + duration: float | None = None, + speed: float | None = None, + easing: EasingFunction | str = DEFAULT_EASING, + delay: float = 0.0, + on_complete: CallbackType | None = None, + ) -> None: + """Animate an attribute to a new value. + + Args: + obj (object): The object containing the attribute. + attribute (str): The name of the attribute. + value (Any): The destination value of the attribute. + final_value (Any, optional): The final value, or ellipsis if it is the same as ``value``. Defaults to Ellipsis/ + duration (float | None, optional): The duration of the animation, or ``None`` to use speed. Defaults to ``None``. + speed (float | None, optional): The speed of the animation. Defaults to None. + easing (EasingFunction | str, optional): An easing function. Defaults to DEFAULT_EASING. + delay (float, optional): Number of seconds to delay the start of the animation by. Defaults to 0. + on_complete (CallbackType | None, optional): Callback to run after the animation completes. + """ + animate_callback = partial( + self._animate, + obj, + attribute, + value, + final_value=final_value, + duration=duration, + speed=speed, + easing=easing, + on_complete=on_complete, + ) + if delay: + self.app.set_timer(delay, animate_callback) + else: + animate_callback() + + def _animate( + self, + obj: object, + attribute: str, + value: Any, + *, + final_value: object = ..., + duration: float | None = None, + speed: float | None = None, + easing: EasingFunction | str = DEFAULT_EASING, + on_complete: CallbackType | None = None, + ): + """Animate an attribute to a new value. + + Args: + obj (object): The object containing the attribute. + attribute (str): The name of the attribute. + value (Any): The destination value of the attribute. + final_value (Any, optional): The final value, or ellipsis if it is the same as ``value``. Defaults to .... + duration (float | None, optional): The duration of the animation, or ``None`` to use speed. Defaults to ``None``. + speed (float | None, optional): The speed of the animation. Defaults to None. + easing (EasingFunction | str, optional): An easing function. Defaults to DEFAULT_EASING. + on_complete (CallbackType | None, optional): Callback to run after the animation completes. + """ + if not hasattr(obj, attribute): + raise AttributeError( + f"Can't animate attribute {attribute!r} on {obj!r}; attribute does not exist" + ) + assert (duration is not None and speed is None) or ( + duration is None and speed is not None + ), "An Animation should have a duration OR a speed" + + if final_value is ...: + final_value = value + + start_time = self._get_time() + + animation_key = (id(obj), attribute) + + easing_function = EASING[easing] if isinstance(easing, str) else easing + + animation: Animation | None = None + if hasattr(obj, "__textual_animation__"): + animation = getattr(obj, "__textual_animation__")( + attribute, + value, + start_time, + duration=duration, + speed=speed, + easing=easing_function, + on_complete=on_complete, + ) + if animation is None: + start_value = getattr(obj, attribute) + + if start_value == value: + self._animations.pop(animation_key, None) + return + + if duration is not None: + animation_duration = duration + else: + if hasattr(value, "get_distance_to"): + animation_duration = value.get_distance_to(start_value) / ( + speed or 50 + ) + else: + animation_duration = abs(value - start_value) / (speed or 50) + + animation = SimpleAnimation( + obj, + attribute=attribute, + start_time=start_time, + duration=animation_duration, + start_value=start_value, + end_value=value, + final_value=final_value, + easing=easing_function, + on_complete=on_complete, + ) + assert animation is not None, "animation expected to be non-None" + + current_animation = self._animations.get(animation_key) + if current_animation is not None and current_animation == animation: + return + + self._animations[animation_key] = animation + self._timer.resume() + self._idle_event.clear() + + async def __call__(self) -> None: + if not self._animations: + self._timer.pause() + self._idle_event.set() + else: + animation_time = self._get_time() + animation_keys = list(self._animations.keys()) + for animation_key in animation_keys: + animation = self._animations[animation_key] + animation_complete = animation(animation_time) + if animation_complete: + completion_callback = animation.on_complete + if completion_callback is not None: + await invoke(completion_callback) + del self._animations[animation_key] + + def _get_time(self) -> float: + """Get the current wall clock time, via the internal Timer.""" + # N.B. We could remove this method and always call `self._timer.get_time()` internally, + # but it's handy to have in mocking situations + return _clock.get_time_no_wait() + + async def wait_for_idle(self) -> None: + """Wait for any animations to complete.""" + await self._idle_event.wait() diff --git a/testbed/Textualize__textual/src/textual/_ansi_sequences.py b/testbed/Textualize__textual/src/textual/_ansi_sequences.py new file mode 100644 index 0000000000000000000000000000000000000000..c4be96b9e73c8f4400361c9c16d28b8e4e9cf554 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/_ansi_sequences.py @@ -0,0 +1,305 @@ +from typing import Mapping, Tuple + +from .keys import Keys + +# Mapping of vt100 escape codes to Keys. +ANSI_SEQUENCES_KEYS: Mapping[str, Tuple[Keys, ...]] = { + # Control keys. + " ": (Keys.Space,), + "\r": (Keys.Enter,), + "\x00": (Keys.ControlAt,), # Control-At (Also for Ctrl-Space) + "\x01": (Keys.ControlA,), # Control-A (home) + "\x02": (Keys.ControlB,), # Control-B (emacs cursor left) + "\x03": (Keys.ControlC,), # Control-C (interrupt) + "\x04": (Keys.ControlD,), # Control-D (exit) + "\x05": (Keys.ControlE,), # Control-E (end) + "\x06": (Keys.ControlF,), # Control-F (cursor forward) + "\x07": (Keys.ControlG,), # Control-G + "\x08": (Keys.Backspace,), # Control-H (8) (Identical to '\b') + "\x09": (Keys.Tab,), # Control-I (9) (Identical to '\t') + "\x0a": (Keys.ControlJ,), # Control-J (10) (Identical to '\n') + "\x0b": (Keys.ControlK,), # Control-K (delete until end of line; vertical tab) + "\x0c": (Keys.ControlL,), # Control-L (clear; form feed) + # "\x0d": (Keys.ControlM,), # Control-M (13) (Identical to '\r') + "\x0e": (Keys.ControlN,), # Control-N (14) (history forward) + "\x0f": (Keys.ControlO,), # Control-O (15) + "\x10": (Keys.ControlP,), # Control-P (16) (history back) + "\x11": (Keys.ControlQ,), # Control-Q + "\x12": (Keys.ControlR,), # Control-R (18) (reverse search) + "\x13": (Keys.ControlS,), # Control-S (19) (forward search) + "\x14": (Keys.ControlT,), # Control-T + "\x15": (Keys.ControlU,), # Control-U + "\x16": (Keys.ControlV,), # Control-V + "\x17": (Keys.ControlW,), # Control-W + "\x18": (Keys.ControlX,), # Control-X + "\x19": (Keys.ControlY,), # Control-Y (25) + "\x1a": (Keys.ControlZ,), # Control-Z + "\x1b": (Keys.Escape,), # Also Control-[ + "\x9b": (Keys.ShiftEscape,), + "\x1c": (Keys.ControlBackslash,), # Both Control-\ (also Ctrl-| ) + "\x1d": (Keys.ControlSquareClose,), # Control-] + "\x1e": (Keys.ControlCircumflex,), # Control-^ + "\x1f": (Keys.ControlUnderscore,), # Control-underscore (Also for Ctrl-hyphen.) + # ASCII Delete (0x7f) + # Vt220 (and Linux terminal) send this when pressing backspace. We map this + # to ControlH, because that will make it easier to create key bindings that + # work everywhere, with the trade-off that it's no longer possible to + # handle backspace and control-h individually for the few terminals that + # support it. (Most terminals send ControlH when backspace is pressed.) + # See: http://www.ibb.net/~anne/keyboard.html + "\x7f": (Keys.Backspace,), + "\x1b\x7f": (Keys.ControlW,), + # Various + "\x1b[1~": (Keys.Home,), # tmux + "\x1b[2~": (Keys.Insert,), + "\x1b[3~": (Keys.Delete,), + "\x1b[4~": (Keys.End,), # tmux + "\x1b[5~": (Keys.PageUp,), + "\x1b[6~": (Keys.PageDown,), + "\x1b[7~": (Keys.Home,), # xrvt + "\x1b[8~": (Keys.End,), # xrvt + "\x1b[Z": (Keys.BackTab,), # shift + tab + "\x1b\x09": (Keys.BackTab,), # Linux console + "\x1b[~": (Keys.BackTab,), # Windows console + # -- + # Function keys. + "\x1bOP": (Keys.F1,), + "\x1bOQ": (Keys.F2,), + "\x1bOR": (Keys.F3,), + "\x1bOS": (Keys.F4,), + "\x1b[[A": (Keys.F1,), # Linux console. + "\x1b[[B": (Keys.F2,), # Linux console. + "\x1b[[C": (Keys.F3,), # Linux console. + "\x1b[[D": (Keys.F4,), # Linux console. + "\x1b[[E": (Keys.F5,), # Linux console. + "\x1b[11~": (Keys.F1,), # rxvt-unicode + "\x1b[12~": (Keys.F2,), # rxvt-unicode + "\x1b[13~": (Keys.F3,), # rxvt-unicode + "\x1b[14~": (Keys.F4,), # rxvt-unicode + "\x1b[15~": (Keys.F5,), + "\x1b[17~": (Keys.F6,), + "\x1b[18~": (Keys.F7,), + "\x1b[19~": (Keys.F8,), + "\x1b[20~": (Keys.F9,), + "\x1b[21~": (Keys.F10,), + "\x1b[23~": (Keys.F11,), + "\x1b[24~": (Keys.F12,), + "\x1b[25~": (Keys.F13,), + "\x1b[26~": (Keys.F14,), + "\x1b[28~": (Keys.F15,), + "\x1b[29~": (Keys.F16,), + "\x1b[31~": (Keys.F17,), + "\x1b[32~": (Keys.F18,), + "\x1b[33~": (Keys.F19,), + "\x1b[34~": (Keys.F20,), + # Xterm + "\x1b[1;2P": (Keys.F13,), + "\x1b[1;2Q": (Keys.F14,), + # '\x1b[1;2R': Keys.F15, # Conflicts with CPR response. + "\x1b[1;2S": (Keys.F16,), + "\x1b[15;2~": (Keys.F17,), + "\x1b[17;2~": (Keys.F18,), + "\x1b[18;2~": (Keys.F19,), + "\x1b[19;2~": (Keys.F20,), + "\x1b[20;2~": (Keys.F21,), + "\x1b[21;2~": (Keys.F22,), + "\x1b[23;2~": (Keys.F23,), + "\x1b[24;2~": (Keys.F24,), + # -- + # Control + function keys. + "\x1b[1;5P": (Keys.ControlF1,), + "\x1b[1;5Q": (Keys.ControlF2,), + # "\x1b[1;5R": Keys.ControlF3, # Conflicts with CPR response. + "\x1b[1;5S": (Keys.ControlF4,), + "\x1b[15;5~": (Keys.ControlF5,), + "\x1b[17;5~": (Keys.ControlF6,), + "\x1b[18;5~": (Keys.ControlF7,), + "\x1b[19;5~": (Keys.ControlF8,), + "\x1b[20;5~": (Keys.ControlF9,), + "\x1b[21;5~": (Keys.ControlF10,), + "\x1b[23;5~": (Keys.ControlF11,), + "\x1b[24;5~": (Keys.ControlF12,), + "\x1b[1;6P": (Keys.ControlF13,), + "\x1b[1;6Q": (Keys.ControlF14,), + # "\x1b[1;6R": Keys.ControlF15, # Conflicts with CPR response. + "\x1b[1;6S": (Keys.ControlF16,), + "\x1b[15;6~": (Keys.ControlF17,), + "\x1b[17;6~": (Keys.ControlF18,), + "\x1b[18;6~": (Keys.ControlF19,), + "\x1b[19;6~": (Keys.ControlF20,), + "\x1b[20;6~": (Keys.ControlF21,), + "\x1b[21;6~": (Keys.ControlF22,), + "\x1b[23;6~": (Keys.ControlF23,), + "\x1b[24;6~": (Keys.ControlF24,), + # -- + # Tmux (Win32 subsystem) sends the following scroll events. + "\x1b[62~": (Keys.ScrollUp,), + "\x1b[63~": (Keys.ScrollDown,), + # -- + # Sequences generated by numpad 5. Not sure what it means. (It doesn't + # appear in 'infocmp'. Just ignore. + "\x1b[E": (Keys.Ignore,), # Xterm. + "\x1b[G": (Keys.Ignore,), # Linux console. + # -- + # Meta/control/escape + pageup/pagedown/insert/delete. + "\x1b[3;2~": (Keys.ShiftDelete,), # xterm, gnome-terminal. + "\x1b[5;2~": (Keys.ShiftPageUp,), + "\x1b[6;2~": (Keys.ShiftPageDown,), + "\x1b[2;3~": (Keys.Escape, Keys.Insert), + "\x1b[3;3~": (Keys.Escape, Keys.Delete), + "\x1b[5;3~": (Keys.Escape, Keys.PageUp), + "\x1b[6;3~": (Keys.Escape, Keys.PageDown), + "\x1b[2;4~": (Keys.Escape, Keys.ShiftInsert), + "\x1b[3;4~": (Keys.Escape, Keys.ShiftDelete), + "\x1b[5;4~": (Keys.Escape, Keys.ShiftPageUp), + "\x1b[6;4~": (Keys.Escape, Keys.ShiftPageDown), + "\x1b[3;5~": (Keys.ControlDelete,), # xterm, gnome-terminal. + "\x1b[5;5~": (Keys.ControlPageUp,), + "\x1b[6;5~": (Keys.ControlPageDown,), + "\x1b[3;6~": (Keys.ControlShiftDelete,), + "\x1b[5;6~": (Keys.ControlShiftPageUp,), + "\x1b[6;6~": (Keys.ControlShiftPageDown,), + "\x1b[2;7~": (Keys.Escape, Keys.ControlInsert), + "\x1b[5;7~": (Keys.Escape, Keys.ControlPageDown), + "\x1b[6;7~": (Keys.Escape, Keys.ControlPageDown), + "\x1b[2;8~": (Keys.Escape, Keys.ControlShiftInsert), + "\x1b[5;8~": (Keys.Escape, Keys.ControlShiftPageDown), + "\x1b[6;8~": (Keys.Escape, Keys.ControlShiftPageDown), + # -- + # Arrows. + # (Normal cursor mode). + "\x1b[A": (Keys.Up,), + "\x1b[B": (Keys.Down,), + "\x1b[C": (Keys.Right,), + "\x1b[D": (Keys.Left,), + "\x1b[H": (Keys.Home,), + "\x1b[F": (Keys.End,), + # Tmux sends following keystrokes when control+arrow is pressed, but for + # Emacs ansi-term sends the same sequences for normal arrow keys. Consider + # it a normal arrow press, because that's more important. + # (Application cursor mode). + "\x1bOA": (Keys.Up,), + "\x1bOB": (Keys.Down,), + "\x1bOC": (Keys.Right,), + "\x1bOD": (Keys.Left,), + "\x1bOF": (Keys.End,), + "\x1bOH": (Keys.Home,), + # Shift + arrows. + "\x1b[1;2A": (Keys.ShiftUp,), + "\x1b[1;2B": (Keys.ShiftDown,), + "\x1b[1;2C": (Keys.ShiftRight,), + "\x1b[1;2D": (Keys.ShiftLeft,), + "\x1b[1;2F": (Keys.ShiftEnd,), + "\x1b[1;2H": (Keys.ShiftHome,), + # Meta + arrow keys. Several terminals handle this differently. + # The following sequences are for xterm and gnome-terminal. + # (Iterm sends ESC followed by the normal arrow_up/down/left/right + # sequences, and the OSX Terminal sends ESCb and ESCf for "alt + # arrow_left" and "alt arrow_right." We don't handle these + # explicitly, in here, because would could not distinguish between + # pressing ESC (to go to Vi navigation mode), followed by just the + # 'b' or 'f' key. These combinations are handled in + # the input processor.) + "\x1b[1;3A": (Keys.Escape, Keys.Up), + "\x1b[1;3B": (Keys.Escape, Keys.Down), + "\x1b[1;3C": (Keys.Escape, Keys.Right), + "\x1b[1;3D": (Keys.Escape, Keys.Left), + "\x1b[1;3F": (Keys.Escape, Keys.End), + "\x1b[1;3H": (Keys.Escape, Keys.Home), + # Alt+shift+number. + "\x1b[1;4A": (Keys.Escape, Keys.ShiftDown), + "\x1b[1;4B": (Keys.Escape, Keys.ShiftUp), + "\x1b[1;4C": (Keys.Escape, Keys.ShiftRight), + "\x1b[1;4D": (Keys.Escape, Keys.ShiftLeft), + "\x1b[1;4F": (Keys.Escape, Keys.ShiftEnd), + "\x1b[1;4H": (Keys.Escape, Keys.ShiftHome), + # Control + arrows. + "\x1b[1;5A": (Keys.ControlUp,), # Cursor Mode + "\x1b[1;5B": (Keys.ControlDown,), # Cursor Mode + "\x1b[1;5C": (Keys.ControlRight,), # Cursor Mode + "\x1b[1;5D": (Keys.ControlLeft,), # Cursor Mode + "\x1b[1;5F": (Keys.ControlEnd,), + "\x1b[1;5H": (Keys.ControlHome,), + # Tmux sends following keystrokes when control+arrow is pressed, but for + # Emacs ansi-term sends the same sequences for normal arrow keys. Consider + # it a normal arrow press, because that's more important. + "\x1b[5A": (Keys.ControlUp,), + "\x1b[5B": (Keys.ControlDown,), + "\x1b[5C": (Keys.ControlRight,), + "\x1b[5D": (Keys.ControlLeft,), + "\x1bOc": (Keys.ControlRight,), # rxvt + "\x1bOd": (Keys.ControlLeft,), # rxvt + # Control + shift + arrows. + "\x1b[1;6A": (Keys.ControlShiftUp,), + "\x1b[1;6B": (Keys.ControlShiftDown,), + "\x1b[1;6C": (Keys.ControlShiftRight,), + "\x1b[1;6D": (Keys.ControlShiftLeft,), + "\x1b[1;6F": (Keys.ControlShiftEnd,), + "\x1b[1;6H": (Keys.ControlShiftHome,), + # Control + Meta + arrows. + "\x1b[1;7A": (Keys.Escape, Keys.ControlDown), + "\x1b[1;7B": (Keys.Escape, Keys.ControlUp), + "\x1b[1;7C": (Keys.Escape, Keys.ControlRight), + "\x1b[1;7D": (Keys.Escape, Keys.ControlLeft), + "\x1b[1;7F": (Keys.Escape, Keys.ControlEnd), + "\x1b[1;7H": (Keys.Escape, Keys.ControlHome), + # Meta + Shift + arrows. + "\x1b[1;8A": (Keys.Escape, Keys.ControlShiftDown), + "\x1b[1;8B": (Keys.Escape, Keys.ControlShiftUp), + "\x1b[1;8C": (Keys.Escape, Keys.ControlShiftRight), + "\x1b[1;8D": (Keys.Escape, Keys.ControlShiftLeft), + "\x1b[1;8F": (Keys.Escape, Keys.ControlShiftEnd), + "\x1b[1;8H": (Keys.Escape, Keys.ControlShiftHome), + # Meta + arrow on (some?) Macs when using iTerm defaults (see issue #483). + "\x1b[1;9A": (Keys.Escape, Keys.Up), + "\x1b[1;9B": (Keys.Escape, Keys.Down), + "\x1b[1;9C": (Keys.Escape, Keys.Right), + "\x1b[1;9D": (Keys.Escape, Keys.Left), + # -- + # Control/shift/meta + number in mintty. + # (c-2 will actually send c-@ and c-6 will send c-^.) + "\x1b[1;5p": (Keys.Control0,), + "\x1b[1;5q": (Keys.Control1,), + "\x1b[1;5r": (Keys.Control2,), + "\x1b[1;5s": (Keys.Control3,), + "\x1b[1;5t": (Keys.Control4,), + "\x1b[1;5u": (Keys.Control5,), + "\x1b[1;5v": (Keys.Control6,), + "\x1b[1;5w": (Keys.Control7,), + "\x1b[1;5x": (Keys.Control8,), + "\x1b[1;5y": (Keys.Control9,), + "\x1b[1;6p": (Keys.ControlShift0,), + "\x1b[1;6q": (Keys.ControlShift1,), + "\x1b[1;6r": (Keys.ControlShift2,), + "\x1b[1;6s": (Keys.ControlShift3,), + "\x1b[1;6t": (Keys.ControlShift4,), + "\x1b[1;6u": (Keys.ControlShift5,), + "\x1b[1;6v": (Keys.ControlShift6,), + "\x1b[1;6w": (Keys.ControlShift7,), + "\x1b[1;6x": (Keys.ControlShift8,), + "\x1b[1;6y": (Keys.ControlShift9,), + "\x1b[1;7p": (Keys.Escape, Keys.Control0), + "\x1b[1;7q": (Keys.Escape, Keys.Control1), + "\x1b[1;7r": (Keys.Escape, Keys.Control2), + "\x1b[1;7s": (Keys.Escape, Keys.Control3), + "\x1b[1;7t": (Keys.Escape, Keys.Control4), + "\x1b[1;7u": (Keys.Escape, Keys.Control5), + "\x1b[1;7v": (Keys.Escape, Keys.Control6), + "\x1b[1;7w": (Keys.Escape, Keys.Control7), + "\x1b[1;7x": (Keys.Escape, Keys.Control8), + "\x1b[1;7y": (Keys.Escape, Keys.Control9), + "\x1b[1;8p": (Keys.Escape, Keys.ControlShift0), + "\x1b[1;8q": (Keys.Escape, Keys.ControlShift1), + "\x1b[1;8r": (Keys.Escape, Keys.ControlShift2), + "\x1b[1;8s": (Keys.Escape, Keys.ControlShift3), + "\x1b[1;8t": (Keys.Escape, Keys.ControlShift4), + "\x1b[1;8u": (Keys.Escape, Keys.ControlShift5), + "\x1b[1;8v": (Keys.Escape, Keys.ControlShift6), + "\x1b[1;8w": (Keys.Escape, Keys.ControlShift7), + "\x1b[1;8x": (Keys.Escape, Keys.ControlShift8), + "\x1b[1;8y": (Keys.Escape, Keys.ControlShift9), +} + +# https://gist.github.com/christianparpart/d8a62cc1ab659194337d73e399004036 +SYNC_START = "\x1b[?2026h" +SYNC_END = "\x1b[?2026l" diff --git a/testbed/Textualize__textual/src/textual/_arrange.py b/testbed/Textualize__textual/src/textual/_arrange.py new file mode 100644 index 0000000000000000000000000000000000000000..4d4e489ee4323e5e2587086b9e676c3925018f6f --- /dev/null +++ b/testbed/Textualize__textual/src/textual/_arrange.py @@ -0,0 +1,130 @@ +from __future__ import annotations + +from collections import defaultdict +from fractions import Fraction +from operator import attrgetter +from typing import Sequence, TYPE_CHECKING + +from .geometry import Region, Size, Spacing +from ._layout import DockArrangeResult, WidgetPlacement +from ._partition import partition + + +if TYPE_CHECKING: + from .widget import Widget + +# TODO: This is a bit of a fudge, need to ensure it is impossible for layouts to generate this value +TOP_Z = 2**31 - 1 + + +def arrange( + widget: Widget, children: Sequence[Widget], size: Size, viewport: Size +) -> DockArrangeResult: + """Arrange widgets by applying docks and calling layouts + + Args: + widget (Widget): The parent (container) widget. + size (Size): The size of the available area. + viewport (Size): The size of the viewport (terminal). + + Returns: + tuple[list[WidgetPlacement], set[Widget], Spacing]: Widget arrangement information. + """ + + arrange_widgets: set[Widget] = set() + + dock_layers: defaultdict[str, list[Widget]] = defaultdict(list) + for child in children: + if child.display: + dock_layers[child.styles.layer or "default"].append(child) + + width, height = size + + placements: list[WidgetPlacement] = [] + add_placement = placements.append + region = size.region + + _WidgetPlacement = WidgetPlacement + top_z = TOP_Z + scroll_spacing = Spacing() + null_spacing = Spacing() + get_dock = attrgetter("styles.dock") + styles = widget.styles + + for widgets in dock_layers.values(): + + layout_widgets, dock_widgets = partition(get_dock, widgets) + + arrange_widgets.update(dock_widgets) + top = right = bottom = left = 0 + + for dock_widget in dock_widgets: + edge = dock_widget.styles.dock + + fraction_unit = Fraction( + size.height if edge in ("top", "bottom") else size.width + ) + box_model = dock_widget._get_box_model(size, viewport, fraction_unit) + widget_width_fraction, widget_height_fraction, margin = box_model + + widget_width = int(widget_width_fraction) + margin.width + widget_height = int(widget_height_fraction) + margin.height + + if edge == "bottom": + dock_region = Region( + 0, height - widget_height, widget_width, widget_height + ) + bottom = max(bottom, widget_height) + elif edge == "top": + dock_region = Region(0, 0, widget_width, widget_height) + top = max(top, widget_height) + elif edge == "left": + dock_region = Region(0, 0, widget_width, widget_height) + left = max(left, widget_width) + elif edge == "right": + dock_region = Region( + width - widget_width, 0, widget_width, widget_height + ) + right = max(right, widget_width) + else: + # Should not occur, mainly to keep Mypy happy + raise AssertionError("invalid value for edge") # pragma: no-cover + + align_offset = dock_widget.styles._align_size( + (widget_width, widget_height), size + ) + dock_region = dock_region.shrink(margin).translate(align_offset) + add_placement( + _WidgetPlacement(dock_region, null_spacing, dock_widget, top_z, True) + ) + + dock_spacing = Spacing(top, right, bottom, left) + region = region.shrink(dock_spacing) + layout_placements, arranged_layout_widgets = widget._layout.arrange( + widget, layout_widgets, region.size + ) + if arranged_layout_widgets: + scroll_spacing = scroll_spacing.grow_maximum(dock_spacing) + arrange_widgets.update(arranged_layout_widgets) + + placement_offset = region.offset + if styles.align_horizontal != "left" or styles.align_vertical != "top": + placement_size = Region.from_union( + [ + placement.region.grow(placement.margin) + for placement in layout_placements + ] + ).size + placement_offset += styles._align_size(placement_size, size) + + if placement_offset: + layout_placements = [ + _WidgetPlacement( + _region + placement_offset, margin, layout_widget, order, fixed + ) + for _region, margin, layout_widget, order, fixed in layout_placements + ] + + placements.extend(layout_placements) + + return placements, arrange_widgets, scroll_spacing diff --git a/testbed/Textualize__textual/src/textual/_border.py b/testbed/Textualize__textual/src/textual/_border.py new file mode 100644 index 0000000000000000000000000000000000000000..7294e4fc06d334d4e53acb9b2eb0b9f69c5e0d4a --- /dev/null +++ b/testbed/Textualize__textual/src/textual/_border.py @@ -0,0 +1,379 @@ +from __future__ import annotations + +import sys +from functools import lru_cache +from typing import cast, Tuple, Union + +from rich.console import Console, ConsoleOptions, RenderResult, RenderableType +import rich.repr +from rich.segment import Segment, SegmentLines +from rich.style import Style + +from .color import Color +from .css.types import EdgeStyle, EdgeType + +if sys.version_info >= (3, 10): + from typing import TypeAlias +else: # pragma: no cover + from typing_extensions import TypeAlias + +INNER = 1 +OUTER = 2 + +BORDER_CHARS: dict[EdgeType, tuple[str, str, str]] = { + # Each string of the tuple represents a sub-tuple itself: + # - 1st string represents (top1, top2, top3) + # - 2nd string represents (mid1, mid2, mid3) + # - 3rd string represents (bottom1, bottom2, bottom3) + "": (" ", " ", " "), + "ascii": ("+-+", "| |", "+-+"), + "none": (" ", " ", " "), + "hidden": (" ", " ", " "), + "blank": (" ", " ", " "), + "round": ("╭─╮", "│ │", "╰─╯"), + "solid": ("┌─┐", "│ │", "└─┘"), + "double": ("╔═╗", "║ ║", "╚═╝"), + "dashed": ("┏╍┓", "╏ ╏", "┗╍┛"), + "heavy": ("┏━┓", "┃ ┃", "┗━┛"), + "inner": ("▗▄▖", "▐ ▌", "▝▀▘"), + "outer": ("▛▀▜", "▌ ▐", "▙▄▟"), + "hkey": ("▔▔▔", " ", "▁▁▁"), + "vkey": ("▏ ▕", "▏ ▕", "▏ ▕"), + "tall": ("▊▔▎", "▊ ▎", "▊▁▎"), + "wide": ("▁▁▁", "▎ ▋", "▔▔▔"), +} + +# Some of the borders are on the widget background and some are on the background of the parent +# This table selects which for each character, 0 indicates the widget, 1 selects the parent +BORDER_LOCATIONS: dict[ + EdgeType, tuple[tuple[int, int, int], tuple[int, int, int], tuple[int, int, int]] +] = { + "": ((0, 0, 0), (0, 0, 0), (0, 0, 0)), + "ascii": ((0, 0, 0), (0, 0, 0), (0, 0, 0)), + "none": ((0, 0, 0), (0, 0, 0), (0, 0, 0)), + "hidden": ((0, 0, 0), (0, 0, 0), (0, 0, 0)), + "blank": ((0, 0, 0), (0, 0, 0), (0, 0, 0)), + "round": ((0, 0, 0), (0, 0, 0), (0, 0, 0)), + "solid": ((0, 0, 0), (0, 0, 0), (0, 0, 0)), + "double": ((0, 0, 0), (0, 0, 0), (0, 0, 0)), + "dashed": ((0, 0, 0), (0, 0, 0), (0, 0, 0)), + "heavy": ((0, 0, 0), (0, 0, 0), (0, 0, 0)), + "inner": ((1, 1, 1), (1, 1, 1), (1, 1, 1)), + "outer": ((0, 0, 0), (0, 0, 0), (0, 0, 0)), + "hkey": ((0, 0, 0), (0, 0, 0), (0, 0, 0)), + "vkey": ((0, 0, 0), (0, 0, 0), (0, 0, 0)), + "tall": ((2, 0, 1), (2, 0, 1), (2, 0, 1)), + "wide": ((1, 1, 1), (0, 1, 3), (1, 1, 1)), +} + +INVISIBLE_EDGE_TYPES = cast("frozenset[EdgeType]", frozenset(("", "none", "hidden"))) + +BorderValue: TypeAlias = Tuple[EdgeType, Union[str, Color, Style]] + +BoxSegments: TypeAlias = Tuple[ + Tuple[Segment, Segment, Segment], + Tuple[Segment, Segment, Segment], + Tuple[Segment, Segment, Segment], +] + +Borders: TypeAlias = Tuple[EdgeStyle, EdgeStyle, EdgeStyle, EdgeStyle] + + +@lru_cache(maxsize=1024) +def get_box( + name: EdgeType, + inner_style: Style, + outer_style: Style, + style: Style, +) -> BoxSegments: + """Get segments used to render a box. + + Args: + name (str): Name of the box type. + inner_style (Style): The inner style (widget background) + outer_style (Style): The outer style (parent background) + style (Style): Widget style + + Returns: + tuple: A tuple of 3 Segment triplets. + """ + _Segment = Segment + ( + (top1, top2, top3), + (mid1, mid2, mid3), + (bottom1, bottom2, bottom3), + ) = BORDER_CHARS[name] + + ( + (ltop1, ltop2, ltop3), + (lmid1, lmid2, lmid3), + (lbottom1, lbottom2, lbottom3), + ) = BORDER_LOCATIONS[name] + + inner = inner_style + style + outer = outer_style + style + styles = ( + inner, + outer, + Style.from_color(outer.bgcolor, inner.color), + Style.from_color(inner.bgcolor, outer.color), + ) + + return ( + ( + _Segment(top1, styles[ltop1]), + _Segment(top2, styles[ltop2]), + _Segment(top3, styles[ltop3]), + ), + ( + _Segment(mid1, styles[lmid1]), + _Segment(mid2, styles[lmid2]), + _Segment(mid3, styles[lmid3]), + ), + ( + _Segment(bottom1, styles[lbottom1]), + _Segment(bottom2, styles[lbottom2]), + _Segment(bottom3, styles[lbottom3]), + ), + ) + + +def render_row( + box_row: tuple[Segment, Segment, Segment], width: int, left: bool, right: bool +) -> list[Segment]: + """Render a top, or bottom border row. + + Args: + box_row (tuple[Segment, Segment, Segment]): Corners and side segments. + width (int): Total width of resulting line. + left (bool): Render left corner. + right (bool): Render right corner. + + Returns: + list[Segment]: A list of segments. + """ + box1, box2, box3 = box_row + if left and right: + return [box1, Segment(box2.text * (width - 2), box2.style), box3] + if left: + return [box1, Segment(box2.text * (width - 1), box2.style)] + if right: + return [Segment(box2.text * (width - 1), box2.style), box3] + else: + return [Segment(box2.text * width, box2.style)] + + +@rich.repr.auto +class Border: + """Renders Textual CSS borders. + + This is analogous to Rich's `Box` but more flexible. Different borders may be + applied to each of the four edges, and more advanced borders can be achieved through + various combinations of Widget and parent background colors. + + """ + + def __init__( + self, + renderable: RenderableType, + borders: Borders, + inner_color: Color, + outer_color: Color, + outline: bool = False, + ): + self.renderable = renderable + self.edge_styles = borders + self.outline = outline + + ( + (top, top_color), + (right, right_color), + (bottom, bottom_color), + (left, left_color), + ) = borders + self._sides: tuple[EdgeType, EdgeType, EdgeType, EdgeType] + self._sides = (top, right, bottom, left) + from_color = Style.from_color + + self._styles = ( + from_color(top_color.rich_color), + from_color(right_color.rich_color), + from_color(bottom_color.rich_color), + from_color(left_color.rich_color), + ) + self.inner_style = from_color(bgcolor=inner_color.rich_color) + self.outer_style = from_color(bgcolor=outer_color.rich_color) + + def __rich_repr__(self) -> rich.repr.Result: + yield self.renderable + yield self.edge_styles + + def _crop_renderable(self, lines: list[list[Segment]], width: int) -> None: + """Crops a renderable in place. + + Args: + lines (list[list[Segment]]): Segment lines. + width (int): Desired width. + """ + top, right, bottom, left = self._sides + # the 4 following lines rely on the fact that we normalise "none" and "hidden" to en empty string + has_left = bool(left) + has_right = bool(right) + has_top = bool(top) + has_bottom = bool(bottom) + + if has_top: + lines.pop(0) + if has_bottom and lines: + lines.pop(-1) + + # TODO: Divide is probably quite inefficient here, + # It could be much faster for the specific case of one off the start end end + divide = Segment.divide + if has_left and has_right: + for line in lines: + _, line[:] = divide(line, [1, width - 1]) + elif has_left: + for line in lines: + _, line[:] = divide(line, [1, width]) + elif has_right: + for line in lines: + line[:], _ = divide(line, [width - 1, width]) + + def __rich_console__( + self, console: "Console", options: "ConsoleOptions" + ) -> "RenderResult": + top, right, bottom, left = self._sides + style = console.get_style(self.inner_style) + outer_style = console.get_style(self.outer_style) + top_style, right_style, bottom_style, left_style = self._styles + + # ditto than in `_crop_renderable` ☝ + has_left = bool(left) + has_right = bool(right) + has_top = bool(top) + has_bottom = bool(bottom) + + width = options.max_width - has_left - has_right + + if width <= 2: + lines = console.render_lines(self.renderable, options, new_lines=True) + yield SegmentLines(lines) + return + + if self.outline: + render_options = options + else: + if options.height is None: + render_options = options.update_width(width) + else: + new_height = options.height - has_top - has_bottom + if new_height >= 1: + render_options = options.update_dimensions(width, new_height) + else: + render_options = options.update_width(width) + + lines = console.render_lines(self.renderable, render_options) + if self.outline: + self._crop_renderable(lines, options.max_width) + + _Segment = Segment + new_line = _Segment.line() + if has_top: + box1, box2, box3 = get_box(top, style, outer_style, top_style)[0] + if has_left: + yield box1 if top == left else _Segment(" ", box2.style) + yield _Segment(box2.text * width, box2.style) + if has_right: + yield box3 if top == left else _Segment(" ", box3.style) + yield new_line + + left_segment = get_box(left, style, outer_style, left_style)[1][0] + _right_segment = get_box(right, style, outer_style, right_style)[1][2] + right_segment = _Segment(_right_segment.text + "\n", _right_segment.style) + + if has_left and has_right: + for line in lines: + yield left_segment + yield from line + yield right_segment + elif has_left: + for line in lines: + yield left_segment + yield from line + yield new_line + elif has_right: + for line in lines: + yield from line + yield right_segment + else: + for line in lines: + yield from line + yield new_line + + if has_bottom: + box1, box2, box3 = get_box(bottom, style, outer_style, bottom_style)[2] + if has_left: + yield box1 if bottom == left else _Segment(" ", box1.style) + yield _Segment(box2.text * width, box2.style) + if has_right: + yield box3 if bottom == right else _Segment(" ", box3.style) + yield new_line + + +_edge_type_normalization_table: dict[EdgeType, EdgeType] = { + # i.e. we normalize "border: none;" to "border: ;". + # As a result our layout-related calculations that include borders are simpler (and have better performance) + "none": "", + "hidden": "", +} + + +def normalize_border_value(value: BorderValue) -> BorderValue: + return _edge_type_normalization_table.get(value[0], value[0]), value[1] + + +if __name__ == "__main__": + from rich import print + from rich.text import Text + from rich.padding import Padding + + from .color import Color + + inner = Color.parse("#303F9F") + outer = Color.parse("#212121") + + lorem = """[#C5CAE9]Lorem ipsum dolor sit amet, consectetur adipiscing elit. In velit libero, volutpat nec hendrerit at, faucibus in odio. Aliquam hendrerit nibh sed quam volutpat maximus. Nullam suscipit convallis lorem quis sodales. In tristique lobortis ante et dictum. Ut at finibus ipsum. In urna dolor, placerat et mi facilisis, congue sollicitudin massa. Phasellus felis turpis, cursus eu lectus et, porttitor malesuada augue. Sed feugiat volutpat velit, sollicitudin fringilla velit bibendum faucibus.""" + text = Text.from_markup(lorem) + border = Border( + Padding(text, 1, style="on #303F9F"), + ( + ("none", Color.parse("#C5CAE9")), + ("none", Color.parse("#C5CAE9")), + ("wide", Color.parse("#C5CAE9")), + ("none", Color.parse("#C5CAE9")), + ), + inner_color=inner, + outer_color=outer, + ) + + print( + Padding(border, (1, 2), style="on #212121"), + ) + print() + + border = Border( + Padding(text, 1, style="on #303F9F"), + ( + ("hkey", Color.parse("#8BC34A")), + ("hkey", Color.parse("#8BC34A")), + ("hkey", Color.parse("#8BC34A")), + ("hkey", Color.parse("#8BC34A")), + ), + inner_color=inner, + outer_color=outer, + ) + + print( + Padding(border, (1, 2), style="on #212121"), + ) diff --git a/testbed/Textualize__textual/src/textual/_cache.py b/testbed/Textualize__textual/src/textual/_cache.py new file mode 100644 index 0000000000000000000000000000000000000000..2f9bdd49d71eae7b43980b6204b15459a91983a0 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/_cache.py @@ -0,0 +1,156 @@ +""" + +A LRU (Least Recently Used) Cache container. + +Use when you want to cache slow operations and new keys are a good predictor +of subsequent keys. + +Note that stdlib's @lru_cache is implemented in C and faster! It's best to use +@lru_cache where you are caching things that are fairly quick and called many times. +Use LRUCache where you want increased flexibility and you are caching slow operations +where the overhead of the cache is a small fraction of the total processing time. + +""" + +from __future__ import annotations + +from threading import Lock +from typing import Dict, Generic, KeysView, TypeVar, overload + +CacheKey = TypeVar("CacheKey") +CacheValue = TypeVar("CacheValue") +DefaultValue = TypeVar("DefaultValue") + + +class LRUCache(Generic[CacheKey, CacheValue]): + """ + A dictionary-like container with a maximum size. + + If an additional item is added when the LRUCache is full, the least + recently used key is discarded to make room for the new item. + + The implementation is similar to functools.lru_cache, which uses a (doubly) + linked list to keep track of the most recently used items. + + Each entry is stored as [PREV, NEXT, KEY, VALUE] where PREV is a reference + to the previous entry, and NEXT is a reference to the next value. + + """ + + def __init__(self, maxsize: int) -> None: + self._maxsize = maxsize + self._cache: Dict[CacheKey, list[object]] = {} + self._full = False + self._head: list[object] = [] + self._lock = Lock() + super().__init__() + + @property + def maxsize(self) -> int: + return self._maxsize + + @maxsize.setter + def maxsize(self, maxsize: int) -> None: + self._maxsize = maxsize + + def __bool__(self) -> bool: + return bool(self._cache) + + def __len__(self) -> int: + return len(self._cache) + + def clear(self) -> None: + """Clear the cache.""" + with self._lock: + self._cache.clear() + self._full = False + self._head = [] + + def keys(self) -> KeysView[CacheKey]: + """Get cache keys.""" + # Mostly for tests + return self._cache.keys() + + def set(self, key: CacheKey, value: CacheValue) -> None: + """Set a value. + + Args: + key (CacheKey): Key. + value (CacheValue): Value. + """ + with self._lock: + link = self._cache.get(key) + if link is None: + head = self._head + if not head: + # First link references itself + self._head[:] = [head, head, key, value] + else: + # Add a new root to the beginning + self._head = [head[0], head, key, value] + # Updated references on previous root + head[0][1] = self._head # type: ignore[index] + head[0] = self._head + self._cache[key] = self._head + + if self._full or len(self._cache) > self._maxsize: + # Cache is full, we need to evict the oldest one + self._full = True + head = self._head + last = head[0] + last[0][1] = head # type: ignore[index] + head[0] = last[0] # type: ignore[index] + del self._cache[last[2]] # type: ignore[index] + + __setitem__ = set + + @overload + def get(self, key: CacheKey) -> CacheValue | None: + ... + + @overload + def get(self, key: CacheKey, default: DefaultValue) -> CacheValue | DefaultValue: + ... + + def get( + self, key: CacheKey, default: DefaultValue | None = None + ) -> CacheValue | DefaultValue | None: + """Get a value from the cache, or return a default if the key is not present. + + Args: + key (CacheKey): Key + default (Optional[DefaultValue], optional): Default to return if key is not present. Defaults to None. + + Returns: + Union[CacheValue, Optional[DefaultValue]]: Either the value or a default. + """ + link = self._cache.get(key) + if link is None: + return default + with self._lock: + if link is not self._head: + # Remove link from list + link[0][1] = link[1] # type: ignore[index] + link[1][0] = link[0] # type: ignore[index] + head = self._head + # Move link to head of list + link[0] = head[0] + link[1] = head + self._head = head[0][1] = head[0] = link # type: ignore[index] + + return link[3] # type: ignore[return-value] + + def __getitem__(self, key: CacheKey) -> CacheValue: + link = self._cache[key] + with self._lock: + if link is not self._head: + link[0][1] = link[1] # type: ignore[index] + link[1][0] = link[0] # type: ignore[index] + head = self._head + link[0] = head[0] + link[1] = head + self._head = head[0][1] = head[0] = link # type: ignore[index] + return link[3] # type: ignore[return-value] + + def __contains__(self, key: CacheKey) -> bool: + return key in self._cache diff --git a/testbed/Textualize__textual/src/textual/_callback.py b/testbed/Textualize__textual/src/textual/_callback.py new file mode 100644 index 0000000000000000000000000000000000000000..0d52effabf45b8d2139bd7529474fc2d010b6cd1 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/_callback.py @@ -0,0 +1,29 @@ +from __future__ import annotations + +from functools import lru_cache + +from inspect import signature, isawaitable +from typing import Any, Callable + + +@lru_cache(maxsize=2048) +def count_parameters(func: Callable) -> int: + """Count the number of parameters in a callable""" + return len(signature(func).parameters) + + +async def invoke(callback: Callable, *params: object) -> Any: + """Invoke a callback with an arbitrary number of parameters. + + Args: + callback (Callable): [description] + + Returns: + Any: [description] + """ + _rich_traceback_guard = True + parameter_count = count_parameters(callback) + result = callback(*params[:parameter_count]) + if isawaitable(result): + result = await result + return result diff --git a/testbed/Textualize__textual/src/textual/_cells.py b/testbed/Textualize__textual/src/textual/_cells.py new file mode 100644 index 0000000000000000000000000000000000000000..2b838b93cdf25fdcde153bbc19855af1c6045973 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/_cells.py @@ -0,0 +1,6 @@ +__all__ = ["cell_len"] + +try: + from rich.cells import cached_cell_len as cell_len +except ImportError: + from rich.cells import cell_len diff --git a/testbed/Textualize__textual/src/textual/_clock.py b/testbed/Textualize__textual/src/textual/_clock.py new file mode 100644 index 0000000000000000000000000000000000000000..4e1ac22245b50667e20c591a7033f3b78cc89fb4 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/_clock.py @@ -0,0 +1,58 @@ +import asyncio +from time import monotonic + + +""" +A module that serves as the single source of truth for everything time-related in a Textual app. +Having this logic centralised makes it easier to simulate time in integration tests, +by mocking the few functions exposed by this module. +""" + + +# N.B. This class and its singleton instance have to be hidden APIs because we want to be able to mock time, +# even for Python modules that imported functions such as `get_time` *before* we mocked this internal _Clock. +# (so mocking public APIs such as `get_time` wouldn't affect direct references to then that were done during imports) +class _Clock: + async def get_time(self) -> float: + return self.get_time_no_wait() + + def get_time_no_wait(self) -> float: + return monotonic() + + async def sleep(self, seconds: float) -> None: + await asyncio.sleep(seconds) + + +# That's our target for mocking time! :-) +_clock = _Clock() + + +def get_time_no_wait() -> float: + """ + Get the current wall clock time. + + Returns: + float: the value (in fractional seconds) of a monotonic clock, i.e. a clock that cannot go backwards. + """ + return _clock.get_time_no_wait() + + +async def get_time() -> float: + """ + Asynchronous version of `get_time`. Useful in situations where we want asyncio to be + able to "do things" elsewhere right before we fetch the time. + + Returns: + float: the value (in fractional seconds) of a monotonic clock, i.e. a clock that cannot go backwards. + """ + return await _clock.get_time() + + +async def sleep(seconds: float) -> None: + """ + Coroutine that completes after a given time (in seconds). + + Args: + seconds (float): the duration we should wait for before unblocking the awaiter + """ + return await _clock.sleep(seconds) diff --git a/testbed/Textualize__textual/src/textual/_color_constants.py b/testbed/Textualize__textual/src/textual/_color_constants.py new file mode 100644 index 0000000000000000000000000000000000000000..cedab56736b110dcda2d76328fc3aad6ddeb4397 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/_color_constants.py @@ -0,0 +1,172 @@ +from __future__ import annotations + +COLOR_NAME_TO_RGB: dict[str, tuple[int, int, int] | tuple[int, int, int, float]] = { + # Let's start with a specific pseudo-color:: + "transparent": (0, 0, 0, 0), + # Then, the 16 common ANSI colors: + "ansi_black": (0, 0, 0), + "ansi_red": (128, 0, 0), + "ansi_green": (0, 128, 0), + "ansi_yellow": (128, 128, 0), + "ansi_blue": (0, 0, 128), + "ansi_magenta": (128, 0, 128), + "ansi_cyan": (0, 128, 128), + "ansi_white": (192, 192, 192), + "ansi_bright_black": (128, 128, 128), + "ansi_bright_red": (255, 0, 0), + "ansi_bright_green": (0, 255, 0), + "ansi_bright_yellow": (255, 255, 0), + "ansi_bright_blue": (0, 0, 255), + "ansi_bright_magenta": (255, 0, 255), + "ansi_bright_cyan": (0, 255, 255), + "ansi_bright_white": (255, 255, 255), + # And then, Web color keywords: (up to CSS Color Module Level 4) + "black": (0, 0, 0), + "silver": (192, 192, 192), + "gray": (128, 128, 128), + "white": (255, 255, 255), + "maroon": (128, 0, 0), + "red": (255, 0, 0), + "purple": (128, 0, 128), + "fuchsia": (255, 0, 255), + "green": (0, 128, 0), + "lime": (0, 255, 0), + "olive": (128, 128, 0), + "yellow": (255, 255, 0), + "navy": (0, 0, 128), + "blue": (0, 0, 255), + "teal": (0, 128, 128), + "aqua": (0, 255, 255), + "orange": (255, 165, 0), + "aliceblue": (240, 248, 255), + "antiquewhite": (250, 235, 215), + "aquamarine": (127, 255, 212), + "azure": (240, 255, 255), + "beige": (245, 245, 220), + "bisque": (255, 228, 196), + "blanchedalmond": (255, 235, 205), + "blueviolet": (138, 43, 226), + "brown": (165, 42, 42), + "burlywood": (222, 184, 135), + "cadetblue": (95, 158, 160), + "chartreuse": (127, 255, 0), + "chocolate": (210, 105, 30), + "coral": (255, 127, 80), + "cornflowerblue": (100, 149, 237), + "cornsilk": (255, 248, 220), + "crimson": (220, 20, 60), + "cyan": (0, 255, 255), + "darkblue": (0, 0, 139), + "darkcyan": (0, 139, 139), + "darkgoldenrod": (184, 134, 11), + "darkgray": (169, 169, 169), + "darkgreen": (0, 100, 0), + "darkgrey": (169, 169, 169), + "darkkhaki": (189, 183, 107), + "darkmagenta": (139, 0, 139), + "darkolivegreen": (85, 107, 47), + "darkorange": (255, 140, 0), + "darkorchid": (153, 50, 204), + "darkred": (139, 0, 0), + "darksalmon": (233, 150, 122), + "darkseagreen": (143, 188, 143), + "darkslateblue": (72, 61, 139), + "darkslategray": (47, 79, 79), + "darkslategrey": (47, 79, 79), + "darkturquoise": (0, 206, 209), + "darkviolet": (148, 0, 211), + "deeppink": (255, 20, 147), + "deepskyblue": (0, 191, 255), + "dimgray": (105, 105, 105), + "dimgrey": (105, 105, 105), + "dodgerblue": (30, 144, 255), + "firebrick": (178, 34, 34), + "floralwhite": (255, 250, 240), + "forestgreen": (34, 139, 34), + "gainsboro": (220, 220, 220), + "ghostwhite": (248, 248, 255), + "gold": (255, 215, 0), + "goldenrod": (218, 165, 32), + "greenyellow": (173, 255, 47), + "grey": (128, 128, 128), + "honeydew": (240, 255, 240), + "hotpink": (255, 105, 180), + "indianred": (205, 92, 92), + "indigo": (75, 0, 130), + "ivory": (255, 255, 240), + "khaki": (240, 230, 140), + "lavender": (230, 230, 250), + "lavenderblush": (255, 240, 245), + "lawngreen": (124, 252, 0), + "lemonchiffon": (255, 250, 205), + "lightblue": (173, 216, 230), + "lightcoral": (240, 128, 128), + "lightcyan": (224, 255, 255), + "lightgoldenrodyellow": (250, 250, 210), + "lightgray": (211, 211, 211), + "lightgreen": (144, 238, 144), + "lightgrey": (211, 211, 211), + "lightpink": (255, 182, 193), + "lightsalmon": (255, 160, 122), + "lightseagreen": (32, 178, 170), + "lightskyblue": (135, 206, 250), + "lightslategray": (119, 136, 153), + "lightslategrey": (119, 136, 153), + "lightsteelblue": (176, 196, 222), + "lightyellow": (255, 255, 224), + "limegreen": (50, 205, 50), + "linen": (250, 240, 230), + "magenta": (255, 0, 255), + "mediumaquamarine": (102, 205, 170), + "mediumblue": (0, 0, 205), + "mediumorchid": (186, 85, 211), + "mediumpurple": (147, 112, 219), + "mediumseagreen": (60, 179, 113), + "mediumslateblue": (123, 104, 238), + "mediumspringgreen": (0, 250, 154), + "mediumturquoise": (72, 209, 204), + "mediumvioletred": (199, 21, 133), + "midnightblue": (25, 25, 112), + "mintcream": (245, 255, 250), + "mistyrose": (255, 228, 225), + "moccasin": (255, 228, 181), + "navajowhite": (255, 222, 173), + "oldlace": (253, 245, 230), + "olivedrab": (107, 142, 35), + "orangered": (255, 69, 0), + "orchid": (218, 112, 214), + "palegoldenrod": (238, 232, 170), + "palegreen": (152, 251, 152), + "paleturquoise": (175, 238, 238), + "palevioletred": (219, 112, 147), + "papayawhip": (255, 239, 213), + "peachpuff": (255, 218, 185), + "peru": (205, 133, 63), + "pink": (255, 192, 203), + "plum": (221, 160, 221), + "powderblue": (176, 224, 230), + "rosybrown": (188, 143, 143), + "royalblue": (65, 105, 225), + "saddlebrown": (139, 69, 19), + "salmon": (250, 128, 114), + "sandybrown": (244, 164, 96), + "seagreen": (46, 139, 87), + "seashell": (255, 245, 238), + "sienna": (160, 82, 45), + "skyblue": (135, 206, 235), + "slateblue": (106, 90, 205), + "slategray": (112, 128, 144), + "slategrey": (112, 128, 144), + "snow": (255, 250, 250), + "springgreen": (0, 255, 127), + "steelblue": (70, 130, 180), + "tan": (210, 180, 140), + "thistle": (216, 191, 216), + "tomato": (255, 99, 71), + "turquoise": (64, 224, 208), + "violet": (238, 130, 238), + "wheat": (245, 222, 179), + "whitesmoke": (245, 245, 245), + "yellowgreen": (154, 205, 50), + "rebeccapurple": (102, 51, 153), +} diff --git a/testbed/Textualize__textual/src/textual/_compositor.py b/testbed/Textualize__textual/src/textual/_compositor.py new file mode 100644 index 0000000000000000000000000000000000000000..2efdb0744e168ff1916aaee2bde13edae41b9052 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/_compositor.py @@ -0,0 +1,809 @@ +""" + +The compositor handles combining widgets in to a single screen (i.e. compositing). + +It also stores the results of that process, so that Textual knows the widgets on +the screen and their locations. The compositor uses this information to answer +queries regarding the widget under an offset, or the style under an offset. + +Additionally, the compositor can render portions of the screen which may have updated, +without having to render the entire screen. + +""" + +from __future__ import annotations + +import sys +from itertools import chain +from operator import itemgetter +from typing import TYPE_CHECKING, Callable, Iterable, NamedTuple, cast + +import rich.repr +from rich.console import Console, ConsoleOptions, RenderableType, RenderResult +from rich.control import Control +from rich.segment import Segment +from rich.style import Style + +from . import errors +from ._cells import cell_len +from ._loop import loop_last +from ._profile import timer +from ._types import Lines +from .geometry import Offset, Region, Size + +if sys.version_info >= (3, 10): + from typing import TypeAlias +else: # pragma: no cover + from typing_extensions import TypeAlias + + +if TYPE_CHECKING: + from .widget import Widget + + +class ReflowResult(NamedTuple): + """The result of a reflow operation. Describes the chances to widgets.""" + + hidden: set[Widget] # Widgets that are hidden + shown: set[Widget] # Widgets that are shown + resized: set[Widget] # Widgets that have been resized + + +class MapGeometry(NamedTuple): + """Defines the absolute location of a Widget.""" + + region: Region # The (screen) region occupied by the widget + order: tuple[tuple[int, ...], ...] # A tuple of ints defining the painting order + clip: Region # A region to clip the widget by (if a Widget is within a container) + virtual_size: Size # The virtual size (scrollable region) of a widget if it is a container + container_size: Size # The container size (area not occupied by scrollbars) + virtual_region: Region # The region relative to the container (but not necessarily visible) + + @property + def visible_region(self) -> Region: + """The Widget region after clipping.""" + return self.clip.intersection(self.region) + + +# Maps a widget on to its geometry (information that describes its position in the composition) +CompositorMap: TypeAlias = "dict[Widget, MapGeometry]" + + +@rich.repr.auto(angular=True) +class LayoutUpdate: + """A renderable containing the result of a render for a given region.""" + + def __init__(self, lines: Lines, region: Region) -> None: + self.lines = lines + self.region = region + + def __rich_console__( + self, console: Console, options: ConsoleOptions + ) -> RenderResult: + x = self.region.x + new_line = Segment.line() + move_to = Control.move_to + for last, (y, line) in loop_last(enumerate(self.lines, self.region.y)): + yield move_to(x, y) + yield from line + if not last: + yield new_line + + def __rich_repr__(self) -> rich.repr.Result: + yield self.region + + +@rich.repr.auto(angular=True) +class ChopsUpdate: + """A renderable that applies updated spans to the screen.""" + + def __init__( + self, + chops: list[dict[int, list[Segment] | None]], + spans: list[tuple[int, int, int]], + chop_ends: list[list[int]], + ) -> None: + """A renderable which updates chops (fragments of lines). + + Args: + chops (list[dict[int, list[Segment] | None]]): A mapping of offsets to list of segments, per line. + crop (Region): Region to restrict update to. + chop_ends (list[list[int]]): A list of the end offsets for each line + """ + self.chops = chops + self.spans = spans + self.chop_ends = chop_ends + + def __rich_console__( + self, console: Console, options: ConsoleOptions + ) -> RenderResult: + move_to = Control.move_to + new_line = Segment.line() + chops = self.chops + chop_ends = self.chop_ends + last_y = self.spans[-1][0] + + _cell_len = cell_len + + for y, x1, x2 in self.spans: + line = chops[y] + ends = chop_ends[y] + for end, (x, segments) in zip(ends, line.items()): + # TODO: crop to x extents + if segments is None: + continue + + if x > x2 or end <= x1: + continue + + if x2 > x >= x1 and end <= x2: + yield move_to(x, y) + yield from segments + continue + + iter_segments = iter(segments) + if x < x1: + for segment in iter_segments: + next_x = x + _cell_len(segment.text) + if next_x > x1: + yield move_to(x, y) + yield segment + break + x = next_x + else: + yield move_to(x, y) + if end <= x2: + yield from iter_segments + else: + for segment in iter_segments: + if x >= x2: + break + yield segment + x += _cell_len(segment.text) + + if y != last_y: + yield new_line + + def __rich_repr__(self) -> rich.repr.Result: + return + yield + + +@rich.repr.auto(angular=True) +class Compositor: + """Responsible for storing information regarding the relative positions of Widgets and rendering them.""" + + def __init__(self) -> None: + # A mapping of Widget on to its "render location" (absolute position / depth) + self.map: CompositorMap = {} + self._layers: list[tuple[Widget, MapGeometry]] | None = None + + # All widgets considered in the arrangement + # Note this may be a superset of self.map.keys() as some widgets may be invisible for various reasons + self.widgets: set[Widget] = set() + + # Mapping of visible widgets on to their region, and clip region + self._visible_widgets: dict[Widget, tuple[Region, Region]] | None = None + + # The top level widget + self.root: Widget | None = None + + # Dimensions of the arrangement + self.size = Size(0, 0) + + # The points in each line where the line bisects the left and right edges of the widget + self._cuts: list[list[int]] | None = None + + # Regions that require an update + self._dirty_regions: set[Region] = set() + + # Mapping of line numbers on to lists of widget and regions + self._layers_visible: list[list[tuple[Widget, Region, Region]]] | None = None + + @classmethod + def _regions_to_spans( + cls, regions: Iterable[Region] + ) -> Iterable[tuple[int, int, int]]: + """Converts the regions to horizontal spans. Spans will be combined if they overlap + or are contiguous to produce optimal non-overlapping spans. + + Args: + regions (Iterable[Region]): An iterable of Regions. + + Returns: + Iterable[tuple[int, int, int]]: Yields tuples of (Y, X1, X2) + """ + inline_ranges: dict[int, list[tuple[int, int]]] = {} + setdefault = inline_ranges.setdefault + for region_x, region_y, width, height in regions: + span = (region_x, region_x + width) + for y in range(region_y, region_y + height): + setdefault(y, []).append(span) + + slice_remaining = slice(1, None) + for y, ranges in sorted(inline_ranges.items()): + if len(ranges) == 1: + # Special case of 1 span + yield (y, *ranges[0]) + else: + ranges.sort() + x1, x2 = ranges[0] + for next_x1, next_x2 in ranges[slice_remaining]: + if next_x1 <= x2: + if next_x2 > x2: + x2 = next_x2 + else: + yield (y, x1, x2) + x1 = next_x1 + x2 = next_x2 + yield (y, x1, x2) + + def __rich_repr__(self) -> rich.repr.Result: + yield "size", self.size + yield "widgets", self.widgets + + def reflow(self, parent: Widget, size: Size) -> ReflowResult: + """Reflow (layout) widget and its children. + + Args: + parent (Widget): The root widget. + size (Size): Size of the area to be filled. + + Returns: + ReflowResult: Hidden shown and resized widgets + """ + self._cuts = None + self._layers = None + self._layers_visible = None + self._visible_widgets = None + self.root = parent + self.size = size + + # Keep a copy of the old map because we're going to compare it with the update + old_map = self.map.copy() + old_widgets = old_map.keys() + map, widgets = self._arrange_root(parent, size) + + new_widgets = map.keys() + + # Newly visible widgets + shown_widgets = new_widgets - old_widgets + # Newly hidden widgets + hidden_widgets = old_widgets - new_widgets + + # Replace map and widgets + self.map = map + self.widgets = widgets + + screen = size.region + + # Widgets with changed size + resized_widgets = { + widget + for widget, (region, *_) in map.items() + if widget in old_widgets and old_map[widget].region.size != region.size + } + + # Gets pairs of tuples of (Widget, MapGeometry) which have changed + # i.e. if something is moved / deleted / added + + if screen not in self._dirty_regions: + crop_screen = screen.intersection + changes = map.items() ^ old_map.items() + regions = { + region + for region in ( + crop_screen(map_geometry.visible_region) + for _, map_geometry in changes + ) + if region + } + self._dirty_regions.update(regions) + + return ReflowResult( + hidden=hidden_widgets, + shown=shown_widgets, + resized=resized_widgets, + ) + + @property + def visible_widgets(self) -> dict[Widget, tuple[Region, Region]]: + """Get a mapping of widgets on to region and clip. + + Returns: + dict[Widget, tuple[Region, Region]]: visible widget mapping. + """ + if self._visible_widgets is None: + screen = self.size.region + in_screen = screen.overlaps + overlaps = Region.overlaps + + # Widgets and regions in render order + visible_widgets = [ + (order, widget, region, clip) + for widget, (region, order, clip, _, _, _) in self.map.items() + if in_screen(region) and overlaps(clip, region) + ] + visible_widgets.sort(key=itemgetter(0), reverse=True) + self._visible_widgets = { + widget: (region, clip) for _, widget, region, clip in visible_widgets + } + return self._visible_widgets + + def _arrange_root( + self, root: Widget, size: Size + ) -> tuple[CompositorMap, set[Widget]]: + """Arrange a widgets children based on its layout attribute. + + Args: + root (Widget): Top level widget. + + Returns: + tuple[CompositorMap, set[Widget]]: Compositor map and set of widgets. + """ + + ORIGIN = Offset(0, 0) + + map: CompositorMap = {} + widgets: set[Widget] = set() + layer_order: int = 0 + + def add_widget( + widget: Widget, + virtual_region: Region, + region: Region, + order: tuple[tuple[int, ...], ...], + layer_order: int, + clip: Region, + ) -> None: + """Called recursively to place a widget and its children in the map. + + Args: + widget (Widget): The widget to add. + region (Region): The region the widget will occupy. + order (tuple[int, ...]): A tuple of ints to define the order. + clip (Region): The clipping region (i.e. the viewport which contains it). + """ + widgets.add(widget) + styles_offset = widget.styles.offset + layout_offset = ( + styles_offset.resolve(region.size, clip.size) + if styles_offset + else ORIGIN + ) + + # Container region is minus border + container_region = region.shrink(widget.styles.gutter) + container_size = container_region.size + + # Widgets with scrollbars (containers or scroll view) require additional processing + if widget.is_scrollable: + # The region that contains the content (container region minus scrollbars) + child_region = widget._get_scrollable_region(container_region) + + # Adjust the clip region accordingly + sub_clip = clip.intersection(child_region) + + # The region covered by children relative to parent widget + total_region = child_region.reset_offset + + if widget.is_container: + # Arrange the layout + placements, arranged_widgets, spacing = widget._arrange( + child_region.size + ) + widgets.update(arranged_widgets) + + # An offset added to all placements + placement_offset = container_region.offset + layout_offset + placement_scroll_offset = placement_offset - widget.scroll_offset + + _layers = widget.layers + layers_to_index = { + layer_name: index for index, layer_name in enumerate(_layers) + } + get_layer_index = layers_to_index.get + + # Add all the widgets + for sub_region, margin, sub_widget, z, fixed in reversed( + placements + ): + # Combine regions with children to calculate the "virtual size" + if fixed: + widget_region = sub_region + placement_offset + else: + total_region = total_region.union( + sub_region.grow(spacing + margin) + ) + widget_region = sub_region + placement_scroll_offset + + widget_order = order + ( + (get_layer_index(sub_widget.layer, 0), z, layer_order), + ) + + add_widget( + sub_widget, + sub_region, + widget_region, + widget_order, + layer_order, + sub_clip, + ) + layer_order -= 1 + + # Add any scrollbars + for chrome_widget, chrome_region in widget._arrange_scrollbars( + container_region + ): + map[chrome_widget] = MapGeometry( + chrome_region + layout_offset, + order, + clip, + container_size, + container_size, + chrome_region, + ) + + map[widget] = MapGeometry( + region + layout_offset, + order, + clip, + total_region.size, + container_size, + virtual_region, + ) + + else: + # Add the widget to the map + map[widget] = MapGeometry( + region + layout_offset, + order, + clip, + region.size, + container_size, + virtual_region, + ) + + # Add top level (root) widget + add_widget(root, size.region, size.region, ((0,),), layer_order, size.region) + return map, widgets + + @property + def layers(self) -> list[tuple[Widget, MapGeometry]]: + """Get widgets and geometry in layer order.""" + if self._layers is None: + self._layers = sorted( + self.map.items(), key=lambda item: item[1].order, reverse=True + ) + return self._layers + + @property + def layers_visible(self) -> list[list[tuple[Widget, Region, Region]]]: + """Visible widgets and regions in layers order.""" + + if self._layers_visible is None: + layers_visible: list[list[tuple[Widget, Region, Region]]] + layers_visible = [[] for y in range(self.size.height)] + layers_visible_appends = [layer.append for layer in layers_visible] + intersection = Region.intersection + _range = range + for widget, (region, clip) in self.visible_widgets.items(): + cropped_region = intersection(region, clip) + _x, region_y, _width, region_height = cropped_region + if region_height: + widget_location = (widget, cropped_region, region) + for y in _range(region_y, region_y + region_height): + layers_visible_appends[y](widget_location) + self._layers_visible = layers_visible + return self._layers_visible + + def get_offset(self, widget: Widget) -> Offset: + """Get the offset of a widget.""" + try: + return self.map[widget].region.offset + except KeyError: + raise errors.NoWidget("Widget is not in layout") + + def get_widget_at(self, x: int, y: int) -> tuple[Widget, Region]: + """Get the widget under a given coordinate. + + Args: + x (int): X Coordinate. + y (int): Y Coordinate. + + Raises: + errors.NoWidget: If there is not widget underneath (x, y). + + Returns: + tuple[Widget, Region]: A tuple of the widget and its region. + """ + + contains = Region.contains + if len(self.layers_visible) > y >= 0: + for widget, cropped_region, region in self.layers_visible[y]: + if contains(cropped_region, x, y) and widget.visible: + return widget, region + raise errors.NoWidget(f"No widget under screen coordinate ({x}, {y})") + + def get_widgets_at(self, x: int, y: int) -> Iterable[tuple[Widget, Region]]: + """Get all widgets under a given coordinate. + + Args: + x (int): X coordinate. + y (int): Y coordinate. + + Returns: + Iterable[tuple[Widget, Region]]: Sequence of (WIDGET, REGION) tuples. + """ + contains = Region.contains + for widget, cropped_region, region in self.layers_visible[y]: + if contains(cropped_region, x, y) and widget.visible: + yield widget, region + + def get_style_at(self, x: int, y: int) -> Style: + """Get the Style at the given cell or Style.null() + + Args: + x (int): X position within the Layout + y (int): Y position within the Layout + + Returns: + Style: The Style at the cell (x, y) within the Layout + """ + try: + widget, region = self.get_widget_at(x, y) + except errors.NoWidget: + return Style.null() + if widget not in self.visible_widgets: + return Style.null() + + x -= region.x + y -= region.y + + lines = widget.render_lines(Region(0, y, region.width, 1)) + + if not lines: + return Style.null() + end = 0 + for segment in lines[0]: + end += segment.cell_length + if x < end: + return segment.style or Style.null() + return Style.null() + + def find_widget(self, widget: Widget) -> MapGeometry: + """Get information regarding the relative position of a widget in the Compositor. + + Args: + widget (Widget): The Widget in this layout you wish to know the Region of. + + Raises: + NoWidget: If the Widget is not contained in this Layout. + + Returns: + MapGeometry: Widget's composition information. + + """ + try: + region = self.map[widget] + except KeyError: + raise errors.NoWidget("Widget is not in layout") + else: + return region + + @property + def cuts(self) -> list[list[int]]: + """Get vertical cuts. + + A cut is every point on a line where a widget starts or ends. + + Returns: + list[list[int]]: A list of cuts for every line. + """ + if self._cuts is not None: + return self._cuts + + width, height = self.size + screen_region = self.size.region + cuts = [[0, width] for _ in range(height)] + + intersection = Region.intersection + extend = list.extend + + for region, clip in self.visible_widgets.values(): + region = intersection(region, clip) + if region and (region in screen_region): + x, y, region_width, region_height = region + region_cuts = (x, x + region_width) + for cut in cuts[y : y + region_height]: + extend(cut, region_cuts) + + # Sort the cuts for each line + self._cuts = [sorted(set(line_cuts)) for line_cuts in cuts] + + return self._cuts + + def _get_renders( + self, crop: Region | None = None + ) -> Iterable[tuple[Region, Region, Lines]]: + """Get rendered widgets (lists of segments) in the composition. + + Returns: + Iterable[tuple[Region, Region, Lines]]: An iterable of , , and + """ + # If a renderable throws an error while rendering, the user likely doesn't care about the traceback + # up to this point. + _rich_traceback_guard = True + + if not self.map: + return + + def is_visible(widget: Widget) -> bool: + """Return True if the widget is (literally) visible by examining various + properties which affect whether it can be seen or not.""" + return ( + widget.visible + and not widget.is_transparent + and widget.styles.opacity > 0 + ) + + _Region = Region + + visible_widgets = self.visible_widgets + + if crop: + crop_overlaps = crop.overlaps + widget_regions = [ + (widget, region, clip) + for widget, (region, clip) in visible_widgets.items() + if crop_overlaps(clip) and is_visible(widget) + ] + else: + widget_regions = [ + (widget, region, clip) + for widget, (region, clip) in visible_widgets.items() + if is_visible(widget) + ] + + intersection = _Region.intersection + contains_region = _Region.contains_region + + for widget, region, clip in widget_regions: + if contains_region(clip, region): + yield region, clip, widget.render_lines( + _Region(0, 0, region.width, region.height) + ) + else: + clipped_region = intersection(region, clip) + if not clipped_region: + continue + new_x, new_y, new_width, new_height = clipped_region + delta_x = new_x - region.x + delta_y = new_y - region.y + yield region, clip, widget.render_lines( + _Region(delta_x, delta_y, new_width, new_height) + ) + + @classmethod + def _assemble_chops( + cls, chops: list[dict[int, list[Segment] | None]] + ) -> list[list[Segment]]: + """Combine chops in to lines.""" + from_iterable = chain.from_iterable + segment_lines: list[list[Segment]] = [ + list(from_iterable(line for line in bucket.values() if line is not None)) + for bucket in chops + ] + return segment_lines + + def render(self, full: bool = False) -> RenderableType | None: + """Render a layout. + + Returns: + SegmentLines: A renderable + """ + + width, height = self.size + screen_region = Region(0, 0, width, height) + + if full: + update_regions: set[Region] = set() + else: + update_regions = self._dirty_regions.copy() + if screen_region in update_regions: + # If one of the updates is the entire screen, then we only need one update + full = True + self._dirty_regions.clear() + + if full: + crop = screen_region + spans = [] + is_rendered_line = lambda y: True + elif update_regions: + # Create a crop regions that surrounds all updates + crop = Region.from_union(update_regions).intersection(screen_region) + spans = list(self._regions_to_spans(update_regions)) + is_rendered_line = {y for y, _, _ in spans}.__contains__ + else: + return None + + divide = Segment.divide + + # Maps each cut on to a list of segments + cuts = self.cuts + + # dict.fromkeys is a callable which takes a list of ints returns a dict which maps ints on to a list of Segments or None. + fromkeys = cast( + "Callable[[list[int]], dict[int, list[Segment] | None]]", dict.fromkeys + ) + # A mapping of cut index to a list of segments for each line + chops: list[dict[int, list[Segment] | None]] + chops = [fromkeys(cut_set[:-1]) for cut_set in cuts] + + cut_segments: Iterable[list[Segment]] + + # Go through all the renders in reverse order and fill buckets with no render + renders = self._get_renders(crop) + intersection = Region.intersection + + for region, clip, lines in renders: + render_region = intersection(region, clip) + + for y, line in zip(render_region.line_range, lines): + if not is_rendered_line(y): + continue + + chops_line = chops[y] + + first_cut, last_cut = render_region.column_span + cuts_line = cuts[y] + final_cuts = [ + cut for cut in cuts_line if (last_cut >= cut >= first_cut) + ] + if len(final_cuts) <= 2: + # Two cuts, which means the entire line + cut_segments = [line] + else: + render_x = render_region.x + relative_cuts = [cut - render_x for cut in final_cuts[1:]] + cut_segments = divide(line, relative_cuts) + + # Since we are painting front to back, the first segments for a cut "wins" + for cut, segments in zip(final_cuts, cut_segments): + if chops_line[cut] is None: + chops_line[cut] = segments + + if full: + render_lines = self._assemble_chops(chops) + return LayoutUpdate(render_lines, screen_region) + else: + chop_ends = [cut_set[1:] for cut_set in cuts] + return ChopsUpdate(chops, spans, chop_ends) + + def __rich_console__( + self, console: Console, options: ConsoleOptions + ) -> RenderResult: + if self._dirty_regions: + yield self.render() + + def update_widgets(self, widgets: set[Widget]) -> None: + """Update a given widget in the composition. + + Args: + console (Console): Console instance. + widget (Widget): Widget to update. + + """ + regions: list[Region] = [] + add_region = regions.append + get_widget = self.visible_widgets.__getitem__ + for widget in self.visible_widgets.keys() & widgets: + region, clip = get_widget(widget) + offset = region.offset + intersection = clip.intersection + for dirty_region in widget._exchange_repaint_regions(): + update_region = intersection(dirty_region.translate(offset)) + if update_region: + add_region(update_region) + + self._dirty_regions.update(regions) diff --git a/testbed/Textualize__textual/src/textual/_context.py b/testbed/Textualize__textual/src/textual/_context.py new file mode 100644 index 0000000000000000000000000000000000000000..04b264d331615407c7f5cf67a0c58a5ad83b9298 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/_context.py @@ -0,0 +1,13 @@ +from typing import TYPE_CHECKING + +from contextvars import ContextVar + +if TYPE_CHECKING: + from .app import App + + +class NoActiveAppError(RuntimeError): + pass + + +active_app: ContextVar["App"] = ContextVar("active_app") diff --git a/testbed/Textualize__textual/src/textual/_doc.py b/testbed/Textualize__textual/src/textual/_doc.py new file mode 100644 index 0000000000000000000000000000000000000000..17918e3517aaf678e5468a062c76741b898f4ff7 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/_doc.py @@ -0,0 +1,115 @@ +from __future__ import annotations + +import os +import shlex +from typing import Iterable + +from textual.app import App +from textual._import_app import import_app + + +# This module defines our "Custom Fences", powered by SuperFences +# @link https://facelessuser.github.io/pymdown-extensions/extensions/superfences/#custom-fences +def format_svg(source, language, css_class, options, md, attrs, **kwargs) -> str: + """A superfences formatter to insert an SVG screenshot.""" + + try: + cmd: list[str] = shlex.split(attrs["path"]) + path = cmd[0] + + _press = attrs.get("press", None) + press = [*_press.split(",")] if _press else ["_"] + title = attrs.get("title") + + print(f"screenshotting {path!r}") + + cwd = os.getcwd() + try: + rows = int(attrs.get("lines", 24)) + columns = int(attrs.get("columns", 80)) + svg = take_svg_screenshot( + None, path, press, title, terminal_size=(rows, columns) + ) + finally: + os.chdir(cwd) + + assert svg is not None + return svg + + except Exception as error: + import traceback + + traceback.print_exception(error) + + +def take_svg_screenshot( + app: App | None = None, + app_path: str | None = None, + press: Iterable[str] = ("_",), + title: str | None = None, + terminal_size: tuple[int, int] = (24, 80), +) -> str: + """ + + Args: + app: An app instance. Must be supplied if app_path is not. + app_path: A path to an app. Must be supplied if app is not. + press: Key presses to run before taking screenshot. "_" is a short pause. + title: The terminal title in the output image. + terminal_size: A pair of integers (rows, columns), representing terminal size. + + Returns: + str: An SVG string, showing the content of the terminal window at the time + the screenshot was taken. + + """ + rows, columns = terminal_size + + os.environ["COLUMNS"] = str(columns) + os.environ["LINES"] = str(rows) + + if app is None: + app = import_app(app_path) + + if title is None: + title = app.title + + app.run( + quit_after=5, + press=press or ["ctrl+c"], + headless=True, + screenshot=True, + screenshot_title=title, + ) + svg = app._screenshot + return svg + + +def rich(source, language, css_class, options, md, attrs, **kwargs) -> str: + """A superfences formatter to insert an SVG screenshot.""" + + import io + + from rich.console import Console + + title = attrs.get("title", "Rich") + + console = Console( + file=io.StringIO(), + record=True, + force_terminal=True, + color_system="truecolor", + ) + error_console = Console(stderr=True) + + globals: dict = {} + try: + exec(source, globals) + except Exception: + error_console.print_exception() + # console.bell() + + if "output" in globals: + console.print(globals["output"]) + output_svg = console.export_svg(title=title) + return output_svg diff --git a/testbed/Textualize__textual/src/textual/_duration.py b/testbed/Textualize__textual/src/textual/_duration.py new file mode 100644 index 0000000000000000000000000000000000000000..c7479167be369d65eabb011e8ccec2656fc4dd9a --- /dev/null +++ b/testbed/Textualize__textual/src/textual/_duration.py @@ -0,0 +1,47 @@ +import re + +_match_duration = re.compile(r"^(-?\d+\.?\d*)(s|ms)$").match + + +class DurationError(Exception): + """ + Exception indicating a general issue with a CSS duration. + """ + + +class DurationParseError(DurationError): + """ + Indicates a malformed duration string that could not be parsed. + """ + + +def _duration_as_seconds(duration: str) -> float: + """ + Args: + duration (str): A string of the form ``"2s"`` or ``"300ms"``, representing 2 seconds and + 300 milliseconds respectively. If no unit is supplied, e.g. ``"2"``, then the duration is + assumed to be in seconds. + Raises: + DurationParseError: If the argument ``duration`` is not a valid duration string. + Returns: + float: The duration in seconds. + + """ + match = _match_duration(duration) + + if match: + value, unit_name = match.groups() + value = float(value) + if unit_name == "ms": + duration_secs = value / 1000 + else: + duration_secs = value + else: + try: + duration_secs = float(duration) + except ValueError: + raise DurationParseError( + f"{duration!r} is not a valid duration." + ) from ValueError + + return duration_secs diff --git a/testbed/Textualize__textual/src/textual/_easing.py b/testbed/Textualize__textual/src/textual/_easing.py new file mode 100644 index 0000000000000000000000000000000000000000..994188ec5fc8b0790e0bfe14bccd76bb9bc7f390 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/_easing.py @@ -0,0 +1,130 @@ +""" +Define a series of easing functions for more natural-looking animations. +Taken from https://easings.net/ and translated from JavaScript. +""" + +from math import pi, cos, sin, sqrt + + +def _in_out_expo(x: float) -> float: + """https://easings.net/#easeInOutExpo""" + if 0 < x < 0.5: + return pow(2, 20 * x - 10) / 2 + elif 0.5 <= x < 1: + return (2 - pow(2, -20 * x + 10)) / 2 + else: + return x # x in (0, 1) + + +def _in_out_circ(x: float) -> float: + """https://easings.net/#easeInOutCirc""" + if x < 0.5: + return (1 - sqrt(1 - pow(2 * x, 2))) / 2 + else: + return (sqrt(1 - pow(-2 * x + 2, 2)) + 1) / 2 + + +def _in_out_back(x: float) -> float: + """https://easings.net/#easeInOutBack""" + c = 1.70158 * 1.525 + if x < 0.5: + return (pow(2 * x, 2) * ((c + 1) * 2 * x - c)) / 2 + else: + return (pow(2 * x - 2, 2) * ((c + 1) * (x * 2 - 2) + c) + 2) / 2 + + +def _in_elastic(x: float) -> float: + """https://easings.net/#easeInElastic""" + c = 2 * pi / 3 + if 0 < x < 1: + return -pow(2, 10 * x - 10) * sin((x * 10 - 10.75) * c) + else: + return x # x in (0, 1) + + +def _in_out_elastic(x: float) -> float: + """https://easings.net/#easeInOutElastic""" + c = 2 * pi / 4.5 + if 0 < x < 0.5: + return -(pow(2, 20 * x - 10) * sin((20 * x - 11.125) * c)) / 2 + elif 0.5 <= x < 1: + return (pow(2, -20 * x + 10) * sin((20 * x - 11.125) * c)) / 2 + 1 + else: + return x # x in (0, 1) + + +def _out_elastic(x: float) -> float: + """https://easings.net/#easeInOutElastic""" + c = 2 * pi / 3 + if 0 < x < 1: + return pow(2, -10 * x) * sin((x * 10 - 0.75) * c) + 1 + else: + return x # x in (0, 1) + + +def _out_bounce(x: float) -> float: + """https://easings.net/#easeOutBounce""" + n, d = 7.5625, 2.75 + if x < 1 / d: + return n * x * x + elif x < 2 / d: + x_ = x - 1.5 / d + return n * x_ * x_ + 0.75 + elif x < 2.5 / d: + x_ = x - 2.25 / d + return n * x_ * x_ + 0.9375 + else: + x_ = x - 2.625 / d + return n * x_ * x_ + 0.984375 + + +def _in_bounce(x: float) -> float: + """https://easings.net/#easeInBounce""" + return 1 - _out_bounce(1 - x) + + +def _in_out_bounce(x: float) -> float: + """https://easings.net/#easeInOutBounce""" + if x < 0.5: + return (1 - _out_bounce(1 - 2 * x)) / 2 + else: + return (1 + _out_bounce(2 * x - 1)) / 2 + + +EASING = { + "none": lambda x: 1.0, + "round": lambda x: 0.0 if x < 0.5 else 1.0, + "linear": lambda x: x, + "in_sine": lambda x: 1 - cos((x * pi) / 2), + "in_out_sine": lambda x: -(cos(x * pi) - 1) / 2, + "out_sine": lambda x: sin((x * pi) / 2), + "in_quad": lambda x: x * x, + "in_out_quad": lambda x: 2 * x * x if x < 0.5 else 1 - pow(-2 * x + 2, 2) / 2, + "out_quad": lambda x: 1 - pow(1 - x, 2), + "in_cubic": lambda x: x * x * x, + "in_out_cubic": lambda x: 4 * x * x * x if x < 0.5 else 1 - pow(-2 * x + 2, 3) / 2, + "out_cubic": lambda x: 1 - pow(1 - x, 3), + "in_quart": lambda x: pow(x, 4), + "in_out_quart": lambda x: 8 * pow(x, 4) if x < 0.5 else 1 - pow(-2 * x + 2, 4) / 2, + "out_quart": lambda x: 1 - pow(1 - x, 4), + "in_quint": lambda x: pow(x, 5), + "in_out_quint": lambda x: 16 * pow(x, 5) if x < 0.5 else 1 - pow(-2 * x + 2, 5) / 2, + "out_quint": lambda x: 1 - pow(1 - x, 5), + "in_expo": lambda x: pow(2, 10 * x - 10) if x else 0, + "in_out_expo": _in_out_expo, + "out_expo": lambda x: 1 - pow(2, -10 * x) if x != 1 else 1, + "in_circ": lambda x: 1 - sqrt(1 - pow(x, 2)), + "in_out_circ": _in_out_circ, + "out_circ": lambda x: sqrt(1 - pow(x - 1, 2)), + "in_back": lambda x: 2.70158 * pow(x, 3) - 1.70158 * pow(x, 2), + "in_out_back": _in_out_back, + "out_back": lambda x: 1 + 2.70158 * pow(x - 1, 3) + 1.70158 * pow(x - 1, 2), + "in_elastic": _in_elastic, + "in_out_elastic": _in_out_elastic, + "out_elastic": _out_elastic, + "in_bounce": _in_bounce, + "in_out_bounce": _in_out_bounce, + "out_bounce": _out_bounce, +} + +DEFAULT_EASING = "in_out_cubic" diff --git a/testbed/Textualize__textual/src/textual/_event_broker.py b/testbed/Textualize__textual/src/textual/_event_broker.py new file mode 100644 index 0000000000000000000000000000000000000000..1b63a6cf5e56bdd4496839454a965c031b551ed7 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/_event_broker.py @@ -0,0 +1,27 @@ +from __future__ import annotations + +from typing import Any, NamedTuple + + +class NoHandler(Exception): + pass + + +class HandlerArguments(NamedTuple): + modifiers: set[str] + action: Any + + +def extract_handler_actions(event_name: str, meta: dict[str, Any]) -> HandlerArguments: + event_path = event_name.split(".") + for key, value in meta.items(): + if key.startswith("@"): + name_args = key[1:].split(".") + if name_args[: len(event_path)] == event_path: + modifiers = name_args[len(event_path) :] + return HandlerArguments(set(modifiers), value) + raise NoHandler(f"No handler for {event_name!r}") + + +if __name__ == "__main__": + print(extract_handler_actions("mouse.down", {"@mouse.down.hot": "app.bell()"})) diff --git a/testbed/Textualize__textual/src/textual/_filter.py b/testbed/Textualize__textual/src/textual/_filter.py new file mode 100644 index 0000000000000000000000000000000000000000..86ca9858e9ee8bbf692d828d77e43c822c320738 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/_filter.py @@ -0,0 +1,53 @@ +from __future__ import annotations + +from abc import ABC, abstractmethod +from functools import lru_cache + +from rich.segment import Segment +from rich.style import Style + +from .color import Color + + +class LineFilter(ABC): + """Base class for a line filter.""" + + @abstractmethod + def filter(self, segments: list[Segment]) -> list[Segment]: + """Transform a list of segments.""" + ... + + +class Monochrome(LineFilter): + """Convert all colors to monochrome.""" + + def filter(self, segments: list[Segment]) -> list[Segment]: + to_monochrome = self.to_monochrome + _Segment = Segment + return [ + _Segment(text, to_monochrome(style), None) for text, style, _ in segments + ] + + @lru_cache(1024) + def to_monochrome(self, style: Style) -> Style: + """Convert colors in a style to monochrome. + + Args: + style (Style): A Rich Style. + + Returns: + Style: A new Rich style. + """ + style_color = style.color + style_background = style.bgcolor + color = ( + None + if style_color is None + else Color.from_rich_color(style_color).monochrome.rich_color + ) + background = ( + None + if style_background is None + else Color.from_rich_color(style_background).monochrome.rich_color + ) + return style + Style.from_color(color, background) diff --git a/testbed/Textualize__textual/src/textual/_import_app.py b/testbed/Textualize__textual/src/textual/_import_app.py new file mode 100644 index 0000000000000000000000000000000000000000..154fc7198cf838059db021645fc794ee1c1e73b1 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/_import_app.py @@ -0,0 +1,101 @@ +from __future__ import annotations + +import os +import runpy +import shlex +from typing import cast, TYPE_CHECKING + + +if TYPE_CHECKING: + from textual.app import App + + +class AppFail(Exception): + pass + + +def import_app(import_name: str) -> App: + """Import an app from a path or import name. + + Args: + import_name (str): A name to import, such as `foo.bar`, or a path ending with .py. + + Raises: + AppFail: If the app could not be found for any reason. + + Returns: + App: A Textual application + """ + + import inspect + import importlib + import sys + + from textual.app import App + + import_name, *argv = shlex.split(import_name) + lib, _colon, name = import_name.partition(":") + + if lib.endswith(".py"): + path = os.path.abspath(lib) + try: + global_vars = runpy.run_path(path, {}) + except Exception as error: + raise AppFail(str(error)) + + if "sys" in global_vars: + global_vars["sys"].argv = [path, *argv] + + if name: + # User has given a name, use that + try: + app = global_vars[name] + except KeyError: + raise AppFail(f"App {name!r} not found in {lib!r}") + else: + # User has not given a name + if "app" in global_vars: + # App exists, lets use that + try: + app = global_vars["app"] + except KeyError: + raise AppFail(f"App {name!r} not found in {lib!r}") + else: + # Find a App class or instance that is *not* the base class + apps = [ + value + for value in global_vars.values() + if ( + isinstance(value, App) + or (inspect.isclass(value) and issubclass(value, App)) + and value is not App + ) + ] + if not apps: + raise AppFail( + f'Unable to find app in {lib!r}, try specifying app with "foo.py:app"' + ) + if len(apps) > 1: + raise AppFail( + f'Multiple apps found {lib!r}, try specifying app with "foo.py:app"' + ) + app = apps[0] + app._BASE_PATH = path + + else: + # Assuming the user wants to import the file + sys.path.append("") + try: + module = importlib.import_module(lib) + except ImportError as error: + raise AppFail(str(error)) + + try: + app = getattr(module, name or "app") + except AttributeError: + raise AppFail(f"Unable to find {name!r} in {module!r}") + + if inspect.isclass(app) and issubclass(app, App): + app = app() + + return cast(App, app) diff --git a/testbed/Textualize__textual/src/textual/_layout.py b/testbed/Textualize__textual/src/textual/_layout.py new file mode 100644 index 0000000000000000000000000000000000000000..49284bddb0947723856dfac4c96abce34927a01c --- /dev/null +++ b/testbed/Textualize__textual/src/textual/_layout.py @@ -0,0 +1,103 @@ +from __future__ import annotations + +from abc import ABC, abstractmethod +import sys +from typing import ClassVar, NamedTuple, TYPE_CHECKING + + +from .geometry import Region, Size, Spacing + +if sys.version_info >= (3, 10): + from typing import TypeAlias +else: # pragma: no cover + from typing_extensions import TypeAlias + + +if TYPE_CHECKING: + from .widget import Widget + + +ArrangeResult: TypeAlias = "tuple[list[WidgetPlacement], set[Widget]]" +DockArrangeResult: TypeAlias = "tuple[list[WidgetPlacement], set[Widget], Spacing]" + + +class WidgetPlacement(NamedTuple): + """The position, size, and relative order of a widget within its parent.""" + + region: Region + margin: Spacing + widget: Widget + order: int = 0 + fixed: bool = False + + +class Layout(ABC): + """Responsible for arranging Widgets in a view and rendering them.""" + + name: ClassVar[str] = "" + + def __repr__(self) -> str: + return f"<{self.name}>" + + @abstractmethod + def arrange( + self, parent: Widget, children: list[Widget], size: Size + ) -> ArrangeResult: + """Generate a layout map that defines where on the screen the widgets will be drawn. + + Args: + parent (Widget): Parent widget. + size (Size): Size of container. + + Returns: + Iterable[WidgetPlacement]: An iterable of widget location + """ + + def get_content_width(self, widget: Widget, container: Size, viewport: Size) -> int: + """Get the width of the content. + + Args: + widget (Widget): The container widget. + container (Size): The container size. + viewport (Size): The viewport size. + + Returns: + int: Width of the content. + """ + width: int | None = None + widget_gutter = widget.gutter.width + for child in widget.displayed_children: + if not child.is_container: + child_width = ( + child.get_content_width(container, viewport) + + widget_gutter + + child.gutter.width + ) + width = child_width if width is None else max(width, child_width) + if width is None: + width = container.width + return width + + def get_content_height( + self, widget: Widget, container: Size, viewport: Size, width: int + ) -> int: + """Get the content height. + + Args: + widget (Widget): The container widget. + container (Size): The container size. + viewport (Size): The viewport. + width (int): The content width. + + Returns: + int: Content height (in lines). + """ + if not widget.displayed_children: + height = container.height + else: + placements, *_ = widget._arrange(Size(width, container.height)) + height = max( + placement.region.bottom + placement.margin.bottom + for placement in placements + ) + return height diff --git a/testbed/Textualize__textual/src/textual/_layout_resolve.py b/testbed/Textualize__textual/src/textual/_layout_resolve.py new file mode 100644 index 0000000000000000000000000000000000000000..6a650f42bc7805e5db6bb0f9b0f8363e756d1d1b --- /dev/null +++ b/testbed/Textualize__textual/src/textual/_layout_resolve.py @@ -0,0 +1,98 @@ +from __future__ import annotations + +from dataclasses import dataclass +import sys +from fractions import Fraction +from typing import cast, Sequence + + +if sys.version_info >= (3, 8): + from typing import Protocol +else: + from typing_extensions import Protocol # pragma: no cover + + +class EdgeProtocol(Protocol): + """Any object that defines an edge (such as Layout).""" + + # Size of edge in cells, or None for no fixed size + size: int | None + # Portion of flexible space to use if size is None + fraction: int + # Minimum size for edge, in cells + min_size: int + + +@dataclass +class Edge: + size: int | None = None + fraction: int | None = 1 + min_size: int = 1 + + +def layout_resolve(total: int, edges: Sequence[EdgeProtocol]) -> list[int]: + """Divide total space to satisfy size, fraction, and min_size, constraints. + + The returned list of integers should add up to total in most cases, unless it is + impossible to satisfy all the constraints. For instance, if there are two edges + with a minimum size of 20 each and `total` is 30 then the returned list will be + greater than total. In practice, this would mean that a Layout object would + clip the rows that would overflow the screen height. + + Args: + total (int): Total number of characters. + edges (Sequence[Edge]): Edges within total space. + + Returns: + list[int]: Number of characters for each edge. + """ + # Size of edge or None for yet to be determined + sizes = [(edge.size or None) for edge in edges] + + if None not in sizes: + # No flexible edges + return cast("list[int]", sizes) + + # Get flexible edges and index to map these back on to sizes list + flexible_edges = [ + (index, edge) + for index, (size, edge) in enumerate(zip(sizes, edges)) + if size is None + ] + # Remaining space in total + remaining = total - sum([size or 0 for size in sizes]) + if remaining <= 0: + # No room for flexible edges + return [ + ((edge.min_size or 1) if size is None else size) + for size, edge in zip(sizes, edges) + ] + + # Get the total fraction value for all flexible edges + total_flexible = sum([(edge.fraction or 1) for _, edge in flexible_edges]) + while flexible_edges: + # Calculate number of characters in a ratio portion + portion = Fraction(remaining, total_flexible) + + # If any edges will be less than their minimum, replace size with the minimum + for flexible_index, (index, edge) in enumerate(flexible_edges): + if portion * edge.fraction < edge.min_size: + # This flexible edge will be smaller than its minimum size + # We need to fix the size and redistribute the outstanding space + sizes[index] = edge.min_size + remaining -= edge.min_size + total_flexible -= edge.fraction or 1 + del flexible_edges[flexible_index] + # New fixed size will invalidate calculations, so we need to repeat the process + break + else: + # Distribute flexible space and compensate for rounding error + # Since edge sizes can only be integers we need to add the remainder + # to the following line + remainder = Fraction(0) + for index, edge in flexible_edges: + sizes[index], remainder = divmod(portion * edge.fraction + remainder, 1) + break + + # Sizes now contains integers only + return cast("list[int]", sizes) diff --git a/testbed/Textualize__textual/src/textual/_log.py b/testbed/Textualize__textual/src/textual/_log.py new file mode 100644 index 0000000000000000000000000000000000000000..e9adcef42408940f40a1dba0ab44ee311827eb6f --- /dev/null +++ b/testbed/Textualize__textual/src/textual/_log.py @@ -0,0 +1,21 @@ +from enum import Enum + + +class LogGroup(Enum): + """A log group is a classification of the log message (*not* a level).""" + + UNDEFINED = 0 # Mainly for testing + EVENT = 1 + DEBUG = 2 + INFO = 3 + WARNING = 4 + ERROR = 5 + PRINT = 6 + SYSTEM = 7 + + +class LogVerbosity(Enum): + """Tags log messages as being verbose and potentially excluded from output.""" + + NORMAL = 0 + HIGH = 1 diff --git a/testbed/Textualize__textual/src/textual/_loop.py b/testbed/Textualize__textual/src/textual/_loop.py new file mode 100644 index 0000000000000000000000000000000000000000..7a057fc2144ed8dfa73cbde47fd4353dba97ec42 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/_loop.py @@ -0,0 +1,45 @@ +from __future__ import annotations + +from typing import Iterable, TypeVar + +T = TypeVar("T") + + +def loop_first(values: Iterable[T]) -> Iterable[tuple[bool, T]]: + """Iterate and generate a tuple with a flag for first value.""" + iter_values = iter(values) + try: + value = next(iter_values) + except StopIteration: + return + yield True, value + for value in iter_values: + yield False, value + + +def loop_last(values: Iterable[T]) -> Iterable[tuple[bool, T]]: + """Iterate and generate a tuple with a flag for last value.""" + iter_values = iter(values) + try: + previous_value = next(iter_values) + except StopIteration: + return + for value in iter_values: + yield False, previous_value + previous_value = value + yield True, previous_value + + +def loop_first_last(values: Iterable[T]) -> Iterable[tuple[bool, bool, T]]: + """Iterate and generate a tuple with a flag for first and last value.""" + iter_values = iter(values) + try: + previous_value = next(iter_values) + except StopIteration: + return + first = True + for value in iter_values: + yield first, False, previous_value + first = False + previous_value = value + yield first, True, previous_value diff --git a/testbed/Textualize__textual/src/textual/_node_list.py b/testbed/Textualize__textual/src/textual/_node_list.py new file mode 100644 index 0000000000000000000000000000000000000000..fa5570fc48337f8c3e5a64d1c39c2e8ea2cc2f56 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/_node_list.py @@ -0,0 +1,88 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Iterator, Sequence, overload + +import rich.repr + +if TYPE_CHECKING: + from .widget import Widget + + +@rich.repr.auto(angular=True) +class NodeList(Sequence): + """ + A container for widgets that forms one level of hierarchy. + + Although named a list, widgets may appear only once, making them more like a set. + + """ + + def __init__(self) -> None: + # The nodes in the list + self._nodes: list[Widget] = [] + self._nodes_set: set[Widget] = set() + # Increments when list is updated (used for caching) + self._updates = 0 + + def __bool__(self) -> bool: + return bool(self._nodes) + + def __length_hint__(self) -> int: + return len(self._nodes) + + def __rich_repr__(self) -> rich.repr.Result: + yield self._nodes + + def __len__(self) -> int: + return len(self._nodes) + + def __contains__(self, widget: Widget) -> bool: + return widget in self._nodes + + def _append(self, widget: Widget) -> None: + """Append a Widget. + + Args: + widget (Widget): A widget. + """ + if widget not in self._nodes_set: + self._nodes.append(widget) + self._nodes_set.add(widget) + self._updates += 1 + + def _remove(self, widget: Widget) -> None: + """Remove a widget from the list. + + Removing a widget not in the list is a null-op. + + Args: + widget (Widget): A Widget in the list. + """ + if widget in self._nodes_set: + del self._nodes[self._nodes.index(widget)] + self._nodes_set.remove(widget) + self._updates += 1 + + def _clear(self) -> None: + """Clear the node list.""" + if self._nodes: + self._nodes.clear() + self._nodes_set.clear() + self._updates += 1 + + def __iter__(self) -> Iterator[Widget]: + return iter(self._nodes) + + def __reversed__(self) -> Iterator[Widget]: + return reversed(self._nodes) + + @overload + def __getitem__(self, index: int) -> Widget: + ... + + @overload + def __getitem__(self, index: slice) -> list[Widget]: + ... + + def __getitem__(self, index: int | slice) -> Widget | list[Widget]: + return self._nodes[index] diff --git a/testbed/Textualize__textual/src/textual/_opacity.py b/testbed/Textualize__textual/src/textual/_opacity.py new file mode 100644 index 0000000000000000000000000000000000000000..026da6d844e86ce9c41ba3f3d14aff3b71cabb2b --- /dev/null +++ b/testbed/Textualize__textual/src/textual/_opacity.py @@ -0,0 +1,45 @@ +from typing import Iterable + +from rich.segment import Segment +from rich.style import Style + +from textual.color import Color + + +def _apply_opacity( + segments: Iterable[Segment], + base_background: Color, + opacity: float, +) -> Iterable[Segment]: + """Takes an iterable of foreground Segments and blends them into the supplied + background color, yielding copies of the Segments with blended foreground and + background colors applied. + + Args: + segments (Iterable[Segment]): The segments in the foreground. + base_background (Color): The background color to blend foreground into. + opacity (float): The blending factor. A value of 1.0 means output segments will + have identical foreground and background colors to input segments. + """ + _Segment = Segment + from_rich_color = Color.from_rich_color + from_color = Style.from_color + blend = base_background.blend + for segment in segments: + text, style, _ = segment + if not style: + yield segment + continue + + blended_style = style + if style.color: + color = from_rich_color(style.color) + blended_foreground = blend(color, factor=opacity) + blended_style += from_color(color=blended_foreground.rich_color) + + if style.bgcolor: + bgcolor = from_rich_color(style.bgcolor) + blended_background = blend(bgcolor, factor=opacity) + blended_style += from_color(bgcolor=blended_background.rich_color) + + yield _Segment(text, blended_style) diff --git a/testbed/Textualize__textual/src/textual/_parser.py b/testbed/Textualize__textual/src/textual/_parser.py new file mode 100644 index 0000000000000000000000000000000000000000..f01ca6f56294fcd9d23d3497e61dac7b75acca53 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/_parser.py @@ -0,0 +1,183 @@ +from __future__ import annotations + +from collections import deque +import io +from typing import ( + Callable, + Deque, + Generator, + TypeVar, + Generic, + Union, + Iterable, +) + + +class ParseError(Exception): + pass + + +class ParseEOF(ParseError): + """End of Stream.""" + + +class Awaitable: + __slots__: list[str] = [] + + +class _Read(Awaitable): + __slots__ = ["remaining"] + + def __init__(self, count: int) -> None: + self.remaining = count + + def __repr__(self) -> str: + return f"_ReadBytes({self.remaining})" + + +class _Read1(Awaitable): + __slots__: list[str] = [] + + +class _ReadUntil(Awaitable): + __slots__ = ["sep", "max_bytes"] + + def __init__(self, sep: str, max_bytes: int | None = None) -> None: + self.sep = sep + self.max_bytes = max_bytes + + +class _PeekBuffer(Awaitable): + __slots__: list[str] = [] + + +T = TypeVar("T") + + +TokenCallback = Callable[[T], None] + + +class Parser(Generic[T]): + read = _Read + read1 = _Read1 + read_until = _ReadUntil + peek_buffer = _PeekBuffer + + def __init__(self) -> None: + self._buffer = io.StringIO() + self._eof = False + self._tokens: Deque[T] = deque() + self._gen = self.parse(self._tokens.append) + self._awaiting: Union[Awaitable, T] = next(self._gen) + + @property + def is_eof(self) -> bool: + return self._eof + + def reset(self) -> None: + self._gen = self.parse(self._tokens.append) + self._awaiting = next(self._gen) + + def feed(self, data: str) -> Iterable[T]: + + if self._eof: + raise ParseError("end of file reached") from None + if not data: + self._eof = True + try: + self._gen.send(self._buffer.getvalue()) + except StopIteration: + raise ParseError("end of file reached") from None + while self._tokens: + yield self._tokens.popleft() + + self._buffer.truncate(0) + return + + _buffer = self._buffer + pos = 0 + tokens = self._tokens + popleft = tokens.popleft + data_size = len(data) + + while tokens: + yield popleft() + + while pos < data_size or isinstance(self._awaiting, _PeekBuffer): + + _awaiting = self._awaiting + if isinstance(_awaiting, _Read1): + self._awaiting = self._gen.send(data[pos : pos + 1]) + pos += 1 + + elif isinstance(_awaiting, _PeekBuffer): + self._awaiting = self._gen.send(data[pos:]) + + elif isinstance(_awaiting, _Read): + remaining = _awaiting.remaining + chunk = data[pos : pos + remaining] + chunk_size = len(chunk) + pos += chunk_size + _buffer.write(chunk) + remaining -= chunk_size + if remaining: + _awaiting.remaining = remaining + else: + _awaiting = self._gen.send(_buffer.getvalue()) + _buffer.truncate(0) + + elif isinstance(_awaiting, _ReadUntil): + chunk = data[pos:] + _buffer.write(chunk) + sep = _awaiting.sep + sep_index = _buffer.getvalue().find(sep) + + if sep_index == -1: + pos += len(chunk) + if ( + _awaiting.max_bytes is not None + and _buffer.tell() > _awaiting.max_bytes + ): + self._gen.throw(ParseError(f"expected {sep}")) + else: + sep_index += len(sep) + if ( + _awaiting.max_bytes is not None + and sep_index > _awaiting.max_bytes + ): + self._gen.throw(ParseError(f"expected {sep}")) + data = _buffer.getvalue()[sep_index:] + pos = 0 + self._awaiting = self._gen.send(_buffer.getvalue()[:sep_index]) + _buffer.truncate(0) + + while tokens: + yield popleft() + + def parse(self, on_token: Callable[[T], None]) -> Generator[Awaitable, str, None]: + return + yield + + +if __name__ == "__main__": + data = "Where there is a Will there is a way!" + + class TestParser(Parser[str]): + def parse( + self, on_token: Callable[[str], None] + ) -> Generator[Awaitable, str, None]: + while True: + data = yield self.read1() + if not data: + break + on_token(data) + + test_parser = TestParser() + + import time + + for n in range(0, len(data), 5): + for token in test_parser.feed(data[n : n + 5]): + print(token) + for token in test_parser.feed(""): + print(token) diff --git a/testbed/Textualize__textual/src/textual/_partition.py b/testbed/Textualize__textual/src/textual/_partition.py new file mode 100644 index 0000000000000000000000000000000000000000..734cdad6130cb64a411f0367ed2006345e502e10 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/_partition.py @@ -0,0 +1,29 @@ +from __future__ import annotations + +from typing import Callable, Iterable, TypeVar + + +T = TypeVar("T") + + +def partition( + pred: Callable[[T], object], iterable: Iterable[T] +) -> tuple[list[T], list[T]]: + """Partition a sequence in to two list from a given predicate. The first list will contain + the values where the predicate is False, the second list will contain the remaining values. + + Args: + pred (Callable[[T], object]): A callable that returns True or False for a given value. + iterable (Iterable[T]): In Iterable of values. + + Returns: + tuple[list[T], list[T]]: A list of values where the predicate is False, and a list + where the predicate is True. + """ + + result: tuple[list[T], list[T]] = ([], []) + appends = (result[0].append, result[1].append) + + for value in iterable: + appends[1 if pred(value) else 0](value) + return result diff --git a/testbed/Textualize__textual/src/textual/_path.py b/testbed/Textualize__textual/src/textual/_path.py new file mode 100644 index 0000000000000000000000000000000000000000..28a9ba1bcab65938bf779c91d74987939c77249c --- /dev/null +++ b/testbed/Textualize__textual/src/textual/_path.py @@ -0,0 +1,33 @@ +from __future__ import annotations + +import inspect +import sys +from pathlib import Path, PurePath + + +def _make_path_object_relative(path: str | PurePath, obj: object) -> Path: + """Convert the supplied path to a Path object that is relative to a given Python object. + If the supplied path is absolute, it will simply be converted to a Path object. + Used, for example, to return the path of a CSS file relative to a Textual App instance. + + Args: + path (str | Path): A path. + obj (object): A Python object to resolve the path relative to. + + Returns: + Path: A resolved Path object, relative to obj + """ + path = Path(path) + + # If the path supplied by the user is absolute, we can use it directly + if path.is_absolute(): + return path + + # Otherwise (relative path), resolve it relative to obj... + base_path = getattr(obj, "_BASE_PATH", None) + if base_path is not None: + subclass_path = Path(base_path) + else: + subclass_path = Path(inspect.getfile(obj.__class__)) + resolved_path = (subclass_path.parent / path).resolve() + return resolved_path diff --git a/testbed/Textualize__textual/src/textual/_profile.py b/testbed/Textualize__textual/src/textual/_profile.py new file mode 100644 index 0000000000000000000000000000000000000000..32db80262510013d634fd8e637eb4c027b3fabe8 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/_profile.py @@ -0,0 +1,21 @@ +""" +Timer context manager, only used in debug. + +""" + +from time import time + +import contextlib +from typing import Generator + +from . import log + + +@contextlib.contextmanager +def timer(subject: str = "time") -> Generator[None, None, None]: + """print the elapsed time. (only used in debugging)""" + start = time() + yield + elapsed = time() - start + elapsed_ms = elapsed * 1000 + log(f"{subject} elapsed {elapsed_ms:.2f}ms") diff --git a/testbed/Textualize__textual/src/textual/_resolve.py b/testbed/Textualize__textual/src/textual/_resolve.py new file mode 100644 index 0000000000000000000000000000000000000000..cf10dfcb541767a0b38f487984b8ec68c5425132 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/_resolve.py @@ -0,0 +1,73 @@ +from __future__ import annotations + +from fractions import Fraction +from itertools import accumulate +from typing import cast, Sequence + +from .css.scalar import Scalar +from .geometry import Size + + +def resolve( + dimensions: Sequence[Scalar], + total: int, + gutter: int, + size: Size, + viewport: Size, +) -> list[tuple[int, int]]: + """Resolve a list of dimensions. + + Args: + dimensions (Sequence[Scalar]): Scalars for column / row sizes. + total (int): Total space to divide. + gutter (int): Gutter between rows / columns. + size (Size): Size of container. + viewport (Size): Size of viewport. + + Returns: + list[tuple[int, int]]: List of (, ) + """ + + resolved: list[tuple[Scalar, Fraction | None]] = [ + ( + (scalar, None) + if scalar.is_fraction + else (scalar, scalar.resolve_dimension(size, viewport)) + ) + for scalar in dimensions + ] + + from_float = Fraction.from_float + total_fraction = from_float( + sum(scalar.value for scalar, fraction in resolved if fraction is None) + ) + + if total_fraction: + total_gutter = gutter * (len(dimensions) - 1) + consumed = sum(fraction for _, fraction in resolved if fraction is not None) + remaining = max(Fraction(0), Fraction(total - total_gutter) - consumed) + fraction_unit = Fraction(remaining, total_fraction) + resolved_fractions = [ + from_float(scalar.value) * fraction_unit if fraction is None else fraction + for scalar, fraction in resolved + ] + else: + resolved_fractions = cast( + "list[Fraction]", [fraction for _, fraction in resolved] + ) + + fraction_gutter = Fraction(gutter) + offsets = [0] + [ + int(fraction) + for fraction in accumulate( + value + for fraction in resolved_fractions + for value in (fraction, fraction_gutter) + ) + ] + results = [ + (offset1, offset2 - offset1) + for offset1, offset2 in zip(offsets[::2], offsets[1::2]) + ] + + return results diff --git a/testbed/Textualize__textual/src/textual/_segment_tools.py b/testbed/Textualize__textual/src/textual/_segment_tools.py new file mode 100644 index 0000000000000000000000000000000000000000..b2e4a13f7d23e1eaf916aa5c44dc1fd5e011acdf --- /dev/null +++ b/testbed/Textualize__textual/src/textual/_segment_tools.py @@ -0,0 +1,193 @@ +""" +Tools for processing Segments, or lists of Segments. +""" + +from __future__ import annotations + +from typing import Iterable + +from rich.segment import Segment +from rich.style import Style + +from ._cells import cell_len +from ._types import Lines +from .css.types import AlignHorizontal, AlignVertical +from .geometry import Size + + +def line_crop( + segments: list[Segment], start: int, end: int, total: int +) -> list[Segment]: + """Crops a list of segments between two cell offsets. + + Args: + segments (list[Segment]): A list of Segments for a line. + start (int): Start offset + end (int): End offset (exclusive) + total (int): Total cell length of segments. + Returns: + list[Segment]: A new shorter list of segments + """ + # This is essentially a specialized version of Segment.divide + # The following line has equivalent functionality (but a little slower) + # return list(Segment.divide(segments, [start, end]))[1] + + _cell_len = cell_len + pos = 0 + output_segments: list[Segment] = [] + add_segment = output_segments.append + iter_segments = iter(segments) + segment: Segment | None = None + for segment in iter_segments: + end_pos = pos + _cell_len(segment.text) + if end_pos > start: + segment = segment.split_cells(start - pos)[1] + break + pos = end_pos + else: + return [] + + if end >= total: + # The end crop is the end of the segments, so we can collect all remaining segments + if segment: + add_segment(segment) + output_segments.extend(iter_segments) + return output_segments + + pos = start + while segment is not None: + end_pos = pos + _cell_len(segment.text) + if end_pos < end: + add_segment(segment) + else: + add_segment(segment.split_cells(end - pos)[0]) + break + pos = end_pos + segment = next(iter_segments, None) + + return output_segments + + +def line_trim(segments: list[Segment], start: bool, end: bool) -> list[Segment]: + """Optionally remove a cell from the start and / or end of a list of segments. + + Args: + segments (list[Segment]): A line (list of Segments) + start (bool): Remove cell from start. + end (bool): Remove cell from end. + + Returns: + list[Segment]: A new list of segments. + """ + segments = segments.copy() + if segments and start: + _, first_segment = segments[0].split_cells(1) + if first_segment.text: + segments[0] = first_segment + else: + segments.pop(0) + if segments and end: + last_segment = segments[-1] + last_segment, _ = last_segment.split_cells(len(last_segment.text) - 1) + if last_segment.text: + segments[-1] = last_segment + else: + segments.pop() + return segments + + +def line_pad( + segments: Iterable[Segment], pad_left: int, pad_right: int, style: Style +) -> list[Segment]: + """Adds padding to the left and / or right of a list of segments. + + Args: + segments (Iterable[Segment]): A line of segments. + pad_left (int): Cells to pad on the left. + pad_right (int): Cells to pad on the right. + style (Style): Style of padded cells. + + Returns: + list[Segment]: A new line with padding. + """ + if pad_left and pad_right: + return [ + Segment(" " * pad_left, style), + *segments, + Segment(" " * pad_right, style), + ] + elif pad_left: + return [ + Segment(" " * pad_left, style), + *segments, + ] + elif pad_right: + return [ + *segments, + Segment(" " * pad_right, style), + ] + return list(segments) + + +def align_lines( + lines: Lines, + style: Style, + size: Size, + horizontal: AlignHorizontal, + vertical: AlignVertical, +) -> Iterable[list[Segment]]: + """Align lines. + + Args: + lines (Lines): A list of lines. + style (Style): Background style. + size (Size): Size of container. + horizontal (AlignHorizontal): Horizontal alignment. + vertical (AlignVertical): Vertical alignment + + Returns: + Iterable[list[Segment]]: Aligned lines. + + """ + + width, height = size + shape_width, shape_height = Segment.get_shape(lines) + + def blank_lines(count: int) -> Lines: + return [[Segment(" " * width, style)]] * count + + top_blank_lines = bottom_blank_lines = 0 + vertical_excess_space = max(0, height - shape_height) + + if vertical == "top": + bottom_blank_lines = vertical_excess_space + elif vertical == "middle": + top_blank_lines = vertical_excess_space // 2 + bottom_blank_lines = height - top_blank_lines + elif vertical == "bottom": + top_blank_lines = vertical_excess_space + + yield from blank_lines(top_blank_lines) + + horizontal_excess_space = max(0, width - shape_width) + + adjust_line_length = Segment.adjust_line_length + if horizontal == "left": + for line in lines: + yield adjust_line_length(line, width, style, pad=True) + + elif horizontal == "center": + left_space = horizontal_excess_space // 2 + for line in lines: + yield [ + Segment(" " * left_space, style), + *adjust_line_length(line, width - left_space, style, pad=True), + ] + + elif horizontal == "right": + get_line_length = Segment.get_line_length + for line in lines: + left_space = width - get_line_length(line) + yield [Segment(" " * left_space, style), *line] + + yield from blank_lines(bottom_blank_lines) diff --git a/testbed/Textualize__textual/src/textual/_styles_cache.py b/testbed/Textualize__textual/src/textual/_styles_cache.py new file mode 100644 index 0000000000000000000000000000000000000000..ae795a12e8191efec0403072b30adb9f76d91aae --- /dev/null +++ b/testbed/Textualize__textual/src/textual/_styles_cache.py @@ -0,0 +1,396 @@ +from __future__ import annotations + +import sys +from typing import TYPE_CHECKING, Callable, Iterable, List + +from rich.segment import Segment +from rich.style import Style + +from ._border import get_box, render_row +from ._filter import LineFilter +from ._opacity import _apply_opacity +from ._segment_tools import line_crop, line_pad, line_trim +from ._types import Lines +from .color import Color +from .geometry import Region, Size, Spacing +from .renderables.text_opacity import TextOpacity +from .renderables.tint import Tint + +if sys.version_info >= (3, 10): + from typing import TypeAlias +else: # pragma: no cover + from typing_extensions import TypeAlias + + +if TYPE_CHECKING: + from .css.styles import StylesBase + from .widget import Widget + + +RenderLineCallback: TypeAlias = Callable[[int], List[Segment]] + + +def style_links( + segments: Iterable[Segment], link_id: str, link_style: Style +) -> list[Segment]: + """Apply a style to the given link id. + + Args: + segments (Iterable[Segment]): Segments. + link_id (str): A link id. + link_style (Style): Style to apply. + + Returns: + list[Segment]: A list of new segments. + """ + + _Segment = Segment + + segments = [ + _Segment( + text, + (style + link_style if style is not None else None) + if (style and not style._null and style._link_id == link_id) + else style, + control, + ) + for text, style, control in segments + ] + return segments + + +class StylesCache: + """Responsible for rendering CSS Styles and keeping a cached of rendered lines. + + The render method applies border, outline, and padding set in the Styles object to widget content. + + The diagram below shows content (possibly from a Rich renderable) with padding and border. The + labels A. B. and C. indicate the code path (see comments in render_line below) chosen to render + the indicated lines. + + ``` + ┏━━━━━━━━━━━━━━━━━━━━━━┓◀── A. border + ┃ ┃◀┐ + ┃ ┃ └─ B. border + padding + + ┃ Lorem ipsum dolor ┃◀┐ border + ┃ sit amet, ┃ │ + ┃ consectetur ┃ └─ C. border + padding + + ┃ adipiscing elit, ┃ content + padding + + ┃ sed do eiusmod ┃ border + ┃ tempor incididunt ┃ + ┃ ┃ + ┃ ┃ + ┗━━━━━━━━━━━━━━━━━━━━━━┛ + ``` + + """ + + def __init__(self) -> None: + self._cache: dict[int, list[Segment]] = {} + self._dirty_lines: set[int] = set() + self._width = 1 + + def set_dirty(self, *regions: Region) -> None: + """Add a dirty regions.""" + if regions: + for region in regions: + self._dirty_lines.update(region.line_range) + else: + self.clear() + + def is_dirty(self, y: int) -> bool: + """Check if a given line is dirty (needs to be rendered again). + + Args: + y (int): Y coordinate of line. + + Returns: + bool: True if line requires a render, False if can be cached. + """ + return y in self._dirty_lines + + def clear(self) -> None: + """Clear the styles cache (will cause the content to re-render).""" + self._cache.clear() + self._dirty_lines.clear() + + def render_widget(self, widget: Widget, crop: Region) -> Lines: + """Render the content for a widget. + + Args: + widget (Widget): A widget. + region (Region): A region of the widget to render. + + Returns: + Lines: Rendered lines. + """ + base_background, background = widget.background_colors + styles = widget.styles + lines = self.render( + styles, + widget.region.size, + base_background, + background, + widget.render_line, + content_size=widget.content_region.size, + padding=styles.padding, + crop=crop, + filter=widget.app._filter, + ) + if widget.auto_links: + _style_links = style_links + hover_style = widget.hover_style + link_hover_style = widget.link_hover_style + if ( + link_hover_style + and hover_style._link_id + and hover_style._meta + and "@click" in hover_style.meta + ): + if link_hover_style: + lines = [ + _style_links(line, hover_style.link_id, link_hover_style) + for line in lines + ] + + return lines + + def render( + self, + styles: StylesBase, + size: Size, + base_background: Color, + background: Color, + render_content_line: RenderLineCallback, + content_size: Size | None = None, + padding: Spacing | None = None, + crop: Region | None = None, + filter: LineFilter | None = None, + ) -> Lines: + """Render a widget content plus CSS styles. + + Args: + styles (StylesBase): CSS Styles object. + size (Size): Size of widget. + base_background (Color): Background color beneath widget. + background (Color): Background color of widget. + render_content_line (RenderLineCallback): Callback to render content line. + content_size (Size | None, optional): Size of content or None to assume full size. Defaults to None. + padding (Spacing | None, optional): Override padding from Styles, or None to use styles.padding. Defaults to None. + crop (Region | None, optional): Region to crop to. Defaults to None. + + Returns: + Lines: Rendered lines. + """ + if content_size is None: + content_size = size + if padding is None: + padding = styles.padding + if crop is None: + crop = size.region + + width, height = size + if width != self._width: + self.clear() + self._width = width + lines: Lines = [] + add_line = lines.append + simplify = Segment.simplify + + is_dirty = self._dirty_lines.__contains__ + render_line = self.render_line + for y in crop.line_range: + if is_dirty(y) or y not in self._cache: + line = render_line( + styles, + y, + size, + content_size, + padding, + base_background, + background, + render_content_line, + ) + line = list(simplify(line)) + self._cache[y] = line + else: + line = self._cache[y] + if filter: + line = filter.filter(line) + add_line(line) + self._dirty_lines.difference_update(crop.line_range) + + if crop.column_span != (0, width): + _line_crop = line_crop + x1, x2 = crop.column_span + lines = [_line_crop(line, x1, x2, width) for line in lines] + + return lines + + def render_line( + self, + styles: StylesBase, + y: int, + size: Size, + content_size: Size, + padding: Spacing, + base_background: Color, + background: Color, + render_content_line: RenderLineCallback, + ) -> list[Segment]: + """Render a styled line. + + Args: + styles (StylesBase): Styles object. + y (int): The y coordinate of the line (relative to widget screen offset). + size (Size): Size of the widget. + content_size (Size): Size of the content area. + padding (Spacing): Padding. + base_background (Color): Background color of widget beneath this line. + background (Color): Background color of widget. + render_content_line (RenderLineCallback): Callback to render a line of content. + + Returns: + list[Segment]: A line of segments. + """ + + gutter = styles.gutter + width, height = size + content_width, content_height = content_size + + pad_top, pad_right, pad_bottom, pad_left = padding + + ( + (border_top, border_top_color), + (border_right, border_right_color), + (border_bottom, border_bottom_color), + (border_left, border_left_color), + ) = styles.border + + ( + (outline_top, outline_top_color), + (outline_right, outline_right_color), + (outline_bottom, outline_bottom_color), + (outline_left, outline_left_color), + ) = styles.outline + + from_color = Style.from_color + + inner = from_color(bgcolor=(base_background + background).rich_color) + outer = from_color(bgcolor=base_background.rich_color) + + def post(segments: Iterable[Segment]) -> list[Segment]: + """Post process segments to apply opacity and tint. + + Args: + segments (Iterable[Segment]): Iterable of segments. + + Returns: + list[Segment]: New list of segments + """ + if styles.text_opacity != 1.0: + segments = TextOpacity.process_segments(segments, styles.text_opacity) + if styles.tint.a: + segments = Tint.process_segments(segments, styles.tint) + if styles.opacity != 1.0: + segments = _apply_opacity(segments, base_background, styles.opacity) + segments = list(segments) + return segments if isinstance(segments, list) else list(segments) + + line: Iterable[Segment] + # Draw top or bottom borders (A) + if (border_top and y == 0) or (border_bottom and y == height - 1): + border_color = base_background + ( + border_top_color if y == 0 else border_bottom_color + ) + box_segments = get_box( + border_top if y == 0 else border_bottom, + inner, + outer, + from_color(color=border_color.rich_color), + ) + line = render_row( + box_segments[0 if y == 0 else 2], + width, + border_left != "", + border_right != "", + ) + + # Draw padding (B) + elif (pad_top and y < gutter.top) or ( + pad_bottom and y >= height - gutter.bottom + ): + background_style = from_color(bgcolor=background.rich_color) + left_style = from_color(color=(background + border_left_color).rich_color) + left = get_box(border_left, inner, outer, left_style)[1][0] + right_style = from_color(color=(background + border_right_color).rich_color) + right = get_box(border_right, inner, outer, right_style)[1][2] + if border_left and border_right: + line = [left, Segment(" " * (width - 2), background_style), right] + elif border_left: + line = [left, Segment(" " * (width - 1), background_style)] + elif border_right: + line = [Segment(" " * (width - 1), background_style), right] + else: + line = [Segment(" " * width, background_style)] + else: + # Content with border and padding (C) + content_y = y - gutter.top + if content_y < content_height: + line = render_content_line(y - gutter.top) + else: + line = [Segment(" " * content_width, inner)] + if inner: + line = Segment.apply_style(line, inner) + line = line_pad(line, pad_left, pad_right, inner) + + if border_left or border_right: + # Add left / right border + left_style = from_color( + (base_background + border_left_color).rich_color + ) + left = get_box(border_left, inner, outer, left_style)[1][0] + right_style = from_color( + (base_background + border_right_color).rich_color + ) + right = get_box(border_right, inner, outer, right_style)[1][2] + + if border_left and border_right: + line = [left, *line, right] + elif border_left: + line = [left, *line] + else: + line = [*line, right] + + # Draw any outline + if (outline_top and y == 0) or (outline_bottom and y == height - 1): + # Top or bottom outlines + outline_color = outline_top_color if y == 0 else outline_bottom_color + box_segments = get_box( + outline_top if y == 0 else outline_bottom, + inner, + outer, + from_color(color=outline_color.rich_color), + ) + line = render_row( + box_segments[0 if y == 0 else 2], + width, + outline_left != "", + outline_right != "", + ) + + elif outline_left or outline_right: + # Lines in side outline + left_style = from_color((base_background + outline_left_color).rich_color) + left = get_box(outline_left, inner, outer, left_style)[1][0] + right_style = from_color((base_background + outline_right_color).rich_color) + right = get_box(outline_right, inner, outer, right_style)[1][2] + line = line_trim(list(line), outline_left != "", outline_right != "") + if outline_left and outline_right: + line = [left, *line, right] + elif outline_left: + line = [left, *line] + else: + line = [*line, right] + + return post(line) diff --git a/testbed/Textualize__textual/src/textual/_text_backend.py b/testbed/Textualize__textual/src/textual/_text_backend.py new file mode 100644 index 0000000000000000000000000000000000000000..59e204671bcfd9ec0e72e7894b23cbb5b408fbca --- /dev/null +++ b/testbed/Textualize__textual/src/textual/_text_backend.py @@ -0,0 +1,159 @@ +from __future__ import annotations + +from dataclasses import dataclass + + +@dataclass +class TextEditorBackend: + """Represents a text editor (some text and a cursor)""" + + content: str = "" + cursor_index: int = 0 + + def set_content(self, text: str) -> None: + """Set the content of the editor + + Args: + text (str): The text to set as the content + """ + self.content = text + + def delete_back(self) -> bool: + """Delete the character behind the cursor and moves cursor back. If the + cursor is at the start of the content, does nothing other than immediately + return False. + + Returns: + bool: True if the text content was modified. False otherwise. + """ + if self.cursor_index == 0: + return False + + new_text = ( + self.content[: self.cursor_index - 1] + self.content[self.cursor_index :] + ) + self.content = new_text + self.cursor_index = max(0, self.cursor_index - 1) + return True + + def delete_forward(self) -> bool: + """Delete the character in front of the cursor without moving the cursor. + + Returns: + bool: True if the text content was modified. False otherwise. + """ + if self.cursor_index == len(self.content): + return False + + new_text = ( + self.content[: self.cursor_index] + self.content[self.cursor_index + 1 :] + ) + self.content = new_text + return True + + def cursor_left(self) -> bool: + """Move the cursor 1 character left in the text. Is a noop if cursor is at start. + + Returns: + bool: True if the cursor moved. False otherwise. + """ + previous_index = self.cursor_index + new_index = max(0, previous_index - 1) + self.cursor_index = new_index + return previous_index != new_index + + def cursor_right(self) -> bool: + """Move the cursor 1 character right in the text. Is a noop if the cursor is at end. + + Returns: + bool: True if the cursor moved. False otherwise. + """ + previous_index = self.cursor_index + new_index = min(len(self.content), previous_index + 1) + self.cursor_index = new_index + return previous_index != new_index + + def query_cursor_left(self) -> bool: + """Check if the cursor can move 1 codepoint left in the text. + + Returns: + bool: True if the cursor can move left. False otherwise. + """ + previous_index = self.cursor_index + new_index = max(0, previous_index - 1) + return previous_index != new_index + + def query_cursor_right(self) -> str | None: + """Check if the cursor can move right (we can't move right if we're at the end) + and return the codepoint to the right of the cursor if it exists. If it doesn't + exist (e.g. we're at the end), then return None + + Returns: + str: The codepoint to the right of the cursor if it exists, otherwise None. + """ + previous_index = self.cursor_index + new_index = min(len(self.content), previous_index + 1) + if new_index == len(self.content): + return None + elif previous_index != new_index: + return self.content[new_index] + return None + + def cursor_text_start(self) -> bool: + """Move the cursor to the start of the text + + Returns: + bool: True if the cursor moved. False otherwise. + """ + if self.cursor_index == 0: + return False + + self.cursor_index = 0 + return True + + def cursor_text_end(self) -> bool: + """Move the cursor to the end of the text + + Returns: + bool: True if the cursor moved. False otherwise. + """ + text_length = len(self.content) + if self.cursor_index == text_length: + return False + + self.cursor_index = text_length + return True + + def insert(self, text: str) -> bool: + """Insert some text at the cursor position, and move the cursor + to the end of the newly inserted text. + + Args: + text: The text to insert + + Returns: + bool: Always returns True since text should be insertable regardless of cursor location + """ + new_text = ( + self.content[: self.cursor_index] + text + self.content[self.cursor_index :] + ) + self.content = new_text + self.cursor_index = min(len(self.content), self.cursor_index + len(text)) + return True + + def get_range(self, start: int, end: int) -> str: + """Return the text between 2 indices. Useful for previews/views into + a subset of the content e.g. scrollable single-line input fields + + Args: + start (int): The starting index to return text from (inclusive) + end (int): The index to return text up to (exclusive) + + Returns: + str: The sliced string between start and end. + """ + return self.content[start:end] + + @property + def cursor_at_end(self): + return self.cursor_index == len(self.content) diff --git a/testbed/Textualize__textual/src/textual/_types.py b/testbed/Textualize__textual/src/textual/_types.py new file mode 100644 index 0000000000000000000000000000000000000000..1dd59297cc17e62055c3de062d51cd6b00c61869 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/_types.py @@ -0,0 +1,37 @@ +import sys +from typing import Awaitable, Callable, List, TYPE_CHECKING, Union + +from rich.segment import Segment + +if sys.version_info >= (3, 8): + from typing import Protocol +else: + from typing_extensions import Protocol + + +if TYPE_CHECKING: + from .message import Message + + +class MessageTarget(Protocol): + async def post_message(self, message: "Message") -> bool: + ... + + async def _post_priority_message(self, message: "Message") -> bool: + ... + + def post_message_no_wait(self, message: "Message") -> bool: + ... + + +class EventTarget(Protocol): + async def post_message(self, message: "Message") -> bool: + ... + + def post_message_no_wait(self, message: "Message") -> bool: + ... + + +MessageHandler = Callable[["Message"], Awaitable] +Lines = List[List[Segment]] +CallbackType = Union[Callable[[], Awaitable[None]], Callable[[], None]] diff --git a/testbed/Textualize__textual/src/textual/_xterm_parser.py b/testbed/Textualize__textual/src/textual/_xterm_parser.py new file mode 100644 index 0000000000000000000000000000000000000000..cae6fe1143256136ca03a0e69f9eb612b7428d6c --- /dev/null +++ b/testbed/Textualize__textual/src/textual/_xterm_parser.py @@ -0,0 +1,265 @@ +from __future__ import annotations + +import unicodedata +import re +from typing import Any, Callable, Generator, Iterable + +from . import events +from . import messages +from ._ansi_sequences import ANSI_SEQUENCES_KEYS +from ._parser import Awaitable, Parser, TokenCallback +from ._types import MessageTarget + +# When trying to determine whether the current sequence is a supported/valid +# escape sequence, at which length should we give up and consider our search +# to be unsuccessful? +from .keys import KEY_NAME_REPLACEMENTS + +_MAX_SEQUENCE_SEARCH_THRESHOLD = 20 + +_re_mouse_event = re.compile("^" + re.escape("\x1b[") + r"(\d+);(?P\d)\$y" +) +_re_bracketed_paste_start = re.compile(r"^\x1b\[200~$") +_re_bracketed_paste_end = re.compile(r"^\x1b\[201~$") + + +class XTermParser(Parser[events.Event]): + _re_sgr_mouse = re.compile(r"\x1b\[<(\d+);(\d+);(\d+)([Mm])") + + def __init__( + self, sender: MessageTarget, more_data: Callable[[], bool], debug: bool = False + ) -> None: + self.sender = sender + self.more_data = more_data + self.last_x = 0 + self.last_y = 0 + + self._debug_log_file = open("keys.log", "wt") if debug else None + + super().__init__() + + def debug_log(self, *args: Any) -> None: # pragma: no cover + if self._debug_log_file is not None: + self._debug_log_file.write(" ".join(args) + "\n") + self._debug_log_file.flush() + + def feed(self, data: str) -> Iterable[events.Event]: + self.debug_log(f"FEED {data!r}") + return super().feed(data) + + def parse_mouse_code(self, code: str, sender: MessageTarget) -> events.Event | None: + sgr_match = self._re_sgr_mouse.match(code) + if sgr_match: + _buttons, _x, _y, state = sgr_match.groups() + buttons = int(_buttons) + button = (buttons + 1) & 3 + x = int(_x) - 1 + y = int(_y) - 1 + delta_x = x - self.last_x + delta_y = y - self.last_y + self.last_x = x + self.last_y = y + event: events.Event + if buttons & 64: + event = ( + events.MouseScrollUp if button == 1 else events.MouseScrollDown + )(sender, x, y) + else: + event = ( + events.MouseMove + if buttons & 32 + else (events.MouseDown if state == "M" else events.MouseUp) + )( + sender, + x, + y, + delta_x, + delta_y, + button, + bool(buttons & 4), + bool(buttons & 8), + bool(buttons & 16), + screen_x=x, + screen_y=y, + ) + return event + return None + + def parse(self, on_token: TokenCallback) -> Generator[Awaitable, str, None]: + + ESC = "\x1b" + read1 = self.read1 + sequence_to_key_events = self._sequence_to_key_events + more_data = self.more_data + paste_buffer: list[str] = [] + bracketed_paste = False + use_prior_escape = False + + def reissue_sequence_as_keys(reissue_sequence: str) -> None: + for character in reissue_sequence: + key_events = sequence_to_key_events(character) + for event in key_events: + if event.key == "escape": + event = events.Key(event.sender, "circumflex_accent", "^") + on_token(event) + + while not self.is_eof: + if not bracketed_paste and paste_buffer: + # We're at the end of the bracketed paste. + # The paste buffer has content, but the bracketed paste has finished, + # so we flush the paste buffer. We have to remove the final character + # since if bracketed paste has come to an end, we'll have added the + # ESC from the closing bracket, since at that point we didn't know what + # the full escape code was. + pasted_text = "".join(paste_buffer[:-1]) + on_token(events.Paste(self.sender, text=pasted_text)) + paste_buffer.clear() + + character = ESC if use_prior_escape else (yield read1()) + use_prior_escape = False + + if bracketed_paste: + paste_buffer.append(character) + + self.debug_log(f"character={character!r}") + if character == ESC: + # Could be the escape key was pressed OR the start of an escape sequence + sequence: str = character + if not bracketed_paste: + # TODO: There's nothing left in the buffer at the moment, + # but since we're on an escape, how can we be sure that the + # data that next gets fed to the parser isn't an escape sequence? + + # This problem arises when an ESC falls at the end of a chunk. + # We'll be at an escape, but peek_buffer will return an empty + # string because there's nothing in the buffer yet. + + # This code makes an assumption that an escape sequence will never be + # "chopped up", so buffers would never contain partial escape sequences. + peek_buffer = yield self.peek_buffer() + if not peek_buffer: + # An escape arrived without any following characters + on_token(events.Key(self.sender, "escape", "\x1b")) + continue + if peek_buffer and peek_buffer[0] == ESC: + # There is an escape in the buffer, so ESC ESC has arrived + yield read1() + on_token(events.Key(self.sender, "escape", "\x1b")) + # If there is no further data, it is not part of a sequence, + # So we don't need to go in to the loop + if len(peek_buffer) == 1 and not more_data(): + continue + + # Look ahead through the suspected escape sequence for a match + while True: + + # If we run into another ESC at this point, then we've failed + # to find a match, and should issue everything we've seen within + # the suspected sequence as Key events instead. + sequence_character = yield read1() + new_sequence = sequence + sequence_character + + threshold_exceeded = len(sequence) > _MAX_SEQUENCE_SEARCH_THRESHOLD + found_escape = sequence_character and sequence_character == ESC + + if threshold_exceeded: + # We exceeded the sequence length threshold, so reissue all the + # characters in that sequence as key-presses. + reissue_sequence_as_keys(new_sequence) + break + + if found_escape: + # We've hit an escape, so we need to reissue all the keys + # up to but not including it, since this escape could be + # part of an upcoming control sequence. + use_prior_escape = True + reissue_sequence_as_keys(sequence) + break + + sequence = new_sequence + + self.debug_log(f"sequence={sequence!r}") + + bracketed_paste_start_match = _re_bracketed_paste_start.match( + sequence + ) + if bracketed_paste_start_match is not None: + bracketed_paste = True + break + + bracketed_paste_end_match = _re_bracketed_paste_end.match(sequence) + if bracketed_paste_end_match is not None: + bracketed_paste = False + break + + if not bracketed_paste: + # Was it a pressed key event that we received? + key_events = list(sequence_to_key_events(sequence)) + for event in key_events: + on_token(event) + if key_events: + break + # Or a mouse event? + mouse_match = _re_mouse_event.match(sequence) + if mouse_match is not None: + mouse_code = mouse_match.group(0) + event = self.parse_mouse_code(mouse_code, self.sender) + if event: + on_token(event) + break + + # Or a mode report? + # (i.e. the terminal saying it supports a mode we requested) + mode_report_match = _re_terminal_mode_response.match(sequence) + if mode_report_match is not None: + if ( + mode_report_match["mode_id"] == "2026" + and int(mode_report_match["setting_parameter"]) > 0 + ): + on_token( + messages.TerminalSupportsSynchronizedOutput( + self.sender + ) + ) + break + else: + if not bracketed_paste: + for event in sequence_to_key_events(character): + on_token(event) + + def _sequence_to_key_events( + self, sequence: str, _unicode_name=unicodedata.name + ) -> Iterable[events.Key]: + """Map a sequence of code points on to a sequence of keys. + + Args: + sequence (str): Sequence of code points. + + Returns: + Iterable[events.Key]: keys + + """ + + keys = ANSI_SEQUENCES_KEYS.get(sequence) + if keys is not None: + for key in keys: + yield events.Key( + self.sender, key.value, sequence if len(sequence) == 1 else None + ) + elif len(sequence) == 1: + try: + if not sequence.isalnum(): + name = ( + _unicode_name(sequence) + .lower() + .replace("-", "_") + .replace(" ", "_") + ) + else: + name = sequence + name = KEY_NAME_REPLACEMENTS.get(name, name) + yield events.Key(self.sender, name, sequence) + except: + yield events.Key(self.sender, sequence, sequence) diff --git a/testbed/Textualize__textual/src/textual/actions.py b/testbed/Textualize__textual/src/textual/actions.py new file mode 100644 index 0000000000000000000000000000000000000000..118ce2b51ff9bc1db5889a1435eb1bdf349827df --- /dev/null +++ b/testbed/Textualize__textual/src/textual/actions.py @@ -0,0 +1,52 @@ +from __future__ import annotations + +import ast +from typing import Any, Tuple +import re + + +class ActionError(Exception): + pass + + +re_action_params = re.compile(r"([\w\.]+)(\(.*?\))") + + +def parse(action: str) -> tuple[str, tuple[object, ...]]: + """Parses an action string. + + Args: + action (str): String containing action. + + Raises: + ActionError: If the action has invalid syntax. + + Returns: + tuple[str, tuple[object, ...]]: Action name and parameters + """ + params_match = re_action_params.match(action) + if params_match is not None: + action_name, action_params_str = params_match.groups() + try: + action_params = ast.literal_eval(action_params_str) + except Exception: + raise ActionError( + f"unable to parse {action_params_str!r} in action {action!r}" + ) + else: + action_name = action + action_params = () + + return ( + action_name, + action_params if isinstance(action_params, tuple) else (action_params,), + ) + + +if __name__ == "__main__": + + print(parse("foo")) + + print(parse("view.toggle('side')")) + + print(parse("view.toggle")) diff --git a/testbed/Textualize__textual/src/textual/app.py b/testbed/Textualize__textual/src/textual/app.py new file mode 100644 index 0000000000000000000000000000000000000000..8b452dc5605e1c0b4ad2482d8dc8fd6936921f7a --- /dev/null +++ b/testbed/Textualize__textual/src/textual/app.py @@ -0,0 +1,1632 @@ +from __future__ import annotations + +import asyncio +import inspect +import io +import os +import platform +import sys +import warnings +from contextlib import redirect_stderr, redirect_stdout +from datetime import datetime +from pathlib import Path, PurePath +from time import perf_counter +from typing import Any, Generic, Iterable, Iterator, Type, TypeVar, cast +from weakref import WeakSet, WeakValueDictionary + +from ._ansi_sequences import SYNC_END, SYNC_START +from ._path import _make_path_object_relative + +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal # pragma: no cover + +import nanoid +import rich +import rich.repr +from rich.console import Console, RenderableType +from rich.protocol import is_renderable +from rich.segment import Segment, Segments +from rich.traceback import Traceback + +from . import Logger, LogGroup, LogVerbosity, actions, events, log, messages +from ._animator import Animator, DEFAULT_EASING, Animatable, EasingFunction +from ._callback import invoke +from ._context import active_app +from ._event_broker import NoHandler, extract_handler_actions +from ._filter import LineFilter, Monochrome +from .binding import Bindings, NoBinding +from .css.query import NoMatches +from .css.stylesheet import Stylesheet +from .design import ColorSystem +from .devtools.client import DevtoolsClient, DevtoolsConnectionError, DevtoolsLog +from .devtools.redirect_output import StdoutRedirector +from .dom import DOMNode +from .driver import Driver +from .drivers.headless_driver import HeadlessDriver +from .features import FeatureFlag, parse_features +from .file_monitor import FileMonitor +from .geometry import Offset, Region, Size +from .messages import CallbackType +from .reactive import Reactive +from .renderables.blank import Blank +from .screen import Screen +from .widget import Widget + +PLATFORM = platform.system() +WINDOWS = PLATFORM == "Windows" + +# asyncio will warn against resources not being cleared +warnings.simplefilter("always", ResourceWarning) + +# `asyncio.get_event_loop()` is deprecated since Python 3.10: +_ASYNCIO_GET_EVENT_LOOP_IS_DEPRECATED = sys.version_info >= (3, 10, 0) + +LayoutDefinition = "dict[str, Any]" + + +DEFAULT_COLORS = { + "dark": ColorSystem( + primary="#004578", + secondary="#ffa62b", + warning="#ffa62b", + error="#ba3c5b", + success="#4EBF71", + accent="#0178D4", + dark=True, + ), + "light": ColorSystem( + primary="#004578", + secondary="#ffa62b", + warning="#ffa62b", + error="#ba3c5b", + success="#4EBF71", + accent="#0178D4", + dark=False, + ), +} + + +ComposeResult = Iterable[Widget] +RenderResult = RenderableType + + +class AppError(Exception): + pass + + +class ActionError(Exception): + pass + + +class ScreenError(Exception): + pass + + +class ScreenStackError(ScreenError): + """Raised when attempting to pop the last screen from the stack.""" + + +ReturnType = TypeVar("ReturnType") + + +class _NullFile: + def write(self, text: str) -> None: + pass + + def flush(self) -> None: + pass + + +@rich.repr.auto +class App(Generic[ReturnType], DOMNode): + """The base class for Textual Applications. + + Args: + driver_class (Type[Driver] | None, optional): Driver class or ``None`` to auto-detect. Defaults to None. + title (str | None, optional): Title of the application. If ``None``, the title is set to the name of the ``App`` subclass. Defaults to ``None``. + css_path (str | PurePath | None, optional): Path to CSS or ``None`` for no CSS file. Defaults to None. + watch_css (bool, optional): Watch CSS for changes. Defaults to False. + + """ + + # Inline CSS for quick scripts (generally css_path should be preferred.) + CSS = "" + + # Default (lowest priority) CSS + DEFAULT_CSS = """ + App { + background: $background; + color: $text; + } + """ + + SCREENS: dict[str, Screen] = {} + + _BASE_PATH: str | None = None + CSS_PATH: str | None = None + + focused: Reactive[Widget | None] = Reactive(None) + + def __init__( + self, + driver_class: Type[Driver] | None = None, + title: str | None = None, + css_path: str | PurePath | None = None, + watch_css: bool = False, + ): + # N.B. This must be done *before* we call the parent constructor, because MessagePump's + # constructor instantiates a `asyncio.PriorityQueue` and in Python versions older than 3.10 + # this will create some first references to an asyncio loop. + _init_uvloop() + + super().__init__() + self.features: frozenset[FeatureFlag] = parse_features(os.getenv("TEXTUAL", "")) + + self._filter: LineFilter | None = None + environ = dict(os.environ) + no_color = environ.pop("NO_COLOR", None) + if no_color is not None: + self._filter = Monochrome() + self.console = Console( + file=(_NullFile() if self.is_headless else sys.__stdout__), + markup=False, + highlight=False, + emoji=False, + legacy_windows=False, + _environ=environ, + ) + self.error_console = Console(markup=False, stderr=True) + self.driver_class = driver_class or self.get_driver_class() + self._title = title + self._screen_stack: list[Screen] = [] + self._sync_available = False + + self.mouse_over: Widget | None = None + self.mouse_captured: Widget | None = None + self._driver: Driver | None = None + self._exit_renderables: list[RenderableType] = [] + + self._action_targets = {"app", "screen"} + self._animator = Animator(self) + self._animate = self._animator.bind(self) + self.mouse_position = Offset(0, 0) + if title is None: + self._title = f"{self.__class__.__name__}" + else: + self._title = title + + self._logger = Logger(self._log) + + self._bindings.bind("ctrl+c", "quit", show=False, allow_forward=False) + self._refresh_required = False + + self.design = DEFAULT_COLORS + + self.stylesheet = Stylesheet(variables=self.get_css_variables()) + self._require_stylesheet_update: set[DOMNode] = set() + + # We want the CSS path to be resolved from the location of the App subclass + css_path = css_path or self.CSS_PATH + if css_path is not None: + if isinstance(css_path, str): + css_path = Path(css_path) + css_path = _make_path_object_relative(css_path, self) if css_path else None + + self.css_path = css_path + + self._registry: WeakSet[DOMNode] = WeakSet() + + self._installed_screens: WeakValueDictionary[ + str, Screen + ] = WeakValueDictionary() + self._installed_screens.update(**self.SCREENS) + + self.devtools = DevtoolsClient() + self._return_value: ReturnType | None = None + + self.css_monitor = ( + FileMonitor(self.css_path, self._on_css_change) + if ((watch_css or self.debug) and self.css_path) + else None + ) + self._screenshot: str | None = None + + title: Reactive[str] = Reactive("Textual") + sub_title: Reactive[str] = Reactive("") + dark: Reactive[bool] = Reactive(True) + + def animate( + self, + attribute: str, + value: float | Animatable, + *, + final_value: object = ..., + duration: float | None = None, + speed: float | None = None, + delay: float = 0.0, + easing: EasingFunction | str = DEFAULT_EASING, + on_complete: CallbackType | None = None, + ) -> None: + """Animate an attribute. + + Args: + attribute (str): Name of the attribute to animate. + value (float | Animatable): The value to animate to. + final_value (object, optional): The final value of the animation. Defaults to `value` if not set. + duration (float | None, optional): The duration of the animate. Defaults to None. + speed (float | None, optional): The speed of the animation. Defaults to None. + delay (float, optional): A delay (in seconds) before the animation starts. Defaults to 0.0. + easing (EasingFunction | str, optional): An easing method. Defaults to "in_out_cubic". + on_complete (CallbackType | None, optional): A callable to invoke when the animation is finished. Defaults to None. + + """ + self._animate( + attribute, + value, + final_value=final_value, + duration=duration, + speed=speed, + delay=delay, + easing=easing, + on_complete=on_complete, + ) + + @property + def devtools_enabled(self) -> bool: + """Check if devtools are enabled. + + Returns: + bool: True if devtools are enabled. + + """ + return "devtools" in self.features + + @property + def debug(self) -> bool: + """Check if debug mode is enabled. + + Returns: + bool: True if debug mode is enabled. + + """ + return "debug" in self.features + + @property + def is_headless(self) -> bool: + """Check if the app is running in 'headless' mode. + + Returns: + bool: True if the app is in headless mode. + + """ + return "headless" in self.features + + @property + def screen_stack(self) -> list[Screen]: + """Get a *copy* of the screen stack. + + Returns: + list[Screen]: List of screens. + + """ + return self._screen_stack.copy() + + def exit(self, result: ReturnType | None = None) -> None: + """Exit the app, and return the supplied result. + + Args: + result (ReturnType | None, optional): Return value. Defaults to None. + """ + self._return_value = result + self._close_messages_no_wait() + + @property + def focus_chain(self) -> list[Widget]: + """Get widgets that may receive focus, in focus order. + + Returns: + list[Widget]: List of Widgets in focus order. + + """ + widgets: list[Widget] = [] + add_widget = widgets.append + root = self.screen + stack: list[Iterator[Widget]] = [iter(root.focusable_children)] + pop = stack.pop + push = stack.append + + while stack: + node = next(stack[-1], None) + if node is None: + pop() + else: + if node.is_container and node.can_focus_children: + push(iter(node.focusable_children)) + else: + if node.can_focus: + add_widget(node) + + return widgets + + @property + def bindings(self) -> Bindings: + """Get current bindings.""" + if self.focused is None: + return self._bindings + else: + return Bindings.merge( + node._bindings for node in reversed(self.focused.ancestors) + ) + + def _set_active(self) -> None: + """Set this app to be the currently active app.""" + active_app.set(self) + + def _move_focus(self, direction: int = 0) -> Widget | None: + """Move the focus in the given direction. + + Args: + direction (int, optional): 1 to move forward, -1 to move backward, or + 0 to highlight the current focus. + + Returns: + Widget | None: Newly focused widget, or None for no focus. + """ + focusable_widgets = self.focus_chain + + if not focusable_widgets: + # Nothing focusable, so nothing to do + return self.focused + if self.focused is None: + # Nothing currently focused, so focus the first one + self.set_focus(focusable_widgets[0]) + else: + try: + # Find the index of the currently focused widget + current_index = focusable_widgets.index(self.focused) + except ValueError: + # Focused widget was removed in the interim, start again + self.set_focus(focusable_widgets[0]) + else: + # Only move the focus if we are currently showing the focus + if direction: + current_index = (current_index + direction) % len(focusable_widgets) + self.set_focus(focusable_widgets[current_index]) + + return self.focused + + def show_focus(self) -> Widget | None: + """Highlight the currently focused widget. + + Returns: + Widget | None: Focused widget, or None for no focus. + """ + return self._move_focus(0) + + def focus_next(self) -> Widget | None: + """Focus the next widget. + + Returns: + Widget | None: Newly focused widget, or None for no focus. + """ + return self._move_focus(1) + + def focus_previous(self) -> Widget | None: + """Focus the previous widget. + + Returns: + Widget | None: Newly focused widget, or None for no focus. + """ + return self._move_focus(-1) + + def compose(self) -> ComposeResult: + """Yield child widgets for a container.""" + return + yield + + def get_css_variables(self) -> dict[str, str]: + """Get a mapping of variables used to pre-populate CSS. + + Returns: + dict[str, str]: A mapping of variable name to value. + """ + variables = self.design["dark" if self.dark else "light"].generate() + return variables + + def watch_dark(self, dark: bool) -> None: + """Watches the dark bool.""" + + self.screen.dark = dark + if dark: + self.add_class("-dark-mode") + self.remove_class("-light-mode") + else: + self.remove_class("-dark-mode") + self.add_class("-light-mode") + + self.refresh_css() + + def get_driver_class(self) -> Type[Driver]: + """Get a driver class for this platform. + + Called by the constructor. + + Returns: + Driver: A Driver class which manages input and display. + """ + driver_class: Type[Driver] + if WINDOWS: + from .drivers.windows_driver import WindowsDriver + + driver_class = WindowsDriver + else: + from .drivers.linux_driver import LinuxDriver + + driver_class = LinuxDriver + return driver_class + + def __rich_repr__(self) -> rich.repr.Result: + yield "title", self.title + yield "id", self.id, None + if self.name: + yield "name", self.name + if self.classes: + yield "classes", set(self.classes) + pseudo_classes = self.pseudo_classes + if pseudo_classes: + yield "pseudo_classes", set(pseudo_classes) + + @property + def is_transparent(self) -> bool: + return True + + @property + def animator(self) -> Animator: + return self._animator + + @property + def screen(self) -> Screen: + """Get the current screen. + + Raises: + ScreenStackError: If there are no screens on the stack. + + Returns: + Screen: The currently active screen. + """ + try: + return self._screen_stack[-1] + except IndexError: + raise ScreenStackError("No screens on stack") from None + + @property + def size(self) -> Size: + """Get the size of the terminal. + + Returns: + Size: Size of the terminal + """ + return Size(*self.console.size) + + @property + def log(self) -> Logger: + return self._logger + + def _log( + self, + group: LogGroup, + verbosity: LogVerbosity, + *objects: Any, + _textual_calling_frame: inspect.FrameInfo | None = None, + **kwargs, + ) -> None: + """Write to logs or devtools. + + Positional args will logged. Keyword args will be prefixed with the key. + + Example: + ```python + data = [1,2,3] + self.log("Hello, World", state=data) + self.log(self.tree) + self.log(locals()) + ``` + + Args: + verbosity (int, optional): Verbosity level 0-3. Defaults to 1. + """ + + if not self.devtools.is_connected: + return + + if verbosity.value > LogVerbosity.NORMAL.value and not self.devtools.verbose: + return + + if not _textual_calling_frame: + _textual_calling_frame = inspect.stack()[1] + + try: + if len(objects) == 1 and not kwargs: + self.devtools.log( + DevtoolsLog(objects, caller=_textual_calling_frame), + group, + verbosity, + ) + else: + output = " ".join(str(arg) for arg in objects) + if kwargs: + key_values = " ".join( + f"{key}={value!r}" for key, value in kwargs.items() + ) + output = f"{output} {key_values}" if output else key_values + self.devtools.log( + DevtoolsLog(output, caller=_textual_calling_frame), + group, + verbosity, + ) + except Exception as error: + self._handle_exception(error) + + def action_toggle_dark(self) -> None: + """Action to toggle dark mode.""" + self.dark = not self.dark + + def action_screenshot(self, filename: str | None, path: str = "~/") -> None: + """Save an SVG "screenshot". This action will save a SVG file containing the current contents of the screen. + + Args: + filename (str | None, optional): Filename of screenshot, or None to auto-generate. Defaults to None. + path (str, optional): Path to directory. Defaults to "~/". + """ + self.save_screenshot(filename, path) + + def export_screenshot(self, *, title: str | None = None) -> str: + """Export a SVG screenshot of the current screen. + + Args: + title (str | None, optional): The title of the exported screenshot or None + to use app title. Defaults to None. + + """ + + console = Console( + width=self.console.width, + height=self.console.height, + file=io.StringIO(), + force_terminal=True, + color_system="truecolor", + record=True, + legacy_windows=False, + ) + screen_render = self.screen._compositor.render(full=True) + console.print(screen_render) + return console.export_svg(title=title or self.title) + + def save_screenshot( + self, + filename: str | None = None, + path: str = "./", + time_format: str = "%Y-%m-%d %X %f", + ) -> str: + """Save a SVG screenshot of the current screen. + + Args: + filename (str | None, optional): Filename of SVG screenshot, or None to auto-generate + a filename with the date and time. Defaults to None. + path (str, optional): Path to directory for output. Defaults to current working directory. + time_format (str, optional): Time format to use if filename is None. Defaults to "%Y-%m-%d %X %f". + + Returns: + str: Filename of screenshot. + """ + if filename is None: + svg_filename = ( + f"{self.title.lower()} {datetime.now().strftime(time_format)}.svg" + ) + svg_filename = svg_filename.replace("/", "_").replace("\\", "_") + else: + svg_filename = filename + svg_path = os.path.expanduser(os.path.join(path, svg_filename)) + screenshot_svg = self.export_screenshot() + with open(svg_path, "w") as svg_file: + svg_file.write(screenshot_svg) + return svg_path + + def bind( + self, + keys: str, + action: str, + *, + description: str = "", + show: bool = True, + key_display: str | None = None, + ) -> None: + """Bind a key to an action. + + Args: + keys (str): A comma separated list of keys, i.e. + action (str): Action to bind to. + description (str, optional): Short description of action. Defaults to "". + show (bool, optional): Show key in UI. Defaults to True. + key_display (str, optional): Replacement text for key, or None to use default. Defaults to None. + """ + self._bindings.bind( + keys, action, description, show=show, key_display=key_display + ) + + def run( + self, + *, + quit_after: float | None = None, + headless: bool = False, + press: Iterable[str] | None = None, + screenshot: bool = False, + screenshot_title: str | None = None, + ) -> ReturnType | None: + """The main entry point for apps. + + Args: + quit_after (float | None, optional): Quit after a given number of seconds, or None + to run forever. Defaults to None. + headless (bool, optional): Run in "headless" mode (don't write to stdout). + press (str, optional): An iterable of keys to simulate being pressed. + screenshot (bool, optional): Take a screenshot after pressing keys (svg data stored in self._screenshot). Defaults to False. + screenshot_title (str | None, optional): Title of screenshot, or None to use App title. Defaults to None. + + Returns: + ReturnType | None: The return value specified in `App.exit` or None if exit wasn't called. + """ + + if headless: + self.features = cast( + "frozenset[FeatureFlag]", self.features.union({"headless"}) + ) + + async def run_app() -> None: + if quit_after is not None: + self.set_timer(quit_after, self.shutdown) + if press is not None: + app = self + + async def press_keys() -> None: + """A task to send key events.""" + assert press + driver = app._driver + assert driver is not None + await asyncio.sleep(0.01) + for key in press: + if key == "_": + print("(pause 50ms)") + await asyncio.sleep(0.05) + elif key.startswith("wait:"): + _, wait_ms = key.split(":") + print(f"(pause {wait_ms}ms)") + await asyncio.sleep(float(wait_ms) / 1000) + else: + print(f"press {key!r}") + driver.send_event( + events.Key(self, key, key if len(key) == 1 else None) + ) + await asyncio.sleep(0.01) + + await app._animator.wait_for_idle() + + if screenshot: + self._screenshot = self.export_screenshot( + title=screenshot_title + ) + await self.shutdown() + + async def press_keys_task(): + """Press some keys in the background.""" + asyncio.create_task(press_keys()) + + await self._process_messages(ready_callback=press_keys_task) + else: + await self._process_messages() + + if _ASYNCIO_GET_EVENT_LOOP_IS_DEPRECATED: + # N.B. This doesn't work with Python<3.10, as we end up with 2 event loops: + asyncio.run(run_app()) + else: + # However, this works with Python<3.10: + event_loop = asyncio.get_event_loop() + event_loop.run_until_complete(run_app()) + + return self._return_value + + async def _on_css_change(self) -> None: + """Called when the CSS changes (if watch_css is True).""" + if self.css_path is not None: + try: + time = perf_counter() + stylesheet = self.stylesheet.copy() + stylesheet.read(self.css_path) + stylesheet.parse() + elapsed = (perf_counter() - time) * 1000 + self.log.system( + f" loaded {self.css_path!r} in {elapsed:.0f} ms" + ) + except Exception as error: + # TODO: Catch specific exceptions + self.log.error(error) + self.bell() + else: + self.stylesheet = stylesheet + self.reset_styles() + self.stylesheet.update(self) + self.screen.refresh(layout=True) + + def render(self) -> RenderableType: + return Blank(self.styles.background) + + def get_child(self, id: str) -> DOMNode: + """Shorthand for self.screen.get_child(id: str) + Returns the first child (immediate descendent) of this DOMNode + with the given ID. + + Args: + id (str): The ID of the node to search for. + + Returns: + DOMNode: The first child of this node with the specified ID. + + Raises: + NoMatches: if no children could be found for this ID + """ + return self.screen.get_child(id) + + def update_styles(self, node: DOMNode | None = None) -> None: + """Request update of styles. + + Should be called whenever CSS classes / pseudo classes change. + + """ + self._require_stylesheet_update.add(self.screen if node is None else node) + self.check_idle() + + def update_visible_styles(self) -> None: + """Update visible styles only.""" + self._require_stylesheet_update.update(self.screen.visible_widgets) + self.check_idle() + + def mount(self, *anon_widgets: Widget, **widgets: Widget) -> None: + """Mount widgets. Widgets specified as positional args, or keywords args. If supplied + as keyword args they will be assigned an id of the key. + + """ + self._register(self.screen, *anon_widgets, **widgets) + + def mount_all(self, widgets: Iterable[Widget]) -> None: + """Mount widgets from an iterable. + + Args: + widgets (Iterable[Widget]): An iterable of widgets. + """ + for widget in widgets: + self._register(self.screen, widget) + + def is_screen_installed(self, screen: Screen | str) -> bool: + """Check if a given screen has been installed. + + Args: + screen (Screen | str): Either a Screen object or screen name (the `name` argument when installed). + + Returns: + bool: True if the screen is currently installed, + """ + if isinstance(screen, str): + return screen in self._installed_screens + else: + return screen in self._installed_screens.values() + + def get_screen(self, screen: Screen | str) -> Screen: + """Get an installed screen. + + If the screen isn't running, it will be registered before it is run. + + Args: + screen (Screen | str): Either a Screen object or screen name (the `name` argument when installed). + + Raises: + KeyError: If the named screen doesn't exist. + + Returns: + Screen: A screen instance. + """ + if isinstance(screen, str): + try: + next_screen = self._installed_screens[screen] + except KeyError: + raise KeyError(f"No screen called {screen!r} installed") from None + else: + next_screen = screen + if not next_screen.is_running: + self._register(self, next_screen) + return next_screen + + def _replace_screen(self, screen: Screen) -> Screen: + """Handle the replaced screen. + + Args: + screen (Screen): A screen object. + + Returns: + Screen: The screen that was replaced. + + """ + screen.post_message_no_wait(events.ScreenSuspend(self)) + self.log.system(f"{screen} SUSPENDED") + if not self.is_screen_installed(screen) and screen not in self._screen_stack: + screen.remove() + self.log.system(f"{screen} REMOVED") + return screen + + def push_screen(self, screen: Screen | str) -> None: + """Push a new screen on the screen stack. + + Args: + screen (Screen | str): A Screen instance or the name of an installed screen. + + """ + next_screen = self.get_screen(screen) + self._screen_stack.append(next_screen) + self.screen.post_message_no_wait(events.ScreenResume(self)) + self.log.system(f"{self.screen} is current (PUSHED)") + + def switch_screen(self, screen: Screen | str) -> None: + """Switch to a another screen by replacing the top of the screen stack with a new screen. + + Args: + screen (Screen | str): Either a Screen object or screen name (the `name` argument when installed). + + """ + if self.screen is not screen: + self._replace_screen(self._screen_stack.pop()) + next_screen = self.get_screen(screen) + self._screen_stack.append(next_screen) + self.screen.post_message_no_wait(events.ScreenResume(self)) + self.log.system(f"{self.screen} is current (SWITCHED)") + + def install_screen(self, screen: Screen, name: str | None = None) -> str: + """Install a screen. + + Args: + screen (Screen): Screen to install. + name (str | None, optional): Unique name of screen or None to auto-generate. + Defaults to None. + + Raises: + ScreenError: If the screen can't be installed. + + Returns: + str: The name of the screen + """ + if name is None: + name = nanoid.generate() + if name in self._installed_screens: + raise ScreenError(f"Can't install screen; {name!r} is already installed") + if screen in self._installed_screens.values(): + raise ScreenError( + "Can't install screen; {screen!r} has already been installed" + ) + self._installed_screens[name] = screen + self.get_screen(name) # Ensures screen is running + self.log.system(f"{screen} INSTALLED name={name!r}") + return name + + def uninstall_screen(self, screen: Screen | str) -> str | None: + """Uninstall a screen. If the screen was not previously installed then this + method is a null-op. + + Args: + screen (Screen | str): The screen to uninstall or the name of a installed screen. + + Returns: + str | None: The name of the screen that was uninstalled, or None if no screen was uninstalled. + """ + if isinstance(screen, str): + if screen not in self._installed_screens: + return None + uninstall_screen = self._installed_screens[screen] + if uninstall_screen in self._screen_stack: + raise ScreenStackError("Can't uninstall screen in screen stack") + del self._installed_screens[screen] + self.log.system(f"{uninstall_screen} UNINSTALLED name={screen!r}") + return screen + else: + if screen in self._screen_stack: + raise ScreenStackError("Can't uninstall screen in screen stack") + for name, installed_screen in self._installed_screens.items(): + if installed_screen is screen: + self._installed_screens.pop(name) + self.log.system(f"{screen} UNINSTALLED name={name!r}") + return name + return None + + def pop_screen(self) -> Screen: + """Pop the current screen from the stack, and switch to the previous screen. + + Returns: + Screen: The screen that was replaced. + """ + screen_stack = self._screen_stack + if len(screen_stack) <= 1: + raise ScreenStackError( + "Can't pop screen; there must be at least one screen on the stack" + ) + previous_screen = self._replace_screen(screen_stack.pop()) + self.screen._screen_resized(self.size) + self.screen.post_message_no_wait(events.ScreenResume(self)) + self.log.system(f"{self.screen} is active") + return previous_screen + + def set_focus(self, widget: Widget | None, scroll_visible: bool = True) -> None: + """Focus (or unfocus) a widget. A focused widget will receive key events first. + + Args: + widget (Widget): Widget to focus. + scroll_visible (bool, optional): Scroll widget in to view. + """ + if widget is self.focused: + # Widget is already focused + return + + if widget is None: + # No focus, so blur currently focused widget if it exists + if self.focused is not None: + self.focused.post_message_no_wait(events.Blur(self)) + self.focused.emit_no_wait(events.DescendantBlur(self)) + self.focused = None + elif widget.can_focus: + if self.focused != widget: + if self.focused is not None: + # Blur currently focused widget + self.focused.post_message_no_wait(events.Blur(self)) + self.focused.emit_no_wait(events.DescendantBlur(self)) + # Change focus + self.focused = widget + # Send focus event + if scroll_visible: + self.screen.scroll_to_widget(widget) + widget.post_message_no_wait(events.Focus(self)) + widget.emit_no_wait(events.DescendantFocus(self)) + + def _reset_focus(self, widget: Widget) -> None: + """Reset the focus when a widget is removed + + Args: + widget (Widget): A widget that is removed. + """ + for sibling in widget.siblings: + if sibling.can_focus: + sibling.focus() + break + else: + self.focused = None + + async def _set_mouse_over(self, widget: Widget | None) -> None: + """Called when the mouse is over another widget. + + Args: + widget (Widget | None): Widget under mouse, or None for no widgets. + """ + if widget is None: + if self.mouse_over is not None: + try: + await self.mouse_over.post_message(events.Leave(self)) + finally: + self.mouse_over = None + else: + if self.mouse_over is not widget: + try: + if self.mouse_over is not None: + await self.mouse_over._forward_event(events.Leave(self)) + if widget is not None: + await widget._forward_event(events.Enter(self)) + finally: + self.mouse_over = widget + + def capture_mouse(self, widget: Widget | None) -> None: + """Send all mouse events to the given widget, disable mouse capture. + + Args: + widget (Widget | None): If a widget, capture mouse event, or None to end mouse capture. + """ + if widget == self.mouse_captured: + return + if self.mouse_captured is not None: + self.mouse_captured.post_message_no_wait( + events.MouseRelease(self, self.mouse_position) + ) + self.mouse_captured = widget + if widget is not None: + widget.post_message_no_wait(events.MouseCapture(self, self.mouse_position)) + + def panic(self, *renderables: RenderableType) -> None: + """Exits the app then displays a message. + + Args: + *renderables (RenderableType, optional): Rich renderables to display on exit. + """ + + assert all( + is_renderable(renderable) for renderable in renderables + ), "Can only call panic with strings or Rich renderables" + + def render(renderable: RenderableType) -> list[Segment]: + """Render a panic renderables.""" + segments = list(self.console.render(renderable, self.console.options)) + return segments + + pre_rendered = [Segments(render(renderable)) for renderable in renderables] + self._exit_renderables.extend(pre_rendered) + self._close_messages_no_wait() + + def _handle_exception(self, error: Exception) -> None: + """Called with an unhandled exception. + + Args: + error (Exception): An exception instance. + """ + + if hasattr(error, "__rich__"): + # Exception has a rich method, so we can defer to that for the rendering + self.panic(error) + else: + # Use default exception rendering + self.fatal_error() + + def fatal_error(self) -> None: + """Exits the app after an unhandled exception.""" + self.bell() + traceback = Traceback( + show_locals=True, width=None, locals_max_length=5, suppress=[rich] + ) + self._exit_renderables.append( + Segments(self.console.render(traceback, self.console.options)) + ) + self._close_messages_no_wait() + + def _print_error_renderables(self) -> None: + for renderable in self._exit_renderables: + self.error_console.print(renderable) + self._exit_renderables.clear() + + async def _process_messages( + self, ready_callback: CallbackType | None = None + ) -> None: + self._set_active() + + if self.devtools_enabled: + try: + await self.devtools.connect() + self.log.system(f"Connected to devtools ( {self.devtools.url} )") + except DevtoolsConnectionError: + self.log.system(f"Couldn't connect to devtools ( {self.devtools.url} )") + + self.log.system("---") + + self.log.system(driver=self.driver_class) + self.log.system(loop=asyncio.get_running_loop()) + self.log.system(features=self.features) + + try: + if self.css_path is not None: + self.stylesheet.read(self.css_path) + for path, css, tie_breaker in self.get_default_css(): + self.stylesheet.add_source( + css, path=path, is_default_css=True, tie_breaker=tie_breaker + ) + if self.CSS: + try: + app_css_path = ( + f"{inspect.getfile(self.__class__)}:{self.__class__.__name__}" + ) + except TypeError: + app_css_path = f"{self.__class__.__name__}" + self.stylesheet.add_source( + self.CSS, path=app_css_path, is_default_css=False + ) + except Exception as error: + self._handle_exception(error) + self._print_error_renderables() + return + + if self.css_monitor: + self.set_interval(0.25, self.css_monitor, name="css monitor") + self.log.system("[b green]STARTED[/]", self.css_monitor) + + process_messages = super()._process_messages + + async def run_process_messages(): + compose_event = events.Compose(sender=self) + await self._dispatch_message(compose_event) + mount_event = events.Mount(sender=self) + await self._dispatch_message(mount_event) + + Reactive.initialize_object(self) + self.title = self._title + self.stylesheet.update(self) + self.refresh() + await self.animator.start() + await self._ready() + if ready_callback is not None: + await ready_callback() + await process_messages() + await self.animator.stop() + await self._close_all() + + self._running = True + try: + load_event = events.Load(sender=self) + await self._dispatch_message(load_event) + + driver: Driver + driver_class = cast( + "type[Driver]", + HeadlessDriver if self.is_headless else self.driver_class, + ) + driver = self._driver = driver_class(self.console, self) + + driver.start_application_mode() + try: + if self.is_headless: + await run_process_messages() + else: + redirector = StdoutRedirector(self.devtools) + with redirect_stderr(redirector): + with redirect_stdout(redirector): # type: ignore + await run_process_messages() + finally: + driver.stop_application_mode() + except Exception as error: + self._handle_exception(error) + finally: + self._running = False + self._print_error_renderables() + if self.devtools.is_connected: + await self._disconnect_devtools() + + async def _ready(self) -> None: + """Called immediately prior to processing messages. + + May be used as a hook for any operations that should run first. + + """ + try: + screenshot_timer = float(os.environ.get("TEXTUAL_SCREENSHOT", "0")) + except ValueError: + return + + screenshot_title = os.environ.get("TEXTUAL_SCREENSHOT_TITLE") + + if not screenshot_timer: + return + + async def on_screenshot(): + """Used by docs plugin.""" + svg = self.export_screenshot(title=screenshot_title) + self._screenshot = svg # type: ignore + await self.shutdown() + + self.set_timer(screenshot_timer, on_screenshot, name="screenshot timer") + + def _on_compose(self) -> None: + widgets = self.compose() + self.mount_all(widgets) + + def _on_idle(self) -> None: + """Perform actions when there are no messages in the queue.""" + if self._require_stylesheet_update: + nodes: set[DOMNode] = { + child + for node in self._require_stylesheet_update + for child in node.walk_children() + } + self._require_stylesheet_update.clear() + self.stylesheet.update_nodes(nodes, animate=True) + + def _register_child(self, parent: DOMNode, child: Widget) -> bool: + if child not in self._registry: + parent.children._append(child) + self._registry.add(child) + child._attach(parent) + child._post_register(self) + child._start_messages() + return True + return False + + def _register( + self, parent: DOMNode, *anon_widgets: Widget, **widgets: Widget + ) -> None: + """Mount widget(s) so they may receive events. + + Args: + parent (Widget): Parent Widget + """ + if not anon_widgets and not widgets: + return + name_widgets: Iterable[tuple[str | None, Widget]] + name_widgets = [*((None, widget) for widget in anon_widgets), *widgets.items()] + apply_stylesheet = self.stylesheet.apply + + for widget_id, widget in name_widgets: + if not isinstance(widget, Widget): + raise AppError(f"Can't register {widget!r}; expected a Widget instance") + if widget not in self._registry: + if widget_id is not None: + widget.id = widget_id + self._register_child(parent, widget) + if widget.children: + self._register(widget, *widget.children) + apply_stylesheet(widget) + + for _widget_id, widget in name_widgets: + widget.post_message_no_wait(events.Mount(sender=parent)) + + def _unregister(self, widget: Widget) -> None: + """Unregister a widget. + + Args: + widget (Widget): A Widget to unregister + """ + self._reset_focus(widget) + + if isinstance(widget._parent, Widget): + widget._parent.children._remove(widget) + widget._detach() + self._registry.discard(widget) + + async def _disconnect_devtools(self): + await self.devtools.disconnect() + + def _start_widget(self, parent: Widget, widget: Widget) -> None: + """Start a widget (run it's task) so that it can receive messages. + + Args: + parent (Widget): The parent of the Widget. + widget (Widget): The Widget to start. + """ + widget._attach(parent) + widget._start_messages() + widget.post_message_no_wait(events.Mount(sender=parent)) + + def is_mounted(self, widget: Widget) -> bool: + return widget in self._registry + + async def _close_all(self) -> None: + while self._registry: + child = self._registry.pop() + await child._close_messages() + + async def shutdown(self): + await self._disconnect_devtools() + driver = self._driver + if driver is not None: + driver.disable_input() + await self._close_messages() + + def refresh(self, *, repaint: bool = True, layout: bool = False) -> None: + if self._screen_stack: + self.screen.refresh(repaint=repaint, layout=layout) + self.check_idle() + + def refresh_css(self, animate: bool = True) -> None: + """Refresh CSS. + + Args: + animate (bool, optional): Also execute CSS animations. Defaults to True. + """ + stylesheet = self.app.stylesheet + stylesheet.set_variables(self.get_css_variables()) + stylesheet.reparse() + stylesheet.update(self.app, animate=animate) + self.screen._refresh_layout(self.size, full=True) + + def _display(self, screen: Screen, renderable: RenderableType | None) -> None: + """Display a renderable within a sync. + + Args: + screen (Screen): Screen instance + renderable (RenderableType): A Rich renderable. + """ + if screen is not self.screen or renderable is None: + return + if self._running and not self._closed and not self.is_headless: + console = self.console + self._begin_update() + try: + try: + console.print(renderable) + except Exception as error: + self._handle_exception(error) + finally: + self._end_update() + console.file.flush() + + def get_widget_at(self, x: int, y: int) -> tuple[Widget, Region]: + """Get the widget under the given coordinates. + + Args: + x (int): X Coord. + y (int): Y Coord. + + Returns: + tuple[Widget, Region]: The widget and the widget's screen region. + """ + return self.screen.get_widget_at(x, y) + + def bell(self) -> None: + """Play the console 'bell'.""" + if not self.is_headless: + self.console.bell() + + async def press(self, key: str) -> bool: + """Handle a key press. + + Args: + key (str): A key + + Returns: + bool: True if the key was handled by a binding, otherwise False + """ + try: + binding = self.bindings.get_key(key) + except NoBinding: + return False + else: + await self.action(binding.action) + return True + + async def on_event(self, event: events.Event) -> None: + # Handle input events that haven't been forwarded + # If the event has been forwarded it may have bubbled up back to the App + if isinstance(event, events.Compose): + screen = Screen(id="_default") + self._register(self, screen) + self._screen_stack.append(screen) + await super().on_event(event) + + elif isinstance(event, events.InputEvent) and not event.is_forwarded: + if isinstance(event, events.MouseEvent): + # Record current mouse position on App + self.mouse_position = Offset(event.x, event.y) + if isinstance(event, events.Key) and self.focused is not None: + # Key events are sent direct to focused widget + if self.bindings.allow_forward(event.key): + await self.focused._forward_event(event) + else: + # Key has allow_forward=False which disallows forward to focused widget + await super().on_event(event) + else: + # Forward the event to the view + await self.screen._forward_event(event) + elif isinstance(event, events.Paste): + if self.focused is not None: + await self.focused._forward_event(event) + else: + await super().on_event(event) + + async def action( + self, + action: str | tuple[str, tuple[str, ...]], + default_namespace: object | None = None, + ) -> bool: + """Perform an action. + + Args: + action (str): Action encoded in a string. + default_namespace (object | None): Namespace to use if not provided in the action, + or None to use app. Defaults to None. + + Returns: + bool: True if the event has handled. + """ + if isinstance(action, str): + target, params = actions.parse(action) + else: + target, params = action + implicit_destination = True + if "." in target: + destination, action_name = target.split(".", 1) + if destination not in self._action_targets: + raise ActionError("Action namespace {destination} is not known") + action_target = getattr(self, destination) + implicit_destination = True + else: + action_target = default_namespace or self + action_name = target + + handled = await self._dispatch_action(action_target, action_name, params) + if not handled and implicit_destination and not isinstance(action_target, App): + handled = await self.app._dispatch_action(self.app, action_name, params) + return handled + + async def _dispatch_action( + self, namespace: object, action_name: str, params: Any + ) -> bool: + log( + "", + namespace=namespace, + action_name=action_name, + params=params, + ) + _rich_traceback_guard = True + method_name = f"action_{action_name}" + method = getattr(namespace, method_name, None) + if method is None: + log(f" {action_name!r} has no target") + if callable(method): + await invoke(method, *params) + return True + return False + + async def _broker_event( + self, event_name: str, event: events.Event, default_namespace: object | None + ) -> bool: + """Allow the app an opportunity to dispatch events to action system. + + Args: + event_name (str): _description_ + event (events.Event): An event object. + default_namespace (object | None): TODO: _description_ + + Returns: + bool: True if an action was processed. + """ + try: + style = getattr(event, "style") + except AttributeError: + return False + try: + _modifiers, action = extract_handler_actions(event_name, style.meta) + except NoHandler: + return False + else: + event.stop() + if isinstance(action, (str, tuple)): + await self.action(action, default_namespace=default_namespace) + elif callable(action): + await action() + else: + return False + return True + + async def _on_update(self, message: messages.Update) -> None: + message.stop() + + async def _on_layout(self, message: messages.Layout) -> None: + message.stop() + + async def _on_key(self, event: events.Key) -> None: + if event.key == "tab": + self.focus_next() + elif event.key == "shift+tab": + self.focus_previous() + else: + if not (await self.press(event.key)): + await self.dispatch_key(event) + + async def _on_shutdown_request(self, event: events.ShutdownRequest) -> None: + log("shutdown request") + await self._close_messages() + + async def _on_resize(self, event: events.Resize) -> None: + event.stop() + self.screen._screen_resized(event.size) + await self.screen.post_message(event) + + async def _on_remove(self, event: events.Remove) -> None: + widget = event.widget + parent = widget.parent + if parent is not None: + parent.refresh(layout=True) + + remove_widgets = list(widget.walk_children(Widget, with_self=True)) + for child in remove_widgets: + self._unregister(child) + for child in remove_widgets: + await child._close_messages() + + async def action_press(self, key: str) -> None: + await self.press(key) + + async def action_quit(self) -> None: + """Quit the app as soon as possible.""" + await self.shutdown() + + async def action_bang(self) -> None: + 1 / 0 + + async def action_bell(self) -> None: + """Play the terminal 'bell'.""" + self.bell() + + async def action_focus(self, widget_id: str) -> None: + """Focus the given widget. + + Args: + widget_id (str): ID of widget to focus. + """ + try: + node = self.query(f"#{widget_id}").first() + except NoMatches: + pass + else: + if isinstance(node, Widget): + self.set_focus(node) + + async def action_switch_screen(self, screen: str) -> None: + """Switches to another screen. + + Args: + screen (str): Name of the screen. + """ + self.switch_screen(screen) + + async def action_push_screen(self, screen: str) -> None: + """Pushes a screen on to the screen stack and makes it active. + + Args: + screen (str): Name of the screen. + """ + self.push_screen(screen) + + async def action_pop_screen(self) -> None: + """Removes the topmost screen and makes the new topmost screen active.""" + self.pop_screen() + + async def action_back(self) -> None: + try: + self.pop_screen() + except ScreenStackError: + pass + + async def action_add_class_(self, selector: str, class_name: str) -> None: + self.screen.query(selector).add_class(class_name) + + async def action_remove_class_(self, selector: str, class_name: str) -> None: + self.screen.query(selector).remove_class(class_name) + + async def action_toggle_class(self, selector: str, class_name: str) -> None: + self.screen.query(selector).toggle_class(class_name) + + def _on_terminal_supports_synchronized_output( + self, message: messages.TerminalSupportsSynchronizedOutput + ) -> None: + log.system("[b green]SynchronizedOutput mode is supported") + self._sync_available = True + + def _begin_update(self) -> None: + if self._sync_available: + self.console.file.write(SYNC_START) + + def _end_update(self) -> None: + if self._sync_available: + self.console.file.write(SYNC_END) + + +_uvloop_init_done: bool = False + + +def _init_uvloop() -> None: + """ + Import and install the `uvloop` asyncio policy, if available. + This is done only once, even if the function is called multiple times. + """ + global _uvloop_init_done + + if _uvloop_init_done: + return + + try: + import uvloop + except ImportError: + pass + else: + uvloop.install() + + _uvloop_init_done = True diff --git a/testbed/Textualize__textual/src/textual/binding.py b/testbed/Textualize__textual/src/textual/binding.py new file mode 100644 index 0000000000000000000000000000000000000000..498201c7635464a7da3b95dc241314eb58b6c957 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/binding.py @@ -0,0 +1,129 @@ +from __future__ import annotations + +import sys +from dataclasses import dataclass +from typing import Iterable, MutableMapping + +import rich.repr + +if sys.version_info >= (3, 10): + from typing import TypeAlias +else: # pragma: no cover + from typing_extensions import TypeAlias + +BindingType: TypeAlias = "Binding | tuple[str, str, str]" + + +class BindingError(Exception): + """A binding related error.""" + + +class NoBinding(Exception): + """A binding was not found.""" + + +@dataclass(frozen=True) +class Binding: + key: str + """Key to bind. This can also be a comma-separated list of keys to map multiple keys to a single action.""" + action: str + """Action to bind to.""" + description: str + """Description of action.""" + show: bool = True + """Show the action in Footer, or False to hide.""" + key_display: str | None = None + """How the key should be shown in footer.""" + allow_forward: bool = True + """Allow forwarding from app to focused widget.""" + + +@rich.repr.auto +class Bindings: + """Manage a set of bindings.""" + + def __init__(self, bindings: Iterable[BindingType] | None = None) -> None: + def make_bindings(bindings: Iterable[BindingType]) -> Iterable[Binding]: + for binding in bindings: + if isinstance(binding, Binding): + binding_keys = binding.key.split(",") + if len(binding_keys) > 1: + for key in binding_keys: + new_binding = Binding( + key=key, + action=binding.action, + description=binding.description, + show=binding.show, + key_display=binding.key_display, + allow_forward=binding.allow_forward, + ) + yield new_binding + else: + yield binding + else: + if len(binding) != 3: + raise BindingError( + f"BINDINGS must contain a tuple of three strings, not {binding!r}" + ) + yield Binding(*binding) + + self.keys: MutableMapping[str, Binding] = ( + {binding.key: binding for binding in make_bindings(bindings)} + if bindings + else {} + ) + + def __rich_repr__(self) -> rich.repr.Result: + yield self.keys + + @classmethod + def merge(cls, bindings: Iterable[Bindings]) -> Bindings: + """Merge a bindings. Subsequence bound keys override initial keys. + + Args: + bindings (Iterable[Bindings]): A number of bindings. + + Returns: + Bindings: New bindings. + """ + keys: dict[str, Binding] = {} + for _bindings in bindings: + keys.update(_bindings.keys) + return Bindings(keys.values()) + + @property + def shown_keys(self) -> list[Binding]: + keys = [binding for binding in self.keys.values() if binding.show] + return keys + + def bind( + self, + keys: str, + action: str, + description: str = "", + show: bool = True, + key_display: str | None = None, + allow_forward: bool = True, + ) -> None: + all_keys = [key.strip() for key in keys.split(",")] + for key in all_keys: + self.keys[key] = Binding( + key, + action, + description, + show=show, + key_display=key_display, + allow_forward=allow_forward, + ) + + def get_key(self, key: str) -> Binding: + try: + return self.keys[key] + except KeyError: + raise NoBinding(f"No binding for {key}") from None + + def allow_forward(self, key: str) -> bool: + binding = self.keys.get(key, None) + if binding is None: + return True + return binding.allow_forward diff --git a/testbed/Textualize__textual/src/textual/box_model.py b/testbed/Textualize__textual/src/textual/box_model.py new file mode 100644 index 0000000000000000000000000000000000000000..adfc49c3682c4f488fc8d916865a607a465251f6 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/box_model.py @@ -0,0 +1,122 @@ +from __future__ import annotations + +from fractions import Fraction +from typing import Callable, NamedTuple + +from .css.styles import StylesBase +from .geometry import Size, Spacing + + +class BoxModel(NamedTuple): + """The result of `get_box_model`.""" + + # Content + padding + border + width: Fraction + height: Fraction + margin: Spacing # Additional margin + + +def get_box_model( + styles: StylesBase, + container: Size, + viewport: Size, + fraction_unit: Fraction, + get_content_width: Callable[[Size, Size], int], + get_content_height: Callable[[Size, Size, int], int], +) -> BoxModel: + """Resolve the box model for this Styles. + + Args: + styles (StylesBase): Styles object. + container (Size): The size of the widget container. + viewport (Size): The viewport size. + get_auto_width (Callable): A callable which accepts container size and parent size and returns a width. + get_auto_height (Callable): A callable which accepts container size and parent size and returns a height. + + Returns: + BoxModel: A tuple with the size of the content area and margin. + """ + _content_width, _content_height = container + content_width = Fraction(_content_width) + content_height = Fraction(_content_height) + is_border_box = styles.box_sizing == "border-box" + gutter = styles.gutter + margin = styles.margin + + is_auto_width = styles.width and styles.width.is_auto + is_auto_height = styles.height and styles.height.is_auto + + # Container minus padding and border + content_container = container - gutter.totals + # The container including the content + sizing_container = content_container if is_border_box else container + + if styles.width is None: + # No width specified, fill available space + content_width = Fraction(content_container.width - margin.width) + elif is_auto_width: + # When width is auto, we want enough space to always fit the content + content_width = Fraction( + get_content_width(content_container - styles.margin.totals, viewport) + ) + else: + # An explicit width + styles_width = styles.width + content_width = styles_width.resolve_dimension( + sizing_container - styles.margin.totals, viewport, fraction_unit + ) + if is_border_box and styles_width.excludes_border: + content_width -= gutter.width + + if styles.min_width is not None: + # Restrict to minimum width, if set + min_width = styles.min_width.resolve_dimension( + content_container, viewport, fraction_unit + ) + content_width = max(content_width, min_width) + + if styles.max_width is not None: + # Restrict to maximum width, if set + max_width = styles.max_width.resolve_dimension( + content_container, viewport, fraction_unit + ) + content_width = min(content_width, max_width) + + content_width = max(Fraction(0), content_width) + + if styles.height is None: + # No height specified, fill the available space + content_height = Fraction(content_container.height - margin.height) + elif is_auto_height: + # Calculate dimensions based on content + content_height = Fraction( + get_content_height(content_container, viewport, int(content_width)) + ) + else: + styles_height = styles.height + # Explicit height set + content_height = styles_height.resolve_dimension( + sizing_container - styles.margin.totals, viewport, fraction_unit + ) + if is_border_box and styles_height.excludes_border: + content_height -= gutter.height + + if styles.min_height is not None: + # Restrict to minimum height, if set + min_height = styles.min_height.resolve_dimension( + content_container, viewport, fraction_unit + ) + content_height = max(content_height, min_height) + + if styles.max_height is not None: + # Restrict maximum height, if set + max_height = styles.max_height.resolve_dimension( + content_container, viewport, fraction_unit + ) + content_height = min(content_height, max_height) + + content_height = max(Fraction(1), content_height) + model = BoxModel( + content_width + gutter.width, content_height + gutter.height, margin + ) + return model diff --git a/testbed/Textualize__textual/src/textual/case.py b/testbed/Textualize__textual/src/textual/case.py new file mode 100644 index 0000000000000000000000000000000000000000..ba34e58a874cf90981245221923c30279c7dbb10 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/case.py @@ -0,0 +1,28 @@ +import re + +from typing import Match, Pattern + + +def camel_to_snake( + name: str, _re_snake: Pattern[str] = re.compile("[a-z][A-Z]") +) -> str: + """Convert name from CamelCase to snake_case. + + Args: + name (str): A symbol name, such as a class name. + + Returns: + str: Name in camel case. + """ + + def repl(match: Match[str]) -> str: + lower: str + upper: str + lower, upper = match.group() # type: ignore + return f"{lower}_{upper.lower()}" + + return _re_snake.sub(repl, name).lower() + + +if __name__ == "__main__": + print(camel_to_snake("HelloWorldEvent")) diff --git a/testbed/Textualize__textual/src/textual/cli/__init__.py b/testbed/Textualize__textual/src/textual/cli/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/testbed/Textualize__textual/src/textual/cli/__main__.py b/testbed/Textualize__textual/src/textual/cli/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..27cfa4889a32c76f296c1ea94473a9dd08ed98d1 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/cli/__main__.py @@ -0,0 +1,3 @@ +from .cli import run + +run() diff --git a/testbed/Textualize__textual/src/textual/cli/previews/__init__.py b/testbed/Textualize__textual/src/textual/cli/previews/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/testbed/Textualize__textual/src/textual/cli/previews/borders.py b/testbed/Textualize__textual/src/textual/cli/previews/borders.py new file mode 100644 index 0000000000000000000000000000000000000000..6133434436c1f82d1aea7aa65e18e1ba9f1d963c --- /dev/null +++ b/testbed/Textualize__textual/src/textual/cli/previews/borders.py @@ -0,0 +1,65 @@ +from textual.app import App, ComposeResult +from textual.constants import BORDERS +from textual.widgets import Button, Static +from textual.containers import Vertical + + +TEXT = """I must not fear. +Fear is the mind-killer. +Fear is the little-death that brings total obliteration. +I will face my fear. +I will permit it to pass over me and through me. +And when it has gone past, I will turn the inner eye to see its path. +Where the fear has gone there will be nothing. Only I will remain.""" + + +class BorderButtons(Vertical): + DEFAULT_CSS = """ + BorderButtons { + dock: left; + width: 24; + overflow-y: scroll; + } + + BorderButtons > Button { + width: 100%; + } + """ + + def compose(self) -> ComposeResult: + for border in BORDERS: + if border: + yield Button(border, id=border) + + +class BorderApp(App): + """Demonstrates the border styles.""" + + CSS = """ + #text { + margin: 2 4; + padding: 2 4; + border: solid $secondary; + height: auto; + background: $panel; + color: $text; + } + """ + + def compose(self): + yield BorderButtons() + self.text = Static(TEXT, id="text") + yield self.text + + def on_button_pressed(self, event: Button.Pressed) -> None: + self.text.styles.border = ( + event.button.id, + self.stylesheet._variables["secondary"], + ) + self.bell() + + +app = BorderApp() + +if __name__ == "__main__": + app.run() diff --git a/testbed/Textualize__textual/src/textual/cli/previews/easing.css b/testbed/Textualize__textual/src/textual/cli/previews/easing.css new file mode 100644 index 0000000000000000000000000000000000000000..83277d5664d7575c39de0f89fd18030bb9b77ca2 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/cli/previews/easing.css @@ -0,0 +1,54 @@ +EasingButtons > Button { + width: 100%; +} +EasingButtons { + dock: left; + overflow-y: scroll; + width: 20; +} + +#bar-container { + content-align: center middle; +} + +#duration-input { + width: 30; + background: $boost; + padding: 0 1; + border: tall transparent; +} + +#duration-input:focus { + border: tall $accent; +} + +#inputs { + padding: 1; + height: auto; + dock: top; + background: $boost; +} + +Bar { + width: 1fr; +} + +#other { + width: 1fr; + background: $panel; + padding: 1; + height: 100%; + border-left: vkey $background; +} + +#opacity-widget { + padding: 1; + background: $warning; + color: $text; + border: wide $background; +} + +#label { + width: auto; + padding: 1; +} diff --git a/testbed/Textualize__textual/src/textual/cli/previews/easing.py b/testbed/Textualize__textual/src/textual/cli/previews/easing.py new file mode 100644 index 0000000000000000000000000000000000000000..795164b6c81726d249460dc7a0eeee9388fa2fd8 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/cli/previews/easing.py @@ -0,0 +1,127 @@ +from __future__ import annotations + +from rich.console import RenderableType +from textual._easing import EASING +from textual.app import App, ComposeResult +from textual.cli.previews.borders import TEXT +from textual.containers import Container, Horizontal, Vertical +from textual.reactive import Reactive +from textual.scrollbar import ScrollBarRender +from textual.widget import Widget +from textual.widgets import Button, Footer, Static, Input + +VIRTUAL_SIZE = 100 +WINDOW_SIZE = 10 +START_POSITION = 0.0 +END_POSITION = float(VIRTUAL_SIZE - WINDOW_SIZE) + + +class EasingButtons(Widget): + def compose(self) -> ComposeResult: + for easing in sorted(EASING, reverse=True): + yield Button(easing, id=easing) + + +class Bar(Widget): + position = Reactive.init(START_POSITION) + animation_running = Reactive(False) + + DEFAULT_CSS = """ + + Bar { + background: $surface; + color: $error; + } + + Bar.-active { + background: $surface; + color: $success; + } + + """ + + def watch_animation_running(self, running: bool) -> None: + self.set_class(running, "-active") + + def render(self) -> RenderableType: + return ScrollBarRender( + virtual_size=VIRTUAL_SIZE, + window_size=WINDOW_SIZE, + position=self.position, + style=self.rich_style, + ) + + +class EasingApp(App): + position = Reactive.init(START_POSITION) + duration = Reactive.var(1.0) + + def on_load(self): + self.bind( + "ctrl+p", "focus('duration-input')", description="Focus: Duration Input" + ) + self.bind("ctrl+b", "toggle_dark", description="Toggle Dark") + + def compose(self) -> ComposeResult: + self.animated_bar = Bar() + self.animated_bar.position = START_POSITION + duration_input = Input("1.0", placeholder="Duration", id="duration-input") + + self.opacity_widget = Static( + f"[b]Welcome to Textual![/]\n\n{TEXT}", id="opacity-widget" + ) + + yield EasingButtons() + yield Vertical( + Horizontal( + Static("Animation Duration:", id="label"), duration_input, id="inputs" + ), + Horizontal( + self.animated_bar, + Container(self.opacity_widget, id="other"), + ), + Footer(), + ) + + def on_button_pressed(self, event: Button.Pressed) -> None: + self.animated_bar.animation_running = True + + def _animation_complete(): + self.animated_bar.animation_running = False + + target_position = ( + END_POSITION if self.position == START_POSITION else START_POSITION + ) + self.animate( + "position", + value=target_position, + final_value=target_position, + duration=self.duration, + easing=event.button.id, + on_complete=_animation_complete, + ) + + def watch_position(self, value: int): + self.animated_bar.position = value + self.opacity_widget.styles.opacity = 1 - value / END_POSITION + + def on_input_changed(self, event: Input.Changed): + if event.sender.id == "duration-input": + new_duration = _try_float(event.value) + if new_duration is not None: + self.duration = new_duration + + def action_toggle_dark(self): + self.dark = not self.dark + + +def _try_float(string: str) -> float | None: + try: + return float(string) + except ValueError: + return None + + +app = EasingApp(css_path="easing.css") +if __name__ == "__main__": + app.run() diff --git a/testbed/Textualize__textual/src/textual/color.py b/testbed/Textualize__textual/src/textual/color.py new file mode 100644 index 0000000000000000000000000000000000000000..d2645b8b49f83a58fb1360c20a13d6d8edebdfbc --- /dev/null +++ b/testbed/Textualize__textual/src/textual/color.py @@ -0,0 +1,585 @@ +""" +This module contains a powerful Color class which Textual uses to expose colors. + +The only exception would be for Rich renderables, which require a rich.color.Color instance. +You can convert from a Textual color to a Rich color with the [rich_color][textual.color.Color.rich_color] property. + +## Named colors + +The following named colors are used by the [parse][textual.color.Color.parse] method. + +```{.rich title="colors"} +from textual._color_constants import COLOR_NAME_TO_RGB +from textual.color import Color +from rich.table import Table +from rich.text import Text +table = Table("Name", "hex", "RGB", "Color", expand=True, highlight=True) + +for name, triplet in sorted(COLOR_NAME_TO_RGB.items()): + if len(triplet) != 3: + continue + color = Color(*triplet) + r, g, b = triplet + table.add_row( + f'"{name}"', + Text(f"{color.hex}", "bold green"), + f"rgb({r}, {g}, {b})", + Text(" ", style=f"on rgb({r},{g},{b})") + ) +output = table +``` + + +""" + +from __future__ import annotations + +import re +from colorsys import hls_to_rgb, rgb_to_hls +from functools import lru_cache +from operator import itemgetter +from typing import Callable, NamedTuple + +import rich.repr +from rich.color import Color as RichColor +from rich.color import ColorType +from rich.color_triplet import ColorTriplet +from rich.style import Style +from rich.text import Text + +from textual.css.scalar import percentage_string_to_float +from textual.css.tokenize import CLOSE_BRACE, COMMA, DECIMAL, OPEN_BRACE, PERCENT +from textual.suggestions import get_suggestion + +from ._color_constants import COLOR_NAME_TO_RGB +from .geometry import clamp + +_TRUECOLOR = ColorType.TRUECOLOR + + +class HSL(NamedTuple): + """A color in HLS format.""" + + h: float + """Hue""" + s: float + """Saturation""" + l: float + """Lightness""" + + @property + def css(self) -> str: + """HSL in css format.""" + h, s, l = self + + def as_str(number: float) -> str: + return f"{number:.1f}".rstrip("0").rstrip(".") + + return f"hsl({as_str(h*360)},{as_str(s*100)}%,{as_str(l*100)}%)" + + +class HSV(NamedTuple): + """A color in HSV format.""" + + h: float + """Hue""" + s: float + """Saturation""" + v: float + """Value""" + + +class Lab(NamedTuple): + """A color in CIE-L*ab format.""" + + L: float + a: float + b: float + + +RE_COLOR = re.compile( + rf"""^ +\#([0-9a-fA-F]{{3}})$| +\#([0-9a-fA-F]{{4}})$| +\#([0-9a-fA-F]{{6}})$| +\#([0-9a-fA-F]{{8}})$| +rgb{OPEN_BRACE}({DECIMAL}{COMMA}{DECIMAL}{COMMA}{DECIMAL}){CLOSE_BRACE}$| +rgba{OPEN_BRACE}({DECIMAL}{COMMA}{DECIMAL}{COMMA}{DECIMAL}{COMMA}{DECIMAL}){CLOSE_BRACE}$| +hsl{OPEN_BRACE}({DECIMAL}{COMMA}{PERCENT}{COMMA}{PERCENT}){CLOSE_BRACE}$| +hsla{OPEN_BRACE}({DECIMAL}{COMMA}{PERCENT}{COMMA}{PERCENT}{COMMA}{DECIMAL}){CLOSE_BRACE}$ +""", + re.VERBOSE, +) + +# Fast way to split a string of 6 characters in to 3 pairs of 2 characters +_split_pairs3: Callable[[str], tuple[str, str, str]] = itemgetter( + slice(0, 2), slice(2, 4), slice(4, 6) +) +# Fast way to split a string of 8 characters in to 4 pairs of 2 characters +_split_pairs4: Callable[[str], tuple[str, str, str, str]] = itemgetter( + slice(0, 2), slice(2, 4), slice(4, 6), slice(6, 8) +) + + +class ColorParseError(Exception): + """A color failed to parse. + + Args: + message (str): the error message + suggested_color (str | None): a close color we can suggest. Defaults to None. + """ + + def __init__(self, message: str, suggested_color: str | None = None): + super().__init__(message) + self.suggested_color = suggested_color + + +@rich.repr.auto +class Color(NamedTuple): + """A class to represent a RGB color with an alpha component.""" + + r: int + """Red component (0-255)""" + g: int + """Green component (0-255)""" + b: int + """Blue component (0-255)""" + a: float = 1.0 + """Alpha component (0-1)""" + + @classmethod + def from_rich_color(cls, rich_color: RichColor) -> Color: + """Create a new color from Rich's Color class. + + Args: + rich_color (RichColor): An instance of rich.color.Color. + + Returns: + Color: A new Color. + """ + r, g, b = rich_color.get_truecolor() + return cls(r, g, b) + + @classmethod + def from_hsl(cls, h: float, s: float, l: float) -> Color: + """Create a color from HLS components. + + Args: + h (float): Hue. + l (float): Lightness. + s (float): Saturation. + + Returns: + Color: A new color. + """ + r, g, b = hls_to_rgb(h, l, s) + return cls(int(r * 255 + 0.5), int(g * 255 + 0.5), int(b * 255 + 0.5)) + + def __rich__(self) -> Text: + """A Rich method to show the color.""" + return Text( + f" {self!r} ", + style=Style.from_color( + self.get_contrast_text().rich_color, self.rich_color + ), + ) + + @property + def inverse(self) -> Color: + """The inverse of this color.""" + r, g, b, a = self + return Color(255 - r, 255 - g, 255 - b, a) + + @property + def is_transparent(self) -> bool: + """Check if the color is transparent, i.e. has 0 alpha. + + Returns: + bool: True if transparent, otherwise False. + + """ + return self.a == 0 + + @property + def clamped(self) -> Color: + """Get a color with all components saturated to maximum and minimum values. + + Returns: + Color: A color object. + + """ + r, g, b, a = self + _clamp = clamp + color = Color( + _clamp(r, 0, 255), + _clamp(g, 0, 255), + _clamp(b, 0, 255), + _clamp(a, 0.0, 1.0), + ) + return color + + @property + def rich_color(self) -> RichColor: + """This color encoded in Rich's Color class. + + Returns: + RichColor: A color object as used by Rich. + """ + r, g, b, _a = self + return RichColor( + f"#{r:02x}{g:02x}{b:02x}", _TRUECOLOR, None, ColorTriplet(r, g, b) + ) + + @property + def normalized(self) -> tuple[float, float, float]: + """A tuple of the color components normalized to between 0 and 1. + + Returns: + tuple[float, float, float]: Normalized components. + + """ + r, g, b, _a = self + return (r / 255, g / 255, b / 255) + + @property + def rgb(self) -> tuple[int, int, int]: + """Get just the red, green, and blue components. + + Returns: + tuple[int, int, int]: Color components + """ + r, g, b, _ = self + return (r, g, b) + + @property + def hsl(self) -> HSL: + """Get the color as HSL. + + Returns: + HSL: Color in HSL format. + """ + r, g, b = self.normalized + h, l, s = rgb_to_hls(r, g, b) + return HSL(h, s, l) + + @property + def brightness(self) -> float: + """Get the human perceptual brightness. + + Returns: + float: Brightness value (0-1). + + """ + r, g, b = self.normalized + brightness = (299 * r + 587 * g + 114 * b) / 1000 + return brightness + + @property + def hex(self) -> str: + """The color in CSS hex form, with 6 digits for RGB, and 8 digits for RGBA. + + Returns: + str: A CSS hex-style color, e.g. `"#46b3de"` or `"#3342457f"` + + """ + r, g, b, a = self.clamped + return ( + f"#{r:02X}{g:02X}{b:02X}" + if a == 1 + else f"#{r:02X}{g:02X}{b:02X}{int(a*255):02X}" + ) + + @property + def hex6(self) -> str: + """The color in CSS hex form, with 6 digits for RGB. Alpha is ignored. + + Returns: + str: A CSS hex-style color, e.g. "#46b3de" + + """ + r, g, b, a = self.clamped + return f"#{r:02X}{g:02X}{b:02X}" + + @property + def css(self) -> str: + """The color in CSS rgb or rgba form. + + Returns: + str: A CSS style color, e.g. `"rgb(10,20,30)"` or `"rgb(50,70,80,0.5)"` + + """ + r, g, b, a = self + return f"rgb({r},{g},{b})" if a == 1 else f"rgba({r},{g},{b},{a})" + + @property + def monochrome(self) -> Color: + """Get a monochrome version of this color. + + Returns: + Color: A new monochrome color. + """ + r, g, b, a = self + gray = round(r * 0.2126 + g * 0.7152 + b * 0.0722) + return Color(gray, gray, gray, a) + + def __rich_repr__(self) -> rich.repr.Result: + r, g, b, a = self + yield r + yield g + yield b + yield "a", a + + def with_alpha(self, alpha: float) -> Color: + """Create a new color with the given alpha. + + Args: + alpha (float): New value for alpha. + + Returns: + Color: A new color. + """ + r, g, b, _ = self + return Color(r, g, b, alpha) + + def blend(self, destination: Color, factor: float, alpha: float = 1) -> Color: + """Generate a new color between two colors. + + Args: + destination (Color): Another color. + factor (float): A blend factor, 0 -> 1. + alpha (float | None): New alpha for result. Defaults to 1. + + Returns: + Color: A new color. + """ + if factor == 0: + return self + elif factor == 1: + return destination + r1, g1, b1, _ = self + r2, g2, b2, _ = destination + return Color( + int(r1 + (r2 - r1) * factor), + int(g1 + (g2 - g1) * factor), + int(b1 + (b2 - b1) * factor), + alpha, + ) + + def __add__(self, other: object) -> Color: + if isinstance(other, Color): + new_color = self.blend(other, other.a) + return new_color + return NotImplemented + + @classmethod + @lru_cache(maxsize=1024 * 4) + def parse(cls, color_text: str | Color) -> Color: + """Parse a string containing a named color or CSS-style color. + + Colors may be parsed from the following formats: + + Text beginning with a `#` is parsed as hex: + + R, G, and B must be hex digits (0-9A-F) + + - `#RGB` + - `#RRGGBB` + - `#RRGGBBAA` + + Text in the following formats is parsed as decimal values: + + RED, GREEN, and BLUE must be numbers between 0 and 255. + ALPHA should ba a value between 0 and 1. + + - `rgb(RED,GREEN,BLUE)` + - `rgba(RED,GREEN,BLUE,ALPHA)` + - `hsl(RED,GREEN,BLUE)` + - `hsla(RED,GREEN,BLUE,ALPHA)` + + All other text will raise a `ColorParseError`. + + Args: + color_text (str | Color): Text with a valid color format. Color objects will + be returned unmodified. + + Raises: + ColorParseError: If the color is not encoded correctly. + + Returns: + Color: New color object. + """ + if isinstance(color_text, Color): + return color_text + color_from_name = COLOR_NAME_TO_RGB.get(color_text) + if color_from_name is not None: + return cls(*color_from_name) + color_match = RE_COLOR.match(color_text) + if color_match is None: + error_message = f"failed to parse {color_text!r} as a color" + suggested_color = None + if not color_text.startswith(("#", "rgb", "hsl")): + # Seems like we tried to use a color name: let's try to find one that is close enough: + suggested_color = get_suggestion(color_text, COLOR_NAME_TO_RGB.keys()) + if suggested_color: + error_message += f"; did you mean '{suggested_color}'?" + raise ColorParseError(error_message, suggested_color) + ( + rgb_hex_triple, + rgb_hex_quad, + rgb_hex, + rgba_hex, + rgb, + rgba, + hsl, + hsla, + ) = color_match.groups() + + if rgb_hex_triple is not None: + r, g, b = rgb_hex_triple + color = cls(int(f"{r}{r}", 16), int(f"{g}{g}", 16), int(f"{b}{b}", 16)) + elif rgb_hex_quad is not None: + r, g, b, a = rgb_hex_quad + color = cls( + int(f"{r}{r}", 16), + int(f"{g}{g}", 16), + int(f"{b}{b}", 16), + int(f"{a}{a}", 16) / 255.0, + ) + elif rgb_hex is not None: + r, g, b = [int(pair, 16) for pair in _split_pairs3(rgb_hex)] + color = cls(r, g, b, 1.0) + elif rgba_hex is not None: + r, g, b, a = [int(pair, 16) for pair in _split_pairs4(rgba_hex)] + color = cls(r, g, b, a / 255.0) + elif rgb is not None: + r, g, b = [clamp(int(float(value)), 0, 255) for value in rgb.split(",")] + color = cls(r, g, b, 1.0) + elif rgba is not None: + float_r, float_g, float_b, float_a = [ + float(value) for value in rgba.split(",") + ] + color = cls( + clamp(int(float_r), 0, 255), + clamp(int(float_g), 0, 255), + clamp(int(float_b), 0, 255), + clamp(float_a, 0.0, 1.0), + ) + elif hsl is not None: + h, s, l = hsl.split(",") + h = float(h) % 360 / 360 + s = percentage_string_to_float(s) + l = percentage_string_to_float(l) + color = Color.from_hsl(h, s, l) + elif hsla is not None: + h, s, l, a = hsla.split(",") + h = float(h) % 360 / 360 + s = percentage_string_to_float(s) + l = percentage_string_to_float(l) + a = clamp(float(a), 0.0, 1.0) + color = Color.from_hsl(h, s, l).with_alpha(a) + else: + raise AssertionError("Can't get here if RE_COLOR matches") + return color + + @lru_cache(maxsize=1024) + def darken(self, amount: float, alpha: float | None = None) -> Color: + """Darken the color by a given amount. + + Args: + amount (float): Value between 0-1 to reduce luminance by. + alpha (float | None, optional): Alpha component for new color or None to copy alpha. Defaults to None. + + Returns: + Color: New color. + """ + l, a, b = rgb_to_lab(self) + l -= amount * 100 + return lab_to_rgb(Lab(l, a, b), self.a if alpha is None else alpha).clamped + + def lighten(self, amount: float, alpha: float | None = None) -> Color: + """Lighten the color by a given amount. + + Args: + amount (float): Value between 0-1 to increase luminance by. + alpha (float | None, optional): Alpha component for new color or None to copy alpha. Defaults to None. + + Returns: + Color: New color. + """ + return self.darken(-amount, alpha) + + @lru_cache(maxsize=1024) + def get_contrast_text(self, alpha=0.95) -> Color: + """Get a light or dark color that best contrasts this color, for use with text. + + Args: + alpha (float, optional): An alpha value to adjust the pure white / black by. + Defaults to 0.95. + + Returns: + Color: A new color, either an off-white or off-black + """ + brightness = self.brightness + white_contrast = abs(brightness - WHITE.brightness) + black_contrast = abs(brightness - BLACK.brightness) + return (WHITE if white_contrast > black_contrast else BLACK).with_alpha(alpha) + + +# Color constants +WHITE = Color(255, 255, 255) +BLACK = Color(0, 0, 0) +TRANSPARENT = Color(0, 0, 0, 0) + + +def rgb_to_lab(rgb: Color) -> Lab: + """Convert an RGB color to the CIE-L*ab format. + + Uses the standard RGB color space with a D65/2⁰ standard illuminant. + Conversion passes through the XYZ color space. + Cf. http://www.easyrgb.com/en/math.php. + """ + + r, g, b = rgb.r / 255, rgb.g / 255, rgb.b / 255 + + r = pow((r + 0.055) / 1.055, 2.4) if r > 0.04045 else r / 12.92 + g = pow((g + 0.055) / 1.055, 2.4) if g > 0.04045 else g / 12.92 + b = pow((b + 0.055) / 1.055, 2.4) if b > 0.04045 else b / 12.92 + + x = (r * 41.24 + g * 35.76 + b * 18.05) / 95.047 + y = (r * 21.26 + g * 71.52 + b * 7.22) / 100 + z = (r * 1.93 + g * 11.92 + b * 95.05) / 108.883 + + off = 16 / 116 + x = pow(x, 1 / 3) if x > 0.008856 else 7.787 * x + off + y = pow(y, 1 / 3) if y > 0.008856 else 7.787 * y + off + z = pow(z, 1 / 3) if z > 0.008856 else 7.787 * z + off + + return Lab(116 * y - 16, 500 * (x - y), 200 * (y - z)) + + +def lab_to_rgb(lab: Lab, alpha: float = 1.0) -> Color: + """Convert a CIE-L*ab color to RGB. + + Uses the standard RGB color space with a D65/2⁰ standard illuminant. + Conversion passes through the XYZ color space. + Cf. http://www.easyrgb.com/en/math.php. + """ + + y = (lab.L + 16) / 116 + x = lab.a / 500 + y + z = y - lab.b / 200 + + off = 16 / 116 + y = pow(y, 3) if y > 0.2068930344 else (y - off) / 7.787 + x = 0.95047 * pow(x, 3) if x > 0.2068930344 else 0.122059 * (x - off) + z = 1.08883 * pow(z, 3) if z > 0.2068930344 else 0.139827 * (z - off) + + r = x * 3.2406 + y * -1.5372 + z * -0.4986 + g = x * -0.9689 + y * 1.8758 + z * 0.0415 + b = x * 0.0557 + y * -0.2040 + z * 1.0570 + + r = 1.055 * pow(r, 1 / 2.4) - 0.055 if r > 0.0031308 else 12.92 * r + g = 1.055 * pow(g, 1 / 2.4) - 0.055 if g > 0.0031308 else 12.92 * g + b = 1.055 * pow(b, 1 / 2.4) - 0.055 if b > 0.0031308 else 12.92 * b + + return Color(int(r * 255), int(g * 255), int(b * 255), alpha) diff --git a/testbed/Textualize__textual/src/textual/constants.py b/testbed/Textualize__textual/src/textual/constants.py new file mode 100644 index 0000000000000000000000000000000000000000..6429da790630428ff73744599ee1dd17273cd54e --- /dev/null +++ b/testbed/Textualize__textual/src/textual/constants.py @@ -0,0 +1,11 @@ +""" +Constants that we might want to expose via the public API. + +""" + +from ._border import BORDER_CHARS + +__all__ = ["BORDERS"] + + +BORDERS = list(BORDER_CHARS) diff --git a/testbed/Textualize__textual/src/textual/containers.py b/testbed/Textualize__textual/src/textual/containers.py new file mode 100644 index 0000000000000000000000000000000000000000..231e220b0386537216511d774e00b8a76e05d7ff --- /dev/null +++ b/testbed/Textualize__textual/src/textual/containers.py @@ -0,0 +1,55 @@ +from .widget import Widget + + +class Container(Widget): + """Simple container widget, with vertical layout.""" + + DEFAULT_CSS = """ + Container { + layout: vertical; + overflow: auto; + } + """ + + +class Vertical(Widget): + """A container widget which aligns children vertically.""" + + DEFAULT_CSS = """ + Vertical { + layout: vertical; + overflow-y: auto; + } + """ + + +class Horizontal(Widget): + """A container widget which aligns children horizontally.""" + + DEFAULT_CSS = """ + Horizontal { + layout: horizontal; + overflow-x: hidden; + } + """ + + +class Grid(Widget): + """A container widget with grid alignment.""" + + DEFAULT_CSS = """ + Grid { + layout: grid; + } + """ + + +class Content(Widget, can_focus=True, can_focus_children=False): + """A container for content such as text.""" + + DEFAULT_CSS = """ + Vertical { + layout: vertical; + overflow-y: auto; + } + """ diff --git a/testbed/Textualize__textual/src/textual/css/__init__.py b/testbed/Textualize__textual/src/textual/css/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/testbed/Textualize__textual/src/textual/css/_style_properties.py b/testbed/Textualize__textual/src/textual/css/_style_properties.py new file mode 100644 index 0000000000000000000000000000000000000000..ccd954c828fd4e281e4d97cbdc9c6d4ce1c4d607 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/css/_style_properties.py @@ -0,0 +1,1030 @@ +""" +Style properties are descriptors which allow the ``Styles`` object to accept different types when +setting attributes. This gives the developer more freedom in how to express style information. + +Descriptors also play nicely with Mypy, which is aware that attributes can have different types +when setting and getting. + +""" + +from __future__ import annotations + +from typing import Generic, Iterable, NamedTuple, TypeVar, TYPE_CHECKING, cast + +import rich.repr +from rich.style import Style + +from ._help_text import ( + border_property_help_text, + layout_property_help_text, + fractional_property_help_text, + offset_property_help_text, + style_flags_property_help_text, +) +from ._help_text import ( + spacing_wrong_number_of_values_help_text, + scalar_help_text, + string_enum_help_text, + color_property_help_text, +) +from .._border import INVISIBLE_EDGE_TYPES, normalize_border_value +from ..color import Color, ColorParseError +from ._error_tools import friendly_list +from .constants import NULL_SPACING, VALID_STYLE_FLAGS +from .errors import StyleTypeError, StyleValueError +from .scalar import ( + get_symbols, + UNIT_SYMBOL, + Unit, + Scalar, + ScalarOffset, + ScalarParseError, + percentage_string_to_float, +) +from .transition import Transition +from ..geometry import Spacing, SpacingDimensions, clamp + +if TYPE_CHECKING: + from .._layout import Layout + from .styles import Styles, StylesBase + +from .types import DockEdge, EdgeType, AlignHorizontal, AlignVertical + +BorderDefinition = ( + "Sequence[tuple[EdgeType, str | Color] | None] | tuple[EdgeType, str | Color]" +) + +PropertyGetType = TypeVar("PropertyGetType") +PropertySetType = TypeVar("PropertySetType") + + +class GenericProperty(Generic[PropertyGetType, PropertySetType]): + def __init__(self, default: PropertyGetType, layout: bool = False) -> None: + self.default = default + self.layout = layout + + def validate_value(self, value: object) -> PropertyGetType: + """Validate the setter value + + Args: + value (object): The value being set. + + Returns: + PropertyType: The value to be set. + """ + # Raise StyleValueError here + return cast(PropertyGetType, value) + + def __set_name__(self, owner: Styles, name: str) -> None: + self.name = name + + def __get__( + self, obj: StylesBase, objtype: type[StylesBase] | None = None + ) -> PropertyGetType: + return cast(PropertyGetType, obj.get_rule(self.name, self.default)) + + def __set__(self, obj: StylesBase, value: PropertySetType | None) -> None: + _rich_traceback_omit = True + if value is None: + obj.clear_rule(self.name) + obj.refresh(layout=self.layout) + return + new_value = self.validate_value(value) + if obj.set_rule(self.name, new_value): + obj.refresh(layout=self.layout) + + +class IntegerProperty(GenericProperty[int, int]): + def validate_value(self, value: object) -> int: + if isinstance(value, (int, float)): + return int(value) + else: + raise StyleValueError(f"Expected a number here, got f{value}") + + +class BooleanProperty(GenericProperty[bool, bool]): + """A property that requires a True or False value.""" + + def validate_value(self, value: object) -> bool: + return bool(value) + + +class ScalarProperty: + """Descriptor for getting and setting scalar properties. Scalars are numeric values with a unit, e.g. "50vh".""" + + def __init__( + self, + units: set[Unit] | None = None, + percent_unit: Unit = Unit.WIDTH, + allow_auto: bool = True, + ) -> None: + self.units: set[Unit] = units or {*UNIT_SYMBOL} + self.percent_unit = percent_unit + self.allow_auto = allow_auto + super().__init__() + + def __set_name__(self, owner: Styles, name: str) -> None: + self.name = name + + def __get__( + self, obj: StylesBase, objtype: type[StylesBase] | None = None + ) -> Scalar | None: + """Get the scalar property + + Args: + obj (Styles): The ``Styles`` object + objtype (type[Styles]): The ``Styles`` class + + Returns: + The Scalar object or ``None`` if it's not set. + """ + value = obj.get_rule(self.name) + return value + + def __set__( + self, obj: StylesBase, value: float | int | Scalar | str | None + ) -> None: + """Set the scalar property + + Args: + obj (Styles): The ``Styles`` object. + value (float | int | Scalar | str | None): The value to set the scalar property to. + You can directly pass a float or int value, which will be interpreted with + a default unit of Cells. You may also provide a string such as ``"50%"``, + as you might do when writing CSS. If a string with no units is supplied, + Cells will be used as the unit. Alternatively, you can directly supply + a ``Scalar`` object. + + Raises: + StyleValueError: If the value is of an invalid type, uses an invalid unit, or + cannot be parsed for any other reason. + """ + _rich_traceback_omit = True + if value is None: + obj.clear_rule(self.name) + obj.refresh(layout=True) + return + if isinstance(value, (int, float)): + new_value = Scalar(float(value), Unit.CELLS, Unit.WIDTH) + elif isinstance(value, Scalar): + new_value = value + elif isinstance(value, str): + try: + new_value = Scalar.parse(value) + except ScalarParseError: + raise StyleValueError( + "unable to parse scalar from {value!r}", + help_text=scalar_help_text( + property_name=self.name, context="inline" + ), + ) + else: + raise StyleValueError("expected float, int, Scalar, or None") + + if ( + new_value is not None + and new_value.unit == Unit.AUTO + and not self.allow_auto + ): + raise StyleValueError("'auto' not allowed here") + + if new_value is not None and new_value.unit != Unit.AUTO: + if new_value.unit not in self.units: + raise StyleValueError( + f"{self.name} units must be one of {friendly_list(get_symbols(self.units))}" + ) + if new_value.is_percent: + new_value = Scalar( + float(new_value.value), self.percent_unit, Unit.WIDTH + ) + if obj.set_rule(self.name, new_value): + obj.refresh(layout=True) + + +class ScalarListProperty: + def __set_name__(self, owner: Styles, name: str) -> None: + self.name = name + + def __get__( + self, obj: StylesBase, objtype: type[StylesBase] | None = None + ) -> tuple[Scalar, ...] | None: + value = obj.get_rule(self.name) + return value + + def __set__( + self, obj: StylesBase, value: str | Iterable[str | float] | None + ) -> None: + if value is None: + obj.clear_rule(self.name) + obj.refresh(layout=True) + return + parse_values: Iterable[str | float] + if isinstance(value, str): + parse_values = value.split() + else: + parse_values = value + + scalars = [] + for parse_value in parse_values: + if isinstance(parse_value, (int, float)): + scalars.append(Scalar.from_number(parse_value)) + else: + scalars.append( + Scalar.parse(parse_value) + if isinstance(parse_value, str) + else parse_value + ) + if obj.set_rule(self.name, tuple(scalars)): + obj.refresh(layout=True) + + +class BoxProperty: + """Descriptor for getting and setting outlines and borders along a single edge. + For example "border-right", "outline-bottom", etc. + """ + + def __init__(self, default_color: Color) -> None: + self._default_color = default_color + + def __set_name__(self, owner: StylesBase, name: str) -> None: + self.name = name + _type, edge = name.split("_") + self._type = _type + self.edge = edge + + def __get__( + self, obj: StylesBase, objtype: type[StylesBase] | None = None + ) -> tuple[EdgeType, Color]: + """Get the box property + + Args: + obj (Styles): The ``Styles`` object + objtype (type[Styles]): The ``Styles`` class + + Returns: + A ``tuple[EdgeType, Style]`` containing the string type of the box and + it's style. Example types are "rounded", "solid", and "dashed". + """ + box_type, color = obj.get_rule(self.name) or ("", self._default_color) + if box_type in {"none", "hidden"}: + box_type = "" + return (box_type, color) + + def __set__(self, obj: Styles, border: tuple[EdgeType, str | Color] | None): + """Set the box property + + Args: + obj (Styles): The ``Styles`` object. + value (tuple[EdgeType, str | Color | Style], optional): A 2-tuple containing the type of box to use, + e.g. "dashed", and the ``Style`` to be used. You can supply the ``Style`` directly, or pass a + ``str`` (e.g. ``"blue on #f0f0f0"`` ) or ``Color`` instead. + + Raises: + StyleSyntaxError: If the string supplied for the color has invalid syntax. + """ + _rich_traceback_omit = True + if border is None: + if obj.clear_rule(self.name): + obj.refresh() + else: + _type, color = border + new_value = border + if isinstance(color, str): + try: + new_value = (_type, Color.parse(color)) + except ColorParseError as error: + raise StyleValueError( + str(error), + help_text=border_property_help_text( + self.name, context="inline" + ), + ) + elif isinstance(color, Color): + new_value = (_type, color) + if obj.set_rule(self.name, new_value): + obj.refresh() + + +@rich.repr.auto +class Edges(NamedTuple): + """Stores edges for border / outline.""" + + top: tuple[EdgeType, Color] + right: tuple[EdgeType, Color] + bottom: tuple[EdgeType, Color] + left: tuple[EdgeType, Color] + + def __bool__(self) -> bool: + (top, _), (right, _), (bottom, _), (left, _) = self + return bool(top or right or bottom or left) + + def __rich_repr__(self) -> rich.repr.Result: + top, right, bottom, left = self + if top[0]: + yield "top", top + if right[0]: + yield "right", right + if bottom[0]: + yield "bottom", bottom + if left[0]: + yield "left", left + + @property + def spacing(self) -> Spacing: + """Get spacing created by borders. + + Returns: + tuple[int, int, int, int]: Spacing for top, right, bottom, and left. + """ + (top, _), (right, _), (bottom, _), (left, _) = self + return Spacing( + 1 if top else 0, + 1 if right else 0, + 1 if bottom else 0, + 1 if left else 0, + ) + + +class BorderProperty: + """Descriptor for getting and setting full borders and outlines. + + Args: + layout (bool): True if the layout should be refreshed after setting, False otherwise. + + """ + + def __init__(self, layout: bool) -> None: + self._layout = layout + + def __set_name__(self, owner: StylesBase, name: str) -> None: + self.name = name + self._properties = ( + f"{name}_top", + f"{name}_right", + f"{name}_bottom", + f"{name}_left", + ) + + def __get__( + self, obj: StylesBase, objtype: type[StylesBase] | None = None + ) -> Edges: + """Get the border + + Args: + obj (Styles): The ``Styles`` object + objtype (type[Styles]): The ``Styles`` class + + Returns: + An ``Edges`` object describing the type and style of each edge. + """ + top, right, bottom, left = self._properties + + border = Edges( + getattr(obj, top), + getattr(obj, right), + getattr(obj, bottom), + getattr(obj, left), + ) + return border + + def __set__( + self, + obj: StylesBase, + border: BorderDefinition | None, + ) -> None: + """Set the border + + Args: + obj (Styles): The ``Styles`` object. + border (Sequence[tuple[EdgeType, str | Color | Style] | None] | tuple[EdgeType, str | Color | Style] | None): + A ``tuple[EdgeType, str | Color | Style]`` representing the type of box to use and the ``Style`` to apply + to the box. + Alternatively, you can supply a sequence of these tuples and they will be applied per-edge. + If the sequence is of length 1, all edges will be decorated according to the single element. + If the sequence is length 2, the first ``tuple`` will be applied to the top and bottom edges. + If the sequence is length 4, the tuples will be applied to the edges in the order: top, right, bottom, left. + + Raises: + StyleValueError: When the supplied ``tuple`` is not of valid length (1, 2, or 4). + """ + _rich_traceback_omit = True + top, right, bottom, left = self._properties + + border_spacing = Edges( + getattr(obj, top), + getattr(obj, right), + getattr(obj, bottom), + getattr(obj, left), + ).spacing + + def check_refresh() -> None: + """Check if an update requires a layout""" + if not self._layout: + obj.refresh() + else: + layout = ( + Edges( + getattr(obj, top), + getattr(obj, right), + getattr(obj, bottom), + getattr(obj, left), + ).spacing + != border_spacing + ) + obj.refresh(layout=layout) + + if border is None: + clear_rule = obj.clear_rule + clear_rule(top) + clear_rule(right) + clear_rule(bottom) + clear_rule(left) + check_refresh() + return + if isinstance(border, tuple) and len(border) == 2: + _border = normalize_border_value(border) + setattr(obj, top, _border) + setattr(obj, right, _border) + setattr(obj, bottom, _border) + setattr(obj, left, _border) + check_refresh() + return + + count = len(border) + if count == 1: + _border = normalize_border_value(border[0]) + setattr(obj, top, _border) + setattr(obj, right, _border) + setattr(obj, bottom, _border) + setattr(obj, left, _border) + elif count == 2: + _border1, _border2 = ( + normalize_border_value(border[0]), + normalize_border_value(border[1]), + ) + setattr(obj, top, _border1) + setattr(obj, bottom, _border1) + setattr(obj, right, _border2) + setattr(obj, left, _border2) + elif count == 4: + _border1, _border2, _border3, _border4 = ( + normalize_border_value(border[0]), + normalize_border_value(border[1]), + normalize_border_value(border[2]), + normalize_border_value(border[3]), + ) + setattr(obj, top, _border1) + setattr(obj, right, _border2) + setattr(obj, bottom, _border3) + setattr(obj, left, _border4) + else: + raise StyleValueError( + "expected 1, 2, or 4 values", + help_text=border_property_help_text(self.name, context="inline"), + ) + check_refresh() + + +class SpacingProperty: + """Descriptor for getting and setting spacing properties (e.g. padding and margin).""" + + def __set_name__(self, owner: StylesBase, name: str) -> None: + self.name = name + + def __get__( + self, obj: StylesBase, objtype: type[StylesBase] | None = None + ) -> Spacing: + """Get the Spacing + + Args: + obj (Styles): The ``Styles`` object + objtype (type[Styles]): The ``Styles`` class + + Returns: + Spacing: The Spacing. If unset, returns the null spacing ``(0, 0, 0, 0)``. + """ + return obj.get_rule(self.name, NULL_SPACING) + + def __set__(self, obj: StylesBase, spacing: SpacingDimensions | None): + """Set the Spacing + + Args: + obj (Styles): The ``Styles`` object. + style (Style | str, optional): You can supply the ``Style`` directly, or a + string (e.g. ``"blue on #f0f0f0"``). + + Raises: + ValueError: When the value is malformed, e.g. a ``tuple`` with a length that is + not 1, 2, or 4. + """ + _rich_traceback_omit = True + if spacing is None: + if obj.clear_rule(self.name): + obj.refresh(layout=True) + else: + try: + unpacked_spacing = Spacing.unpack(spacing) + except ValueError as error: + raise StyleValueError( + str(error), + help_text=spacing_wrong_number_of_values_help_text( + property_name=self.name, + num_values_supplied=len(spacing), + context="inline", + ), + ) + if obj.set_rule(self.name, unpacked_spacing): + obj.refresh(layout=True) + + +class DockProperty: + """Descriptor for getting and setting the dock property. The dock property + allows you to specify which edge you want to fix a Widget to. + """ + + def __get__( + self, obj: StylesBase, objtype: type[StylesBase] | None = None + ) -> DockEdge: + """Get the Dock property + + Args: + obj (Styles): The ``Styles`` object. + objtype (type[Styles]): The ``Styles`` class. + + Returns: + str: The dock name as a string, or "" if the rule is not set. + """ + return cast(DockEdge, obj.get_rule("dock", "")) + + def __set__(self, obj: Styles, dock_name: str | None): + """Set the Dock property + + Args: + obj (Styles): The ``Styles`` object + dock_name (str | None): The name of the dock to attach this widget to + """ + _rich_traceback_omit = True + if obj.set_rule("dock", dock_name): + obj.refresh(layout=True) + + +class LayoutProperty: + """Descriptor for getting and setting layout.""" + + def __set_name__(self, owner: StylesBase, name: str) -> None: + self.name = name + + def __get__( + self, obj: StylesBase, objtype: type[StylesBase] | None = None + ) -> Layout | None: + """ + Args: + obj (Styles): The Styles object + objtype (type[Styles]): The Styles class + Returns: + The ``Layout`` object. + """ + return obj.get_rule(self.name) + + def __set__(self, obj: StylesBase, layout: str | Layout | None): + """ + Args: + obj (Styles): The Styles object. + layout (str | Layout): The layout to use. You can supply the name of the layout + or a ``Layout`` object. + """ + + from ..layouts.factory import ( + get_layout, + Layout, + MissingLayout, + ) # Prevents circular import + + _rich_traceback_omit = True + if layout is None: + if obj.clear_rule("layout"): + obj.refresh(layout=True) + elif isinstance(layout, Layout): + if obj.set_rule("layout", layout): + obj.refresh(layout=True) + else: + try: + layout_object = get_layout(layout) + except MissingLayout as error: + raise StyleValueError( + str(error), + help_text=layout_property_help_text(self.name, context="inline"), + ) + if obj.set_rule("layout", layout_object): + obj.refresh(layout=True) + + +class OffsetProperty: + """Descriptor for getting and setting the offset property. + Offset consists of two values, x and y, that a widget's position + will be adjusted by before it is rendered. + """ + + def __set_name__(self, owner: StylesBase, name: str) -> None: + self.name = name + + def __get__( + self, obj: StylesBase, objtype: type[StylesBase] | None = None + ) -> ScalarOffset: + """Get the offset + + Args: + obj (Styles): The ``Styles`` object. + objtype (type[Styles]): The ``Styles`` class. + + Returns: + ScalarOffset: The ``ScalarOffset`` indicating the adjustment that + will be made to widget position prior to it being rendered. + """ + return obj.get_rule(self.name, ScalarOffset.null()) + + def __set__( + self, obj: StylesBase, offset: tuple[int | str, int | str] | ScalarOffset | None + ): + """Set the offset + + Args: + obj: The ``Styles`` class + offset: A ScalarOffset object, or a 2-tuple of the form ``(x, y)`` indicating + the x and y offsets. When the ``tuple`` form is used, x and y can be specified + as either ``int`` or ``str``. The string format allows you to also specify + any valid scalar unit e.g. ``("0.5vw", "0.5vh")``. + + Raises: + ScalarParseError: If any of the string values supplied in the 2-tuple cannot + be parsed into a Scalar. For example, if you specify a non-existent unit. + """ + _rich_traceback_omit = True + if offset is None: + if obj.clear_rule(self.name): + obj.refresh(layout=True) + elif isinstance(offset, ScalarOffset): + if obj.set_rule(self.name, offset): + obj.refresh(layout=True) + else: + x, y = offset + + try: + scalar_x = ( + Scalar.parse(x, Unit.WIDTH) + if isinstance(x, str) + else Scalar(float(x), Unit.CELLS, Unit.WIDTH) + ) + scalar_y = ( + Scalar.parse(y, Unit.HEIGHT) + if isinstance(y, str) + else Scalar(float(y), Unit.CELLS, Unit.HEIGHT) + ) + except ScalarParseError as error: + raise StyleValueError( + str(error), help_text=offset_property_help_text(context="inline") + ) + + _offset = ScalarOffset(scalar_x, scalar_y) + + if obj.set_rule(self.name, _offset): + obj.refresh(layout=True) + + +class StringEnumProperty: + """Descriptor for getting and setting string properties and ensuring that the set + value belongs in the set of valid values. + """ + + def __init__(self, valid_values: set[str], default: str, layout=False) -> None: + self._valid_values = valid_values + self._default = default + self._layout = layout + + def __set_name__(self, owner: StylesBase, name: str) -> None: + self.name = name + + def __get__(self, obj: StylesBase, objtype: type[StylesBase] | None = None) -> str: + """Get the string property, or the default value if it's not set + + Args: + obj (Styles): The ``Styles`` object. + objtype (type[Styles]): The ``Styles`` class. + + Returns: + str: The string property value + """ + return obj.get_rule(self.name, self._default) + + def __set__(self, obj: StylesBase, value: str | None = None): + """Set the string property and ensure it is in the set of allowed values. + + Args: + obj (Styles): The ``Styles`` object + value (str, optional): The string value to set the property to. + + Raises: + StyleValueError: If the value is not in the set of valid values. + """ + _rich_traceback_omit = True + if value is None: + if obj.clear_rule(self.name): + obj.refresh(layout=self._layout) + else: + if value not in self._valid_values: + raise StyleValueError( + f"{self.name} must be one of {friendly_list(self._valid_values)} (received {value!r})", + help_text=string_enum_help_text( + self.name, + valid_values=list(self._valid_values), + context="inline", + ), + ) + if obj.set_rule(self.name, value): + obj.refresh(layout=self._layout) + + +class NameProperty: + """Descriptor for getting and setting name properties.""" + + def __set_name__(self, owner: StylesBase, name: str) -> None: + self.name = name + + def __get__(self, obj: StylesBase, objtype: type[StylesBase] | None) -> str: + """Get the name property + + Args: + obj (Styles): The ``Styles`` object. + objtype (type[Styles]): The ``Styles`` class. + + Returns: + str: The name + """ + return obj.get_rule(self.name, "") + + def __set__(self, obj: StylesBase, name: str | None): + """Set the name property + + Args: + obj: The ``Styles`` object + name: The name to set the property to + + Raises: + StyleTypeError: If the value is not a ``str``. + """ + _rich_traceback_omit = True + if name is None: + if obj.clear_rule(self.name): + obj.refresh(layout=True) + else: + if not isinstance(name, str): + raise StyleTypeError(f"{self.name} must be a str") + if obj.set_rule(self.name, name): + obj.refresh(layout=True) + + +class NameListProperty: + def __set_name__(self, owner: StylesBase, name: str) -> None: + self.name = name + + def __get__( + self, obj: StylesBase, objtype: type[StylesBase] | None = None + ) -> tuple[str, ...]: + return cast("tuple[str, ...]", obj.get_rule(self.name, ())) + + def __set__(self, obj: StylesBase, names: str | tuple[str] | None = None): + _rich_traceback_omit = True + if names is None: + if obj.clear_rule(self.name): + obj.refresh(layout=True) + elif isinstance(names, str): + if obj.set_rule( + self.name, tuple(name.strip().lower() for name in names.split(" ")) + ): + obj.refresh(layout=True) + elif isinstance(names, tuple): + if obj.set_rule(self.name, names): + obj.refresh(layout=True) + + +class ColorProperty: + """Descriptor for getting and setting color properties.""" + + def __init__(self, default_color: Color | str, background: bool = False) -> None: + self._default_color = Color.parse(default_color) + self._is_background = background + + def __set_name__(self, owner: StylesBase, name: str) -> None: + self.name = name + + def __get__( + self, obj: StylesBase, objtype: type[StylesBase] | None = None + ) -> Color: + """Get a ``Color``. + + Args: + obj (Styles): The ``Styles`` object. + objtype (type[Styles]): The ``Styles`` class. + + Returns: + Color: The Color + """ + return cast(Color, obj.get_rule(self.name, self._default_color)) + + def __set__(self, obj: StylesBase, color: Color | str | None): + """Set the Color + + Args: + obj (Styles): The ``Styles`` object + color (Color | str | None): The color to set. Pass a ``Color`` instance directly, + or pass a ``str`` which will be parsed into a color (e.g. ``"red""``, ``"rgb(20, 50, 80)"``, + ``"#f4e32d"``). + + Raises: + ColorParseError: When the color string is invalid. + """ + _rich_traceback_omit = True + if color is None: + if obj.clear_rule(self.name): + obj.refresh(children=self._is_background) + elif isinstance(color, Color): + if obj.set_rule(self.name, color): + obj.refresh(children=self._is_background) + elif isinstance(color, str): + alpha = 1.0 + parsed_color = Color(255, 255, 255) + for token in color.split(): + if token.endswith("%"): + try: + alpha = percentage_string_to_float(token) + except ValueError: + raise StyleValueError(f"invalid percentage value '{token}'") + continue + try: + parsed_color = Color.parse(token) + except ColorParseError as error: + raise StyleValueError( + f"Invalid color value '{token}'", + help_text=color_property_help_text( + self.name, context="inline", error=error + ), + ) + parsed_color = parsed_color.with_alpha(alpha) + if obj.set_rule(self.name, parsed_color): + obj.refresh(children=self._is_background) + else: + raise StyleValueError(f"Invalid color value {color}") + + +class StyleFlagsProperty: + """Descriptor for getting and set style flag properties (e.g. ``bold italic underline``).""" + + def __set_name__(self, owner: Styles, name: str) -> None: + self.name = name + + def __get__( + self, obj: StylesBase, objtype: type[StylesBase] | None = None + ) -> Style: + """Get the ``Style`` + + Args: + obj (Styles): The ``Styles`` object. + objtype (type[Styles]): The ``Styles`` class. + + Returns: + Style: The ``Style`` object + """ + return obj.get_rule(self.name, Style.null()) + + def __set__(self, obj: StylesBase, style_flags: Style | str | None): + """Set the style using a style flag string + + Args: + obj (Styles): The ``Styles`` object. + style_flags (str, optional): The style flags to set as a string. For example, + ``"bold italic"``. + + Raises: + StyleValueError: If the value is an invalid style flag + """ + _rich_traceback_omit = True + if style_flags is None: + if obj.clear_rule(self.name): + obj.refresh() + elif isinstance(style_flags, Style): + if obj.set_rule(self.name, style_flags): + obj.refresh() + else: + words = [word.strip() for word in style_flags.split(" ")] + valid_word = VALID_STYLE_FLAGS.__contains__ + for word in words: + if not valid_word(word): + raise StyleValueError( + f"unknown word {word!r} in style flags", + help_text=style_flags_property_help_text( + self.name, word, context="inline" + ), + ) + style = Style.parse(style_flags) + if obj.set_rule(self.name, style): + obj.refresh() + + +class TransitionsProperty: + """Descriptor for getting transitions properties""" + + def __get__( + self, obj: StylesBase, objtype: type[StylesBase] | None = None + ) -> dict[str, Transition]: + """Get a mapping of properties to the transitions applied to them. + + Args: + obj (Styles): The ``Styles`` object. + objtype (type[Styles]): The ``Styles`` class. + + Returns: + dict[str, Transition]: A ``dict`` mapping property names to the ``Transition`` applied to them. + e.g. ``{"offset": Transition(...), ...}``. If no transitions have been set, an empty ``dict`` + is returned. + """ + return obj.get_rule("transitions", {}) + + def __set__(self, obj: Styles, transitions: dict[str, Transition] | None) -> None: + _rich_traceback_omit = True + if transitions is None: + obj.clear_rule("transitions") + else: + obj.set_rule("transitions", transitions.copy()) + + +class FractionalProperty: + """Property that can be set either as a float (e.g. 0.1) or a + string percentage (e.g. '10%'). Values will be clamped to the range (0, 1). + """ + + def __init__(self, default: float = 1.0): + self.default = default + + def __set_name__(self, owner: StylesBase, name: str) -> None: + self.name = name + + def __get__(self, obj: StylesBase, type: type[StylesBase]) -> float: + """Get the property value as a float between 0 and 1 + + Args: + obj (Styles): The ``Styles`` object. + objtype (type[Styles]): The ``Styles`` class. + + Returns: + float: The value of the property (in the range (0, 1)) + """ + return cast(float, obj.get_rule(self.name, self.default)) + + def __set__(self, obj: StylesBase, value: float | str | None) -> None: + """Set the property value, clamping it between 0 and 1. + + Args: + obj (Styles): The Styles object. + value (float|str|None): The value to set as a float between 0 and 1, or + as a percentage string such as '10%'. + """ + _rich_traceback_omit = True + name = self.name + if value is None: + if obj.clear_rule(name): + obj.refresh() + return + + if isinstance(value, float): + float_value = value + elif isinstance(value, str) and value.endswith("%"): + float_value = float(Scalar.parse(value).value) / 100 + else: + raise StyleValueError( + f"{self.name} must be a str (e.g. '10%') or a float (e.g. 0.1)", + help_text=fractional_property_help_text(name, context="inline"), + ) + if obj.set_rule(name, clamp(float_value, 0, 1)): + obj.refresh() + + +class AlignProperty: + """Combines the horizontal and vertical alignment properties in to a single property.""" + + def __set_name__(self, owner: StylesBase, name: str) -> None: + self.horizontal = f"{name}_horizontal" + self.vertical = f"{name}_vertical" + + def __get__( + self, obj: StylesBase, type: type[StylesBase] + ) -> tuple[AlignHorizontal, AlignVertical]: + horizontal = getattr(obj, self.horizontal) + vertical = getattr(obj, self.vertical) + return (horizontal, vertical) + + def __set__( + self, obj: StylesBase, value: tuple[AlignHorizontal, AlignVertical] + ) -> None: + horizontal, vertical = value + setattr(obj, self.horizontal, horizontal) + setattr(obj, self.vertical, vertical) diff --git a/testbed/Textualize__textual/src/textual/design.py b/testbed/Textualize__textual/src/textual/design.py new file mode 100644 index 0000000000000000000000000000000000000000..268bdb621ec6d0b8d539507a784cd99d293aec3a --- /dev/null +++ b/testbed/Textualize__textual/src/textual/design.py @@ -0,0 +1,232 @@ +from __future__ import annotations + +from typing import Iterable + +from rich.console import group +from rich.padding import Padding +from rich.table import Table +from rich.text import Text + +from .color import Color, WHITE + + +NUMBER_OF_SHADES = 3 + +# Where no content exists +DEFAULT_DARK_BACKGROUND = "#121212" +# What text usually goes on top off +DEFAULT_DARK_SURFACE = "#1e1e1e" + +DEFAULT_LIGHT_SURFACE = "#f5f5f5" +DEFAULT_LIGHT_BACKGROUND = "#efefef" + + +class ColorSystem: + """Defines a standard set of colors and variations for building a UI. + + Primary is the main theme color + Secondary is a second theme color + + + """ + + COLOR_NAMES = [ + "primary", + "secondary", + "background", + "primary-background", + "secondary-background", + "surface", + "panel", + "boost", + "warning", + "error", + "success", + "accent", + ] + + def __init__( + self, + primary: str, + secondary: str | None = None, + warning: str | None = None, + error: str | None = None, + success: str | None = None, + accent: str | None = None, + background: str | None = None, + surface: str | None = None, + panel: str | None = None, + boost: str | None = None, + dark: bool = False, + luminosity_spread: float = 0.15, + text_alpha: float = 0.95, + ): + def parse(color: str | None) -> Color | None: + if color is None: + return None + return Color.parse(color) + + self.primary = Color.parse(primary) + self.secondary = parse(secondary) + self.warning = parse(warning) + self.error = parse(error) + self.success = parse(success) + self.accent = parse(accent) + self.background = parse(background) + self.surface = parse(surface) + self.panel = parse(panel) + self.boost = parse(boost) + self._dark = dark + self._luminosity_spread = luminosity_spread + self._text_alpha = text_alpha + + @property + def shades(self) -> Iterable[str]: + """The names of the colors and derived shades.""" + for color in self.COLOR_NAMES: + for shade_number in range(-NUMBER_OF_SHADES, NUMBER_OF_SHADES + 1): + if shade_number < 0: + yield f"{color}-darken-{abs(shade_number)}" + elif shade_number > 0: + yield f"{color}-lighten-{shade_number}" + else: + yield color + + def generate(self) -> dict[str, str]: + """Generate a mapping of color name on to a CSS color. + + Args: + dark (bool, optional): Enable dark mode. Defaults to False. + luminosity_spread (float, optional): Amount of luminosity to subtract and add to generate + shades. Defaults to 0.2. + text_alpha (float, optional): Alpha value for text. Defaults to 0.9. + + Returns: + dict[str, str]: A mapping of color name on to a CSS-style encoded color + + """ + + primary = self.primary + secondary = self.secondary or primary + warning = self.warning or primary + error = self.error or secondary + success = self.success or secondary + accent = self.accent or primary + + dark = self._dark + luminosity_spread = self._luminosity_spread + + if dark: + background = self.background or Color.parse(DEFAULT_DARK_BACKGROUND) + surface = self.surface or Color.parse(DEFAULT_DARK_SURFACE) + else: + background = self.background or Color.parse(DEFAULT_LIGHT_BACKGROUND) + surface = self.surface or Color.parse(DEFAULT_LIGHT_SURFACE) + + foreground = background.inverse + + boost = self.boost or background.get_contrast_text(1.0).with_alpha(0.04) + + if self.panel is None: + panel = surface.blend(primary, 0.1) + if dark: + panel += boost + else: + panel = self.panel + + colors: dict[str, str] = {} + + def luminosity_range(spread) -> Iterable[tuple[str, float]]: + """Get the range of shades from darken2 to lighten2. + + Returns: + Iterable of tuples () + + """ + luminosity_step = spread / 2 + for n in range(-NUMBER_OF_SHADES, +NUMBER_OF_SHADES + 1): + if n < 0: + label = "-darken" + elif n > 0: + label = "-lighten" + else: + label = "" + yield (f"{label}{'-' + str(abs(n)) if n else ''}"), n * luminosity_step + + # Color names and color + COLORS = [ + ("primary", primary), + ("secondary", secondary), + ("primary-background", primary), + ("secondary-background", secondary), + ("background", background), + ("foreground", foreground), + ("panel", panel), + ("boost", boost), + ("surface", surface), + ("warning", warning), + ("error", error), + ("success", success), + ("accent", accent), + ] + + # Colors names that have a dark variant + DARK_SHADES = {"primary-background", "secondary-background"} + + for name, color in COLORS: + is_dark_shade = dark and name in DARK_SHADES + spread = luminosity_spread + for shade_name, luminosity_delta in luminosity_range(spread): + if is_dark_shade: + dark_background = background.blend(color, 0.15) + shade_color = dark_background.blend( + WHITE, spread + luminosity_delta + ).clamped + colors[f"{name}{shade_name}"] = shade_color.hex + else: + shade_color = color.lighten(luminosity_delta) + colors[f"{name}{shade_name}"] = shade_color.hex + + colors["text"] = "auto 87%" + colors["text-muted"] = "auto 60%" + colors["text-disabled"] = "auto 38%" + + return colors + + +def show_design(light: ColorSystem, dark: ColorSystem) -> Table: + """Generate a renderable to show color systems. + + Args: + light (ColorSystem): Light ColorSystem. + dark (ColorSystem): Dark ColorSystem + + Returns: + Table: Table showing all colors. + + """ + + @group() + def make_shades(system: ColorSystem): + colors = system.generate() + for name in system.shades: + background = Color.parse(colors[name]).with_alpha(1.0) + foreground = background + background.get_contrast_text(0.9) + + text = Text(name) + + yield Padding(text, 1, style=f"{foreground.hex6} on {background.hex6}") + + table = Table(box=None, expand=True) + table.add_column("Light", justify="center") + table.add_column("Dark", justify="center") + table.add_row(make_shades(light), make_shades(dark)) + return table + + +if __name__ == "__main__": + from .app import DEFAULT_COLORS + + from rich import print + + print(show_design(DEFAULT_COLORS["light"], DEFAULT_COLORS["dark"])) diff --git a/testbed/Textualize__textual/src/textual/devtools/__init__.py b/testbed/Textualize__textual/src/textual/devtools/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/testbed/Textualize__textual/src/textual/devtools/client.py b/testbed/Textualize__textual/src/textual/devtools/client.py new file mode 100644 index 0000000000000000000000000000000000000000..e711f9d580295de5e636d3ab29e8d0c999d022c6 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/devtools/client.py @@ -0,0 +1,279 @@ +from __future__ import annotations + +import asyncio +import inspect +import json + +import pickle +from time import time +from asyncio import Queue, Task, QueueFull +from io import StringIO +from typing import Type, Any, NamedTuple + +from rich.console import Console +from rich.segment import Segment + +from .._log import LogGroup, LogVerbosity + + +class DevtoolsDependenciesMissingError(Exception): + """Raise when the required devtools dependencies are not installed in the environment""" + + +try: + import aiohttp + from aiohttp import ( + ClientResponseError, + ClientConnectorError, + ClientWebSocketResponse, + ) + import msgpack +except ImportError: + # TODO: Add link to documentation on how to install devtools + raise DevtoolsDependenciesMissingError( + "Textual Devtools requires installation of the 'dev' extra dependencies. " + ) + +DEVTOOLS_PORT = 8081 +WEBSOCKET_CONNECT_TIMEOUT = 3 +LOG_QUEUE_MAXSIZE = 512 + + +class DevtoolsLog(NamedTuple): + """A devtools log message. + + Attributes: + objects_or_string (tuple[Any, ...]): Corresponds to the data that will + ultimately be passed to Console.print in order to generate the log + Segments. + caller (inspect.FrameInfo): Information about where this log message was + created. In other words, where did the user call `print` or `App.log` + from. Used to display line number and file name in the devtools window. + """ + + objects_or_string: tuple[Any, ...] | str + caller: inspect.FrameInfo + + +class DevtoolsConsole(Console): + def __init__(self, *args, **kwargs) -> None: + super().__init__(*args, **kwargs) + self.record = True + + def export_segments(self) -> list[Segment]: + """Return the list of Segments that have be printed using this console + + Returns: + list[Segment]: The list of Segments that have been printed using this console + """ + with self._record_buffer_lock: + segments = self._record_buffer[:] + self._record_buffer.clear() + return segments + + +class DevtoolsConnectionError(Exception): + """Raise when the devtools client is unable to connect to the server""" + + +class ClientShutdown: + """Sentinel type sent to client queue(s) to indicate shutdown""" + + +class DevtoolsClient: + """Client responsible for websocket communication with the devtools server. + Communicates using a simple JSON protocol. + + Messages have the format `{"type": , "payload": }`. + + Valid values for `"type"` (that can be sent from client -> server) are + `"client_log"` (for log messages) and `"client_spillover"` (for reporting + to the server that messages were discarded due to rate limiting). + + A `"client_log"` message has a `"payload"` format as follows: + ``` + {"timestamp": , + "path": , + "line_number": , + "encoded_segments": } + ``` + + A `"client_spillover"` message has a `"payload"` format as follows: + ``` + {"spillover": } + ``` + + Args: + host (str): The host the devtools server is running on, defaults to "127.0.0.1" + port (int): The port the devtools server is accessed via, defaults to 8081 + """ + + def __init__(self, host: str = "127.0.0.1", port: int = DEVTOOLS_PORT) -> None: + self.url: str = f"ws://{host}:{port}" + self.session: aiohttp.ClientSession | None = None + self.log_queue_task: Task | None = None + self.update_console_task: Task | None = None + self.console: DevtoolsConsole = DevtoolsConsole(file=StringIO()) + self.websocket: ClientWebSocketResponse | None = None + self.log_queue: Queue[str | bytes | Type[ClientShutdown]] | None = None + self.spillover: int = 0 + self.verbose: bool = False + + async def connect(self) -> None: + """Connect to the devtools server. + + Raises: + DevtoolsConnectionError: If we're unable to establish + a connection to the server for any reason. + """ + self.session = aiohttp.ClientSession() + self.log_queue = Queue(maxsize=LOG_QUEUE_MAXSIZE) + try: + self.websocket = await self.session.ws_connect( + f"{self.url}/textual-devtools-websocket", + timeout=WEBSOCKET_CONNECT_TIMEOUT, + ) + except (ClientConnectorError, ClientResponseError): + raise DevtoolsConnectionError() + + log_queue = self.log_queue + websocket = self.websocket + + async def update_console() -> None: + """Coroutine function scheduled as a Task, which listens on + the websocket for updates from the server regarding any changes + in the server Console dimensions. When the client learns of this + change, it will update its own Console to ensure it renders at + the correct width for server-side display. + """ + async for message in self.websocket: + if message.type == aiohttp.WSMsgType.TEXT: + message_json = json.loads(message.data) + if message_json["type"] == "server_info": + payload = message_json["payload"] + self.console.width = payload["width"] + self.console.height = payload["height"] + self.verbose = payload.get("verbose", False) + + async def send_queued_logs(): + """Coroutine function which is scheduled as a Task, which consumes + messages from the log queue and sends them to the server via websocket. + """ + while True: + log = await log_queue.get() + if log is ClientShutdown: + log_queue.task_done() + break + if isinstance(log, str): + await websocket.send_str(log) + else: + assert isinstance(log, bytes) + await websocket.send_bytes(log) + log_queue.task_done() + + self.log_queue_task = asyncio.create_task(send_queued_logs()) + self.update_console_task = asyncio.create_task(update_console()) + + async def _stop_log_queue_processing(self) -> None: + """Schedule end of processing of the log queue, meaning that any messages a + user logs will be added to the queue, but not consumed and sent to + the server. + """ + if self.log_queue is not None: + await self.log_queue.put(ClientShutdown) + if self.log_queue_task: + await self.log_queue_task + + async def _stop_incoming_message_processing(self) -> None: + """Schedule stop of the task which listens for incoming messages from the + server around changes in the server console size. + """ + if self.websocket: + await self.websocket.close() + if self.update_console_task: + await self.update_console_task + if self.session: + await self.session.close() + + async def disconnect(self) -> None: + """Disconnect from the devtools server by stopping tasks and + closing connections. + """ + await self._stop_log_queue_processing() + await self._stop_incoming_message_processing() + + @property + def is_connected(self) -> bool: + """Checks connection to devtools server. + + Returns: + bool: True if this host is connected to the server. False otherwise. + """ + if not self.session or not self.websocket: + return False + return not (self.session.closed or self.websocket.closed) + + def log( + self, + log: DevtoolsLog, + group: LogGroup = LogGroup.UNDEFINED, + verbosity: LogVerbosity = LogVerbosity.NORMAL, + ) -> None: + """Queue a log to be sent to the devtools server for display. + + Args: + log (DevtoolsLog): The log to write to devtools + """ + if isinstance(log.objects_or_string, str): + self.console.print(log.objects_or_string) + else: + self.console.print(*log.objects_or_string) + + segments = self.console.export_segments() + + encoded_segments = self._encode_segments(segments) + message: bytes | None = msgpack.packb( + { + "type": "client_log", + "payload": { + "group": group.value, + "verbosity": verbosity.value, + "timestamp": int(time()), + "path": getattr(log.caller, "filename", ""), + "line_number": getattr(log.caller, "lineno", 0), + "segments": encoded_segments, + }, + } + ) + assert message is not None + try: + if self.log_queue: + self.log_queue.put_nowait(message) + if self.spillover > 0 and self.log_queue.qsize() < LOG_QUEUE_MAXSIZE: + # Tell the server how many messages we had to discard due + # to the log queue filling to capacity on the client. + spillover_message = json.dumps( + { + "type": "client_spillover", + "payload": { + "spillover": self.spillover, + }, + } + ) + self.log_queue.put_nowait(spillover_message) + self.spillover = 0 + except QueueFull: + self.spillover += 1 + + @classmethod + def _encode_segments(cls, segments: list[Segment]) -> bytes: + """Pickle a list of Segments + + Args: + segments (list[Segment]): A list of Segments to encode + + Returns: + bytes: The Segment list pickled with the latest protocol. + """ + pickled = pickle.dumps(segments, protocol=4) + return pickled diff --git a/testbed/Textualize__textual/src/textual/devtools/redirect_output.py b/testbed/Textualize__textual/src/textual/devtools/redirect_output.py new file mode 100644 index 0000000000000000000000000000000000000000..b7c721554e6bebbccb49276c2be9b0d4b10e0a8b --- /dev/null +++ b/testbed/Textualize__textual/src/textual/devtools/redirect_output.py @@ -0,0 +1,104 @@ +from __future__ import annotations + +import inspect + +from typing import TYPE_CHECKING, cast +from .client import DevtoolsLog +from .._log import LogGroup, LogVerbosity + +if TYPE_CHECKING: + from .devtools.client import DevtoolsClient + + +class StdoutRedirector: + """ + A write-only file-like object which redirects anything written to it to the devtools + instance associated with the given Textual application. Used within Textual to redirect + data written using `print` (or any other stdout writes) to the devtools and/or to the + log file. + """ + + def __init__(self, devtools: DevtoolsClient) -> None: + """ + Args: + devtools (DevtoolsClient): The running Textual app instance. + log_file (TextIOWrapper): The log file for the Textual App. + """ + self.devtools = devtools + self._buffer: list[DevtoolsLog] = [] + + def write(self, string: str) -> None: + """Write the log string to the internal buffer. If the string contains + a newline character `\n`, the whole string will be buffered and then the + buffer will be flushed immediately after. + + Args: + string (str): The string to write to the buffer. + """ + + if not self.devtools.is_connected: + return + + caller = inspect.stack()[1] + self._buffer.append(DevtoolsLog(string, caller=caller)) + + # By default, `print` adds a "\n" suffix which results in a buffer + # flush. You can choose a different suffix with the `end` parameter. + # If you modify the `end` parameter to something other than "\n", + # then `print` will no longer flush automatically. However, if a + # string you are printing contains a "\n", that will trigger + # a flush after that string has been buffered, regardless of the value + # of `end`. + if "\n" in string: + self.flush() + + def flush(self) -> None: + """Flush the buffer. This will send all buffered log messages to + the devtools server and the log file. In the case of the devtools, + where possible, log messages will be batched and sent as one. + """ + self._write_to_devtools() + self._buffer.clear() + + def _write_to_devtools(self) -> None: + """Send the contents of the buffer to the devtools.""" + if not self.devtools.is_connected: + return + + log_batch: list[DevtoolsLog] = [] + for log in self._buffer: + end_of_batch = log_batch and ( + log_batch[-1].caller.filename != log.caller.filename + or log_batch[-1].caller.lineno != log.caller.lineno + ) + if end_of_batch: + self._log_devtools_batched(log_batch) + log_batch.clear() + log_batch.append(log) + if log_batch: + self._log_devtools_batched(log_batch) + + def _log_devtools_batched(self, log_batch: list[DevtoolsLog]) -> None: + """Write a single batch of logs to devtools. A batch means contiguous logs + which have been written from the same line number and file path. + A single `print` call may correspond to multiple writes. + e.g. `print("a", "b", "c")` is 3 calls to `write`, so we batch + up these 3 write calls since they come from the same location, so that + they appear inside the same log message in the devtools window + rather than a single `print` statement resulting in 3 separate + logs being displayed. + + Args: + log_batch (list[DevtoolsLog]): A batch of logs to send to the + devtools server as one. Log content will be joined together. + """ + + # This code is only called via stdout.write, and so by this point we know + # that the log message content is a string. The cast below tells mypy this. + batched_log = "".join(cast(str, log.objects_or_string) for log in log_batch) + batched_log = batched_log.rstrip() + self.devtools.log( + DevtoolsLog(batched_log, caller=log_batch[-1].caller), + LogGroup.PRINT, + LogVerbosity.NORMAL, + ) diff --git a/testbed/Textualize__textual/src/textual/devtools/renderables.py b/testbed/Textualize__textual/src/textual/devtools/renderables.py new file mode 100644 index 0000000000000000000000000000000000000000..4f6f40d7be090cf1169bf6a814dffbbd5f04af2b --- /dev/null +++ b/testbed/Textualize__textual/src/textual/devtools/renderables.py @@ -0,0 +1,139 @@ +from __future__ import annotations + +import sys +from datetime import datetime +from pathlib import Path +from typing import Iterable + +from importlib_metadata import version + +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + +from rich.align import Align +from rich.console import Console, ConsoleOptions, RenderResult +from rich.markup import escape +from rich.rule import Rule +from rich.segment import Segment, Segments +from rich.style import Style +from rich.styled import Styled +from rich.table import Table +from rich.text import Text +from textual._log import LogGroup + +DevConsoleMessageLevel = Literal["info", "warning", "error"] + + +class DevConsoleHeader: + def __init__(self, verbose: bool = False) -> None: + self.verbose = verbose + + def __rich_console__( + self, console: Console, options: ConsoleOptions + ) -> RenderResult: + preamble = Text.from_markup( + f"[bold]Textual Development Console [magenta]v{version('textual')}\n" + "[magenta]Run a Textual app with [reverse]textual run --dev my_app.py[/] to connect.\n" + "[magenta]Press [reverse]Ctrl+C[/] to quit." + ) + if self.verbose: + preamble.append(Text.from_markup("\n[cyan]Verbose logs enabled")) + render_options = options.update(width=options.max_width - 4) + lines = console.render_lines(preamble, render_options) + + new_line = Segment.line() + padding = Segment("▌", Style.parse("bright_magenta")) + + for line in lines: + yield padding + yield from line + yield new_line + + +class DevConsoleLog: + """Renderable representing a single log message + + Args: + segments (Iterable[Segment]): The segments to display + path (str): The path of the file on the client that the log call was made from + line_number (int): The line number of the file on the client the log call was made from + unix_timestamp (int): Seconds since January 1st 1970 + """ + + def __init__( + self, + segments: Iterable[Segment], + path: str, + line_number: int, + unix_timestamp: int, + group: int, + verbosity: int, + severity: int, + ) -> None: + self.segments = segments + self.path = path + self.line_number = line_number + self.unix_timestamp = unix_timestamp + self.group = group + self.verbosity = verbosity + self.severity = severity + + def __rich_console__( + self, console: Console, options: ConsoleOptions + ) -> RenderResult: + local_time = datetime.fromtimestamp(self.unix_timestamp) + table = Table.grid(expand=True) + + file_link = escape(f"file://{Path(self.path).absolute()}") + file_and_line = escape(f"{Path(self.path).name}:{self.line_number}") + group = LogGroup(self.group).name + time = local_time.time() + + group_text = Text(group) + if group == "WARNING": + group_text.stylize("bold yellow reverse") + elif group == "ERROR": + group_text.stylize("bold red reverse") + else: + group_text.stylize("dim") + + log_message = Text.assemble((f"[{time}]", "dim"), " ", group_text) + + table.add_row( + log_message, + Align.right( + Text(f"{file_and_line}", style=Style(dim=True, link=file_link)) + ), + ) + yield table + + if group == "PRINT": + yield Styled(Segments(self.segments), "bold") + else: + yield from self.segments + + +class DevConsoleNotice: + """Renderable for messages written by the devtools console itself + + Args: + message (str): The message to display + level (DevtoolsMessageLevel): The message level ("info", "warning", or "error"). + Determines colors used to render the message and the perceived importance. + """ + + def __init__(self, message: str, *, level: DevConsoleMessageLevel = "info") -> None: + self.message = message + self.level = level + + def __rich_console__( + self, console: Console, options: ConsoleOptions + ) -> RenderResult: + level_to_style = { + "info": "dim", + "warning": "yellow", + "error": "red", + } + yield Rule(self.message, style=level_to_style.get(self.level, "dim")) diff --git a/testbed/Textualize__textual/src/textual/devtools/server.py b/testbed/Textualize__textual/src/textual/devtools/server.py new file mode 100644 index 0000000000000000000000000000000000000000..c312796a6c87ec02499f3bc3ffa91575c7b1d54f --- /dev/null +++ b/testbed/Textualize__textual/src/textual/devtools/server.py @@ -0,0 +1,74 @@ +from __future__ import annotations + +import asyncio +from aiohttp.web import run_app +from aiohttp.web_app import Application +from aiohttp.web_request import Request +from aiohttp.web_routedef import get +from aiohttp.web_ws import WebSocketResponse + +from textual.devtools.client import DEVTOOLS_PORT +from textual.devtools.service import DevtoolsService + +DEFAULT_SIZE_CHANGE_POLL_DELAY_SECONDS = 2 + + +async def websocket_handler(request: Request) -> WebSocketResponse: + """aiohttp websocket handler for sending data between devtools client and server + + Args: + request (Request): The request to the websocket endpoint + + Returns: + WebSocketResponse: The websocket response + """ + service: DevtoolsService = request.app["service"] + return await service.handle(request) + + +async def _on_shutdown(app: Application) -> None: + """aiohttp shutdown handler, called when the aiohttp server is stopped""" + service: DevtoolsService = app["service"] + await service.shutdown() + + +async def _on_startup(app: Application) -> None: + service: DevtoolsService = app["service"] + await service.start() + + +def _run_devtools(verbose: bool, exclude: list[str] | None = None) -> None: + app = _make_devtools_aiohttp_app(verbose=verbose, exclude=exclude) + + def noop_print(_: str): + return None + + run_app(app, port=DEVTOOLS_PORT, print=noop_print, loop=asyncio.get_event_loop()) + + +def _make_devtools_aiohttp_app( + size_change_poll_delay_secs: float = DEFAULT_SIZE_CHANGE_POLL_DELAY_SECONDS, + verbose: bool = False, + exclude: list[str] | None = None, +) -> Application: + app = Application() + + app.on_shutdown.append(_on_shutdown) + app.on_startup.append(_on_startup) + + app["verbose"] = verbose + app["service"] = DevtoolsService( + update_frequency=size_change_poll_delay_secs, verbose=verbose, exclude=exclude + ) + + app.add_routes( + [ + get("/textual-devtools-websocket", websocket_handler), + ] + ) + + return app + + +if __name__ == "__main__": + _run_devtools() diff --git a/testbed/Textualize__textual/src/textual/devtools/service.py b/testbed/Textualize__textual/src/textual/devtools/service.py new file mode 100644 index 0000000000000000000000000000000000000000..7d8ef9a21916812465c39104804944d4588ce8d3 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/devtools/service.py @@ -0,0 +1,291 @@ +"""Manages a running devtools instance""" +from __future__ import annotations + +import asyncio +import base64 +import json +import pickle +from json import JSONDecodeError +from time import time +from typing import cast + +from aiohttp import WSMessage, WSMsgType +from aiohttp.abc import Request +from aiohttp.web_ws import WebSocketResponse +from rich.console import Console +from rich.markup import escape +import msgpack + +from textual._log import LogGroup +from textual.devtools.renderables import ( + DevConsoleLog, + DevConsoleNotice, + DevConsoleHeader, +) + +QUEUEABLE_TYPES = {"client_log", "client_spillover"} + + +class DevtoolsService: + """A running instance of devtools has a single DevtoolsService which is + responsible for tracking connected client applications. + """ + + def __init__( + self, + update_frequency: float, + verbose: bool = False, + exclude: list[str] | None = None, + ) -> None: + """ + Args: + update_frequency (float): The number of seconds to wait between + sending updates of the console size to connected clients. + verbose (bool): Enable verbose logging on client. + exclude (list[str]): List of log groups to exclude from output. + """ + self.update_frequency = update_frequency + self.verbose = verbose + self.exclude = set(name.upper() for name in exclude) if exclude else set() + self.console = Console() + self.shutdown_event = asyncio.Event() + self.clients: list[ClientHandler] = [] + + async def start(self): + """Starts devtools tasks""" + self.size_poll_task = asyncio.create_task(self._console_size_poller()) + self.console.print(DevConsoleHeader(verbose=self.verbose)) + + @property + def clients_connected(self) -> bool: + """Returns True if there are connected clients, False otherwise.""" + return len(self.clients) > 0 + + async def _console_size_poller(self) -> None: + """Poll console dimensions, and add a `server_info` message to the Queue + any time a change occurs. We only poll if there are clients connected, + and if we're not shutting down the server. + """ + current_width = self.console.width + current_height = self.console.height + await self._send_server_info_to_all() + while not self.shutdown_event.is_set(): + width = self.console.width + height = self.console.height + dimensions_changed = width != current_width or height != current_height + if dimensions_changed: + await self._send_server_info_to_all() + current_width = width + current_height = height + try: + await asyncio.wait_for( + self.shutdown_event.wait(), timeout=self.update_frequency + ) + except asyncio.TimeoutError: + pass + + async def _send_server_info_to_all(self) -> None: + """Add `server_info` message to the queues of every client""" + for client_handler in self.clients: + await self.send_server_info(client_handler) + + async def send_server_info(self, client_handler: ClientHandler) -> None: + """Send information about the server e.g. width and height of Console to + a connected client. + + Args: + client_handler (ClientHandler): The client to send information to + """ + await client_handler.send_message( + { + "type": "server_info", + "payload": { + "width": self.console.width, + "height": self.console.height, + "verbose": self.verbose, + }, + } + ) + + async def handle(self, request: Request) -> WebSocketResponse: + """Handles a single client connection""" + client = ClientHandler(request, service=self) + self.clients.append(client) + websocket = await client.run() + self.clients.remove(client) + return websocket + + async def shutdown(self) -> None: + """Stop server async tasks and clean up all client handlers""" + + # Stop polling/writing Console dimensions to clients + self.shutdown_event.set() + await self.size_poll_task + + # We're shutting down the server, so inform all connected clients + for client in self.clients: + await client.close() + self.clients.clear() + + +class ClientHandler: + """Handles a single client connection to the devtools. + A single DevtoolsService managers many ClientHandlers. A single ClientHandler + corresponds to a single running Textual application instance, and is responsible + for communication with that Textual app. + """ + + def __init__(self, request: Request, service: DevtoolsService) -> None: + """ + Args: + request (Request): The aiohttp.Request associated with this client + service (DevtoolsService): The parent DevtoolsService which is responsible + for the handling of this client. + """ + self.request = request + self.service = service + self.websocket = WebSocketResponse() + + async def send_message(self, message: dict[str, object]) -> None: + """Send a message to a client + + Args: + message (dict[str, object]): The dict which will be sent + to the client. + """ + await self.outgoing_queue.put(message) + + async def _consume_outgoing(self) -> None: + """Consume messages from the outgoing (server -> client) Queue.""" + while True: + message_json = await self.outgoing_queue.get() + if message_json is None: + self.outgoing_queue.task_done() + break + type = message_json["type"] + if type == "server_info": + await self.websocket.send_json(message_json) + self.outgoing_queue.task_done() + + async def _consume_incoming(self) -> None: + """Consume messages from the incoming (client -> server) Queue, and print + the corresponding renderables to the console for each message. + """ + last_message_time: float | None = None + while True: + message = await self.incoming_queue.get() + if message is None: + self.incoming_queue.task_done() + break + + type = message["type"] + if type == "client_log": + payload = message["payload"] + if LogGroup(payload.get("group", 0)).name in self.service.exclude: + continue + encoded_segments = payload["segments"] + segments = pickle.loads(encoded_segments) + message_time = time() + if ( + last_message_time is not None + and message_time - last_message_time > 0.5 + ): + # Print a rule if it has been longer than half a second since the last message + self.service.console.rule() + self.service.console.print( + DevConsoleLog( + segments=segments, + path=payload["path"], + line_number=payload["line_number"], + unix_timestamp=payload["timestamp"], + group=payload.get("group", 0), + verbosity=payload.get("verbosity", 0), + severity=payload.get("severity", 0), + ) + ) + last_message_time = message_time + elif type == "client_spillover": + spillover = int(message["payload"]["spillover"]) + info_renderable = DevConsoleNotice( + f"Discarded {spillover} messages", level="warning" + ) + self.service.console.print(info_renderable) + self.incoming_queue.task_done() + + async def run(self) -> WebSocketResponse: + """Prepare the websocket and communication queues, and continuously + read messages from the queues. + + Returns: + WebSocketResponse: The WebSocketResponse associated with this client. + """ + + await self.websocket.prepare(self.request) + self.incoming_queue: asyncio.Queue[dict | None] = asyncio.Queue() + self.outgoing_queue: asyncio.Queue[dict | None] = asyncio.Queue() + self.outgoing_messages_task = asyncio.create_task(self._consume_outgoing()) + self.incoming_messages_task = asyncio.create_task(self._consume_incoming()) + + if self.request.remote: + self.service.console.print( + DevConsoleNotice(f"Client '{escape(self.request.remote)}' connected") + ) + try: + await self.service.send_server_info(client_handler=self) + async for message in self.websocket: + message = cast(WSMessage, message) + + if message.type in (WSMsgType.TEXT, WSMsgType.BINARY): + + try: + if isinstance(message.data, bytes): + message = msgpack.unpackb(message.data) + else: + message = json.loads(message.data) + except JSONDecodeError: + self.service.console.print(escape(str(message.data))) + continue + + type = message.get("type") + if not type: + continue + if ( + type in QUEUEABLE_TYPES + and not self.service.shutdown_event.is_set() + ): + await self.incoming_queue.put(message) + elif message.type == WSMsgType.ERROR: + self.service.console.print( + DevConsoleNotice("Websocket error occurred", level="error") + ) + break + except Exception as error: + self.service.console.print(DevConsoleNotice(str(error), level="error")) + finally: + if self.request.remote: + self.service.console.print( + "\n", + DevConsoleNotice( + f"Client '{escape(self.request.remote)}' disconnected" + ), + ) + await self.close() + + return self.websocket + + async def close(self) -> None: + """Stop all incoming/outgoing message processing, + and shutdown the websocket connection associated with this + client. + """ + + # Stop any writes to the websocket first + await self.outgoing_queue.put(None) + await self.outgoing_messages_task + + # Now we can shut the socket down + await self.websocket.close() + + # This task is independent of the websocket + await self.incoming_queue.put(None) + await self.incoming_messages_task diff --git a/testbed/Textualize__textual/src/textual/dom.py b/testbed/Textualize__textual/src/textual/dom.py new file mode 100644 index 0000000000000000000000000000000000000000..8bb706d1c03e70f32ad5b940b6096cde4d0dd225 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/dom.py @@ -0,0 +1,847 @@ +from __future__ import annotations + +from inspect import getfile +import re +from typing import ( + cast, + ClassVar, + Iterable, + Iterator, + Type, + overload, + TypeVar, + TYPE_CHECKING, +) + +import rich.repr +from rich.highlighter import ReprHighlighter +from rich.pretty import Pretty +from rich.style import Style +from rich.text import Text +from rich.tree import Tree + +from ._context import NoActiveAppError +from ._node_list import NodeList +from .binding import Bindings, BindingType +from .color import Color, WHITE, BLACK +from .css._error_tools import friendly_list +from .css.constants import VALID_DISPLAY, VALID_VISIBILITY +from .css.errors import StyleValueError, DeclarationError +from .css.parse import parse_declarations +from .css.styles import Styles, RenderStyles +from .css.tokenize import IDENTIFIER +from .css.query import NoMatches +from .message_pump import MessagePump +from .timer import Timer + +if TYPE_CHECKING: + from .app import App + from .css.query import DOMQuery + from .screen import Screen + from .widget import Widget + + +_re_identifier = re.compile(IDENTIFIER) + + +class BadIdentifier(Exception): + """raised by check_identifiers.""" + + +def check_identifiers(description: str, *names: str) -> None: + """Validate identifier and raise an error if it fails. + + Args: + description (str): Description of where identifier is used for error message. + names (list[str]): Identifiers to check. + + Returns: + bool: True if the name is valid. + """ + match = _re_identifier.match + for name in names: + if match(name) is None: + raise BadIdentifier( + f"{name!r} is an invalid {description}; " + "identifiers must contain only letters, numbers, underscores, or hyphens, and must not begin with a number." + ) + + +class DOMError(Exception): + pass + + +class NoScreen(DOMError): + pass + + +class NoParent(Exception): + pass + + +@rich.repr.auto +class DOMNode(MessagePump): + """The base class for object that can be in the Textual DOM (App and Widget)""" + + # CSS defaults + DEFAULT_CSS: ClassVar[str] = "" + + # Default classes argument if not supplied + DEFAULT_CLASSES: str = "" + + # Virtual DOM nodes + COMPONENT_CLASSES: ClassVar[set[str]] = set() + + # Mapping of key bindings + BINDINGS: ClassVar[list[BindingType]] = [] + + # True if this node inherits the CSS from the base class. + _inherit_css: ClassVar[bool] = True + # List of names of base class (lower cased) that inherit CSS + _css_type_names: ClassVar[frozenset[str]] = frozenset() + + def __init__( + self, + *, + name: str | None = None, + id: str | None = None, + classes: str | None = None, + ) -> None: + self._classes = set() + self._name = name + self._id = None + if id is not None: + self.id = id + + _classes = classes.split() if classes else [] + check_identifiers("class name", *_classes) + self._classes.update(_classes) + + self.children = NodeList() + self._css_styles: Styles = Styles(self) + self._inline_styles: Styles = Styles(self) + self.styles = RenderStyles(self, self._css_styles, self._inline_styles) + # A mapping of class names to Styles set in COMPONENT_CLASSES + self._component_styles: dict[str, RenderStyles] = {} + + self._auto_refresh: float | None = None + self._auto_refresh_timer: Timer | None = None + self._css_types = {cls.__name__ for cls in self._css_bases(self.__class__)} + self._bindings = Bindings(self.BINDINGS) + self._has_hover_style: bool = False + + super().__init__() + + @property + def auto_refresh(self) -> float | None: + return self._auto_refresh + + @auto_refresh.setter + def auto_refresh(self, interval: float | None) -> None: + if self._auto_refresh_timer is not None: + self._auto_refresh_timer.stop_no_wait() + self._auto_refresh_timer = None + if interval is not None: + self._auto_refresh_timer = self.set_interval( + interval, self._automatic_refresh, name=f"auto refresh {self!r}" + ) + self._auto_refresh = interval + + def _automatic_refresh(self) -> None: + """Perform an automatic refresh (set with auto_refresh property).""" + self.refresh() + + def __init_subclass__(cls, inherit_css: bool = True) -> None: + super().__init_subclass__() + cls._inherit_css = inherit_css + css_type_names: set[str] = set() + for base in cls._css_bases(cls): + css_type_names.add(base.__name__.lower()) + cls._css_type_names = frozenset(css_type_names) + + def get_component_styles(self, name: str) -> RenderStyles: + """Get a "component" styles object (must be defined in COMPONENT_CLASSES classvar). + + Args: + name (str): Name of the component. + + Raises: + KeyError: If the component class doesn't exist. + + Returns: + RenderStyles: A Styles object. + """ + if name not in self._component_styles: + raise KeyError(f"No {name!r} key in COMPONENT_CLASSES") + styles = self._component_styles[name] + return styles + + @property + def _node_bases(self) -> Iterator[Type[DOMNode]]: + """Get the DOMNode bases classes (including self.__class__) + + Returns: + Iterator[Type[DOMNode]]: An iterable of DOMNode classes. + """ + # Node bases are in reversed order so that the base class is lower priority + return self._css_bases(self.__class__) + + @classmethod + def _css_bases(cls, base: Type[DOMNode]) -> Iterator[Type[DOMNode]]: + """Get the DOMNode base classes, which inherit CSS. + + Args: + base (Type[DOMNode]): A DOMNode class + + Returns: + Iterator[Type[DOMNode]]: An iterable of DOMNode classes. + """ + _class = base + while True: + yield _class + if not _class._inherit_css: + break + for _base in _class.__bases__: + if issubclass(_base, DOMNode): + _class = _base + break + else: + break + + def _post_register(self, app: App) -> None: + """Called when the widget is registered + + Args: + app (App): Parent application. + """ + + def __rich_repr__(self) -> rich.repr.Result: + yield "name", self._name, None + yield "id", self._id, None + if self._classes: + yield "classes", " ".join(self._classes) + + def get_default_css(self) -> list[tuple[str, str, int]]: + """Gets the CSS for this class and inherited from bases. + + Returns: + list[tuple[str, str]]: a list of tuples containing (PATH, SOURCE) for this + and inherited from base classes. + """ + + css_stack: list[tuple[str, str, int]] = [] + + def get_path(base: Type[DOMNode]) -> str: + """Get a path to the DOM Node""" + try: + return f"{getfile(base)}:{base.__name__}" + except TypeError: + return f"{base.__name__}" + + for tie_breaker, base in enumerate(self._node_bases): + css = base.DEFAULT_CSS.strip() + if css: + css_stack.append((get_path(base), css, -tie_breaker)) + + return css_stack + + @property + def parent(self) -> DOMNode | None: + """Get the parent node. + + Returns: + DOMNode | None: The node which is the direct parent of this node. + """ + + return cast("DOMNode | None", self._parent) + + @property + def screen(self) -> "Screen": + """Get the screen that this node is contained within. Note that this may not be the currently active screen within the app.""" + # Get the node by looking up a chain of parents + # Note that self.screen may not be the same as self.app.screen + from .screen import Screen + + node = self + while node and not isinstance(node, Screen): + node = node._parent + if not isinstance(node, Screen): + raise NoScreen(f"{self} has no screen") + return node + + @property + def id(self) -> str | None: + """The ID of this node, or None if the node has no ID. + + Returns: + (str | None): A Node ID or None. + """ + return self._id + + @id.setter + def id(self, new_id: str) -> str: + """Sets the ID (may only be done once). + + Args: + new_id (str): ID for this node. + + Raises: + ValueError: If the ID has already been set. + + """ + check_identifiers("id", new_id) + + if self._id is not None: + raise ValueError( + f"Node 'id' attribute may not be changed once set (current id={self._id!r})" + ) + self._id = new_id + return new_id + + @property + def name(self) -> str | None: + return self._name + + @property + def css_identifier(self) -> str: + """A CSS selector that identifies this DOM node.""" + tokens = [self.__class__.__name__] + if self.id is not None: + tokens.append(f"#{self.id}") + return "".join(tokens) + + @property + def css_identifier_styled(self) -> Text: + """A stylized CSS identifier.""" + tokens = Text.styled(self.__class__.__name__) + if self.id is not None: + tokens.append(f"#{self.id}", style="bold") + if self.classes: + tokens.append(".") + tokens.append(".".join(class_name for class_name in self.classes), "italic") + if self.name: + tokens.append(f"[name={self.name}]", style="underline") + return tokens + + @property + def classes(self) -> frozenset[str]: + """A frozenset of the current classes set on the widget. + + Returns: + frozenset[str]: Set of class names. + + """ + return frozenset(self._classes) + + @property + def pseudo_classes(self) -> frozenset[str]: + """Get a set of all pseudo classes""" + pseudo_classes = frozenset({*self.get_pseudo_classes()}) + return pseudo_classes + + @property + def css_path_nodes(self) -> list[DOMNode]: + """A list of nodes from the root to this node, forming a "path". + + Returns: + list[DOMNode]: List of Nodes, starting with the root and ending with this node. + """ + result: list[DOMNode] = [self] + append = result.append + + node: DOMNode = self + while isinstance(node._parent, DOMNode): + node = node._parent + append(node) + return result[::-1] + + @property + def _selector_names(self) -> list[str]: + """Get a set of selectors applicable to this widget. + + Returns: + set[str]: Set of selector names. + """ + selectors: list[str] = [ + "*", + *(f".{class_name}" for class_name in self._classes), + *(f":{class_name}" for class_name in self.get_pseudo_classes()), + *self._css_types, + ] + if self._id is not None: + selectors.append(f"#{self._id}") + return selectors + + @property + def display(self) -> bool: + """ + Check if this widget should display or not. + + Returns: + bool: ``True`` if this DOMNode is displayed (``display != "none"``) otherwise ``False`` . + """ + return self.styles.display != "none" and not (self._closing or self._closed) + + @display.setter + def display(self, new_val: bool | str) -> None: + """ + Args: + new_val (bool | str): Shortcut to set the ``display`` CSS property. + ``False`` will set ``display: none``. ``True`` will set ``display: block``. + A ``False`` value will prevent the DOMNode from consuming space in the layout. + """ + # TODO: This will forget what the original "display" value was, so if a user + # toggles to False then True, we'll reset to the default "block", rather than + # what the user initially specified. + if isinstance(new_val, bool): + self.styles.display = "block" if new_val else "none" + elif new_val in VALID_DISPLAY: + self.styles.display = new_val + else: + raise StyleValueError( + f"invalid value for display (received {new_val!r}, " + f"expected {friendly_list(VALID_DISPLAY)})", + ) + + @property + def visible(self) -> bool: + """Check if the node is visible or None. + + Returns: + bool: True if the node is visible. + """ + return self.styles.visibility != "hidden" + + @visible.setter + def visible(self, new_value: bool) -> None: + if isinstance(new_value, bool): + self.styles.visibility = "visible" if new_value else "hidden" + elif new_value in VALID_VISIBILITY: + self.styles.visibility = new_value + else: + raise StyleValueError( + f"invalid value for visibility (received {new_value!r}, " + f"expected {friendly_list(VALID_VISIBILITY)})" + ) + + @property + def tree(self) -> Tree: + """Get a Rich tree object which will recursively render the structure of the node tree. + + Returns: + Tree: A Rich object which may be printed. + """ + from rich.columns import Columns + from rich.console import Group + from rich.panel import Panel + + from .widget import Widget + + def render_info(node: DOMNode) -> Columns: + if isinstance(node, Widget): + info = Columns( + [ + Pretty(node), + highlighter(f"region={node.region!r}"), + highlighter( + f"virtual_size={node.virtual_size!r}", + ), + ] + ) + else: + info = Columns([Pretty(node)]) + return info + + highlighter = ReprHighlighter() + tree = Tree(render_info(self)) + + def add_children(tree, node): + for child in node.children: + info = render_info(child) + css = child.styles.css + if css: + info = Group( + info, + Panel.fit( + Text(child.styles.css), + border_style="dim", + title="css", + title_align="left", + ), + ) + branch = tree.add(info) + if tree.children: + add_children(branch, child) + + add_children(tree, self) + return tree + + @property + def text_style(self) -> Style: + """Get the text style object. + + A widget's style is influenced by its parent. for instance if a parent is bold, then + the child will also be bold. + + Returns: + Style: Rich Style object. + """ + return Style.combine( + node.styles.text_style for node in reversed(self.ancestors) + ) + + @property + def rich_style(self) -> Style: + """Get a Rich Style object for this DOMNode.""" + background = WHITE + color = BLACK + style = Style() + for node in reversed(self.ancestors): + styles = node.styles + if styles.has_rule("background"): + background += styles.background + if styles.has_rule("color"): + color = styles.color + style += styles.text_style + if styles.has_rule("auto_color") and styles.auto_color: + color = background.get_contrast_text(color.a) + style += Style.from_color( + (background + color).rich_color, background.rich_color + ) + return style + + @property + def background_colors(self) -> tuple[Color, Color]: + """Get the background color and the color of the parent's background. + + Returns: + tuple[Color, Color]: Tuple of (base background, background) + + """ + base_background = background = BLACK + for node in reversed(self.ancestors): + styles = node.styles + if styles.has_rule("background"): + base_background = background + background += styles.background + return (base_background, background) + + @property + def colors(self) -> tuple[Color, Color, Color, Color]: + """Gets the Widgets foreground and background colors, and its parent's (base) colors. + + Returns: + tuple[Color, Color, Color, Color]: Tuple of (base background, base color, background, color) + """ + base_background = background = WHITE + base_color = color = BLACK + for node in reversed(self.ancestors): + styles = node.styles + if styles.has_rule("background"): + base_background = background + background += styles.background + if styles.has_rule("color"): + base_color = color + if styles.auto_color: + color = background.get_contrast_text(color.a) + else: + color = styles.color + + return (base_background, base_color, background, color) + + @property + def ancestors(self) -> list[DOMNode]: + """Get a list of Nodes by tracing ancestors all the way back to App.""" + nodes: list[MessagePump | None] = [] + add_node = nodes.append + node: MessagePump | None = self + while node is not None: + add_node(node) + node = node._parent + return cast("list[DOMNode]", nodes) + + @property + def displayed_children(self) -> list[Widget]: + """The children which don't have display: none set. + + Returns: + list[DOMNode]: Children of this widget which will be displayed. + + """ + return [child for child in self.children if child.display] + + def get_pseudo_classes(self) -> Iterable[str]: + """Get any pseudo classes applicable to this Node, e.g. hover, focus. + + Returns: + Iterable[str]: Iterable of strings, such as a generator. + """ + return () + + def reset_styles(self) -> None: + """Reset styles back to their initial state""" + from .widget import Widget + + for node in self.walk_children(): + node._css_styles.reset() + if isinstance(node, Widget): + node._set_dirty() + node._layout_required = True + + def _add_child(self, node: Widget) -> None: + """Add a new child node. + + Args: + node (DOMNode): A DOM node. + """ + self.children._append(node) + node._attach(self) + + def _add_children(self, *nodes: Widget, **named_nodes: Widget) -> None: + """Add multiple children to this node. + + Args: + *nodes (DOMNode): Positional args should be new DOM nodes. + **named_nodes (DOMNode): Keyword args will be assigned the argument name as an ID. + """ + _append = self.children._append + for node in nodes: + node._attach(self) + _append(node) + for node_id, node in named_nodes.items(): + node._attach(self) + _append(node) + node.id = node_id + + WalkType = TypeVar("WalkType") + + @overload + def walk_children( + self, + filter_type: type[WalkType], + *, + with_self: bool = True, + ) -> Iterable[WalkType]: + ... + + @overload + def walk_children(self, *, with_self: bool = True) -> Iterable[DOMNode]: + ... + + def walk_children( + self, + filter_type: type[WalkType] | None = None, + *, + with_self: bool = True, + ) -> Iterable[DOMNode | WalkType]: + """Generate descendant nodes. + + Args: + filter_type (type[WalkType] | None, optional): Filter only this type, or None for no filter. + Defaults to None. + with_self (bool, optional): Also yield self in addition to descendants. Defaults to True. + + Returns: + Iterable[DOMNode | WalkType]: An iterable of nodes. + + """ + + stack: list[Iterator[DOMNode]] = [iter(self.children)] + pop = stack.pop + push = stack.append + check_type = filter_type or DOMNode + + if with_self and isinstance(self, check_type): + yield self + + while stack: + node = next(stack[-1], None) + if node is None: + pop() + else: + if isinstance(node, check_type): + yield node + if node.children: + push(iter(node.children)) + + def get_child(self, id: str) -> DOMNode: + """Return the first child (immediate descendent) of this node with the given ID. + + Args: + id (str): The ID of the child. + + Returns: + DOMNode: The first child of this node with the ID. + + Raises: + NoMatches: if no children could be found for this ID + """ + for child in self.children: + if child.id == id: + return child + raise NoMatches(f"No child found with id={id!r}") + + ExpectType = TypeVar("ExpectType", bound="Widget") + + @overload + def query(self, selector: str | None) -> DOMQuery: + ... + + @overload + def query(self, selector: type[ExpectType]) -> DOMQuery[ExpectType]: + ... + + def query(self, selector: str | type | None = None) -> DOMQuery: + """Get a DOM query matching a selector. + + Args: + selector (str | type | None, optional): A CSS selector or `None` for all nodes. Defaults to None. + + Returns: + DOMQuery: A query object. + """ + from .css.query import DOMQuery + + query: str | None + if isinstance(selector, str) or selector is None: + query = selector + else: + query = selector.__name__ + + return DOMQuery(self, filter=query) + + @overload + def query_one(self, selector: str) -> Widget: + ... + + @overload + def query_one(self, selector: type[ExpectType]) -> ExpectType: + ... + + @overload + def query_one(self, selector: str, expect_type: type[ExpectType]) -> ExpectType: + ... + + def query_one( + self, + selector: str | type[ExpectType], + expect_type: type[ExpectType] | None = None, + ) -> ExpectType | Widget: + """Get the first Widget matching the given selector or selector type. + + Args: + selector (str | type): A selector. + expect_type (type | None, optional): Require the object be of the supplied type, or None for any type. + Defaults to None. + + Returns: + Widget | ExpectType: A widget matching the selector. + """ + from .css.query import DOMQuery + + if isinstance(selector, str): + query_selector = selector + else: + query_selector = selector.__name__ + query: DOMQuery[Widget] = DOMQuery(self, filter=query_selector) + + if expect_type is None: + return query.first() + else: + return query.first(expect_type) + + def set_styles(self, css: str | None = None, **update_styles) -> None: + """Set custom styles on this object.""" + + if css is not None: + try: + new_styles = parse_declarations(css, path="set_styles") + except DeclarationError as error: + raise DeclarationError(error.name, error.token, error.message) from None + self._inline_styles.merge(new_styles) + self.refresh(layout=True) + + styles = self.styles + for key, value in update_styles.items(): + setattr(styles, key, value) + + def has_class(self, *class_names: str) -> bool: + """Check if the Node has all the given class names. + + Args: + *class_names (str): CSS class names to check. + + Returns: + bool: ``True`` if the node has all the given class names, otherwise ``False``. + """ + return self._classes.issuperset(class_names) + + def set_class(self, add: bool, *class_names: str) -> None: + """Add or remove class(es) based on a condition. + + Args: + add (bool): Add the classes if True, otherwise remove them. + """ + if add: + self.add_class(*class_names) + else: + self.remove_class(*class_names) + + def add_class(self, *class_names: str) -> None: + """Add class names to this Node. + + Args: + *class_names (str): CSS class names to add. + + """ + check_identifiers("class name", *class_names) + old_classes = self._classes.copy() + self._classes.update(class_names) + if old_classes == self._classes: + return + try: + self.app.update_styles(self) + except NoActiveAppError: + pass + + def remove_class(self, *class_names: str) -> None: + """Remove class names from this Node. + + Args: + *class_names (str): CSS class names to remove. + + """ + check_identifiers("class name", *class_names) + old_classes = self._classes.copy() + self._classes.difference_update(class_names) + if old_classes == self._classes: + return + try: + self.app.update_styles(self) + except NoActiveAppError: + pass + + def toggle_class(self, *class_names: str) -> None: + """Toggle class names on this Node. + + Args: + *class_names (str): CSS class names to toggle. + + """ + check_identifiers("class name", *class_names) + old_classes = self._classes.copy() + self._classes.symmetric_difference_update(class_names) + if old_classes == self._classes: + return + try: + self.app.update_styles(self) + except NoActiveAppError: + pass + + def has_pseudo_class(self, *class_names: str) -> bool: + """Check for pseudo class (such as hover, focus etc)""" + has_pseudo_classes = self.pseudo_classes.issuperset(class_names) + return has_pseudo_classes + + def refresh(self, *, repaint: bool = True, layout: bool = False) -> None: + pass diff --git a/testbed/Textualize__textual/src/textual/driver.py b/testbed/Textualize__textual/src/textual/driver.py new file mode 100644 index 0000000000000000000000000000000000000000..a349540f382f8283c4fb0011135d764300028fa0 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/driver.py @@ -0,0 +1,54 @@ +from __future__ import annotations + +import asyncio +from time import time +from abc import ABC, abstractmethod +from typing import TYPE_CHECKING + +from . import events +from ._types import MessageTarget + +if TYPE_CHECKING: + from rich.console import Console + + +class Driver(ABC): + def __init__( + self, console: "Console", target: "MessageTarget", debug: bool = False + ) -> None: + self.console = console + self._target = target + self._debug = debug + self._loop = asyncio.get_running_loop() + self._mouse_down_time = time() + + def send_event(self, event: events.Event) -> None: + asyncio.run_coroutine_threadsafe( + self._target.post_message(event), loop=self._loop + ) + + def process_event(self, event: events.Event) -> None: + """Performs some additional processing of events.""" + if isinstance(event, events.MouseDown): + self._mouse_down_time = event.time + + self.send_event(event) + + if ( + isinstance(event, events.MouseUp) + and event.time - self._mouse_down_time <= 0.5 + ): + click_event = events.Click.from_event(event) + self.send_event(click_event) + + @abstractmethod + def start_application_mode(self) -> None: + ... + + @abstractmethod + def disable_input(self) -> None: + ... + + @abstractmethod + def stop_application_mode(self) -> None: + ... diff --git a/testbed/Textualize__textual/src/textual/drivers/__init__.py b/testbed/Textualize__textual/src/textual/drivers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/testbed/Textualize__textual/src/textual/drivers/headless_driver.py b/testbed/Textualize__textual/src/textual/drivers/headless_driver.py new file mode 100644 index 0000000000000000000000000000000000000000..cdde957b9df406606015d760881aa77be6e1a146 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/drivers/headless_driver.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +import asyncio +from ..driver import Driver +from ..geometry import Size +from .. import events + + +class HeadlessDriver(Driver): + """A do-nothing driver for testing.""" + + def _get_terminal_size(self) -> tuple[int, int]: + width: int | None = 80 + height: int | None = 25 + import shutil + + try: + width, height = shutil.get_terminal_size() + except (AttributeError, ValueError, OSError): + try: + width, height = shutil.get_terminal_size() + except (AttributeError, ValueError, OSError): + pass + width = width or 80 + height = height or 25 + return width, height + + def start_application_mode(self) -> None: + loop = asyncio.get_running_loop() + + def send_size_event(): + terminal_size = self._get_terminal_size() + width, height = terminal_size + textual_size = Size(width, height) + event = events.Resize(self._target, textual_size, textual_size) + asyncio.run_coroutine_threadsafe( + self._target.post_message(event), + loop=loop, + ) + + send_size_event() + + def disable_input(self) -> None: + pass + + def stop_application_mode(self) -> None: + pass diff --git a/testbed/Textualize__textual/src/textual/drivers/linux_driver.py b/testbed/Textualize__textual/src/textual/drivers/linux_driver.py new file mode 100644 index 0000000000000000000000000000000000000000..23fd24c12757dd02d14dece77c9c0feebe43995a --- /dev/null +++ b/testbed/Textualize__textual/src/textual/drivers/linux_driver.py @@ -0,0 +1,248 @@ +from __future__ import annotations + +import asyncio +import os +from codecs import getincrementaldecoder +import selectors +import signal +import sys +import termios +import tty +from typing import Any, TYPE_CHECKING +from threading import Event, Thread + +if TYPE_CHECKING: + from rich.console import Console + +import rich.repr + +from .. import log +from .. import events +from ..driver import Driver +from ..geometry import Size +from .._types import MessageTarget +from .._xterm_parser import XTermParser +from .._profile import timer + + +@rich.repr.auto +class LinuxDriver(Driver): + """Powers display and input for Linux / MacOS""" + + def __init__( + self, console: "Console", target: "MessageTarget", debug: bool = False + ) -> None: + super().__init__(console, target, debug) + self.fileno = sys.stdin.fileno() + self.attrs_before: list[Any] | None = None + self.exit_event = Event() + self._key_thread: Thread | None = None + + def __rich_repr__(self) -> rich.repr.Result: + yield "debug", self._debug + + def _get_terminal_size(self) -> tuple[int, int]: + width: int | None = 80 + height: int | None = 25 + import shutil + + try: + width, height = shutil.get_terminal_size() + except (AttributeError, ValueError, OSError): + try: + width, height = shutil.get_terminal_size() + except (AttributeError, ValueError, OSError): + pass + width = width or 80 + height = height or 25 + return width, height + + def _enable_mouse_support(self) -> None: + write = self.console.file.write + write("\x1b[?1000h") # SET_VT200_MOUSE + write("\x1b[?1003h") # SET_ANY_EVENT_MOUSE + write("\x1b[?1015h") # SET_VT200_HIGHLIGHT_MOUSE + write("\x1b[?1006h") # SET_SGR_EXT_MODE_MOUSE + + # write("\x1b[?1007h") + self.console.file.flush() + + # Note: E.g. lxterminal understands 1000h, but not the urxvt or sgr + # extensions. + + def _enable_bracketed_paste(self) -> None: + """Enable bracketed paste mode.""" + self.console.file.write("\x1b[?2004h") + + def _disable_bracketed_paste(self) -> None: + """Disable bracketed paste mode.""" + self.console.file.write("\x1b[?2004l") + + def _disable_mouse_support(self) -> None: + write = self.console.file.write + write("\x1b[?1000l") # + write("\x1b[?1003l") # + write("\x1b[?1015l") + write("\x1b[?1006l") + self.console.file.flush() + + def start_application_mode(self): + + loop = asyncio.get_running_loop() + + def send_size_event(): + terminal_size = self._get_terminal_size() + width, height = terminal_size + textual_size = Size(width, height) + event = events.Resize(self._target, textual_size, textual_size) + asyncio.run_coroutine_threadsafe( + self._target.post_message(event), + loop=loop, + ) + + def on_terminal_resize(signum, stack) -> None: + send_size_event() + + signal.signal(signal.SIGWINCH, on_terminal_resize) + + self.console.set_alt_screen(True) + self._enable_mouse_support() + try: + self.attrs_before = termios.tcgetattr(self.fileno) + except termios.error: + # Ignore attribute errors. + self.attrs_before = None + + try: + newattr = termios.tcgetattr(self.fileno) + except termios.error: + pass + else: + + newattr[tty.LFLAG] = self._patch_lflag(newattr[tty.LFLAG]) + newattr[tty.IFLAG] = self._patch_iflag(newattr[tty.IFLAG]) + + # VMIN defines the number of characters read at a time in + # non-canonical mode. It seems to default to 1 on Linux, but on + # Solaris and derived operating systems it defaults to 4. (This is + # because the VMIN slot is the same as the VEOF slot, which + # defaults to ASCII EOT = Ctrl-D = 4.) + newattr[tty.CC][termios.VMIN] = 1 + + termios.tcsetattr(self.fileno, termios.TCSANOW, newattr) + + self.console.show_cursor(False) + self.console.file.write("\033[?1003h\n") + self.console.file.flush() + self._key_thread = Thread(target=self.run_input_thread, args=(loop,)) + send_size_event() + self._key_thread.start() + self._request_terminal_sync_mode_support() + self._enable_bracketed_paste() + + def _request_terminal_sync_mode_support(self): + self.console.file.write("\033[?2026$p") + self.console.file.flush() + + @classmethod + def _patch_lflag(cls, attrs: int) -> int: + return attrs & ~(termios.ECHO | termios.ICANON | termios.IEXTEN | termios.ISIG) + + @classmethod + def _patch_iflag(cls, attrs: int) -> int: + return attrs & ~( + # Disable XON/XOFF flow control on output and input. + # (Don't capture Ctrl-S and Ctrl-Q.) + # Like executing: "stty -ixon." + termios.IXON + | termios.IXOFF + | + # Don't translate carriage return into newline on input. + termios.ICRNL + | termios.INLCR + | termios.IGNCR + ) + + def disable_input(self) -> None: + try: + if not self.exit_event.is_set(): + signal.signal(signal.SIGWINCH, signal.SIG_DFL) + self._disable_mouse_support() + self.exit_event.set() + if self._key_thread is not None: + self._key_thread.join() + termios.tcflush(self.fileno, termios.TCIFLUSH) + except Exception as error: + # TODO: log this + pass + + def stop_application_mode(self) -> None: + self._disable_bracketed_paste() + self.disable_input() + + if self.attrs_before is not None: + try: + termios.tcsetattr(self.fileno, termios.TCSANOW, self.attrs_before) + except termios.error: + pass + + with self.console: + self.console.set_alt_screen(False) + self.console.show_cursor(True) + + def run_input_thread(self, loop) -> None: + try: + self._run_input_thread(loop) + except Exception: + pass # TODO: log + + def _run_input_thread(self, loop) -> None: + + selector = selectors.DefaultSelector() + selector.register(self.fileno, selectors.EVENT_READ) + + fileno = self.fileno + + def more_data() -> bool: + """Check if there is more data to parse.""" + for key, events in selector.select(0.01): + if events: + return True + return False + + parser = XTermParser(self._target, more_data, self._debug) + feed = parser.feed + + utf8_decoder = getincrementaldecoder("utf-8")().decode + decode = utf8_decoder + read = os.read + EVENT_READ = selectors.EVENT_READ + + try: + while not self.exit_event.is_set(): + selector_events = selector.select(0.1) + for _selector_key, mask in selector_events: + if mask | EVENT_READ: + unicode_data = decode(read(fileno, 1024)) + for event in feed(unicode_data): + self.process_event(event) + except Exception as error: + log(error) + finally: + with timer("selector.close"): + selector.close() + + +if __name__ == "__main__": + from rich.console import Console + from .. import events + + console = Console() + + from ..app import App + + class MyApp(App): + async def on_mount(self, event: events.Mount) -> None: + self.set_timer(5, callback=self._close_messages) + + MyApp.run() diff --git a/testbed/Textualize__textual/src/textual/drivers/windows_driver.py b/testbed/Textualize__textual/src/textual/drivers/windows_driver.py new file mode 100644 index 0000000000000000000000000000000000000000..fb51973ea4c8b41c2124caba55c35d821cf438e2 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/drivers/windows_driver.py @@ -0,0 +1,93 @@ +from __future__ import annotations + +import asyncio +import sys +from threading import Event, Thread +from typing import TYPE_CHECKING, Callable + +from .._context import active_app +from .._types import MessageTarget +from ..driver import Driver +from . import win32 + +if TYPE_CHECKING: + from rich.console import Console + + +class WindowsDriver(Driver): + """Powers display and input for Windows.""" + + def __init__( + self, console: "Console", target: "MessageTarget", debug: bool = False + ) -> None: + super().__init__(console, target, debug) + self.in_fileno = sys.stdin.fileno() + self.out_fileno = sys.stdout.fileno() + + self.exit_event = Event() + self._event_thread: Thread | None = None + self._restore_console: Callable[[], None] | None = None + + def _enable_mouse_support(self) -> None: + write = self.console.file.write + write("\x1b[?1000h") # SET_VT200_MOUSE + write("\x1b[?1003h") # SET_ANY_EVENT_MOUSE + write("\x1b[?1015h") # SET_VT200_HIGHLIGHT_MOUSE + write("\x1b[?1006h") # SET_SGR_EXT_MODE_MOUSE + self.console.file.flush() + + def _disable_mouse_support(self) -> None: + write = self.console.file.write + write("\x1b[?1000l") + write("\x1b[?1003l") + write("\x1b[?1015l") + write("\x1b[?1006l") + self.console.file.flush() + + def _enable_bracketed_paste(self) -> None: + """Enable bracketed paste mode.""" + self.console.file.write("\x1b[?2004h") + + def _disable_bracketed_paste(self) -> None: + """Disable bracketed paste mode.""" + self.console.file.write("\x1b[?2004l") + + def start_application_mode(self) -> None: + + loop = asyncio.get_running_loop() + + self._restore_console = win32.enable_application_mode() + + self.console.set_alt_screen(True) + self._enable_mouse_support() + self.console.show_cursor(False) + self.console.file.write("\033[?1003h\n") + self._enable_bracketed_paste() + + app = active_app.get() + + self._event_thread = win32.EventMonitor( + loop, app, self._target, self.exit_event, self.process_event + ) + self._event_thread.start() + + def disable_input(self) -> None: + try: + if not self.exit_event.is_set(): + self._disable_mouse_support() + self.exit_event.set() + if self._event_thread is not None: + self._event_thread.join() + self._event_thread = None + except Exception as error: + # TODO: log this + pass + + def stop_application_mode(self) -> None: + self._disable_bracketed_paste() + self.disable_input() + if self._restore_console: + self._restore_console() + with self.console: + self.console.set_alt_screen(False) + self.console.show_cursor(True) diff --git a/testbed/Textualize__textual/src/textual/errors.py b/testbed/Textualize__textual/src/textual/errors.py new file mode 100644 index 0000000000000000000000000000000000000000..dcbf724a14cfc610da0a18dcec2fada846123e4f --- /dev/null +++ b/testbed/Textualize__textual/src/textual/errors.py @@ -0,0 +1,13 @@ +from __future__ import annotations + + +class TextualError(Exception): + """Base class for Textual errors.""" + + +class NoWidget(TextualError): + """Specified widget was not found.""" + + +class RenderError(TextualError): + """An object could not be rendered.""" diff --git a/testbed/Textualize__textual/src/textual/events.py b/testbed/Textualize__textual/src/textual/events.py new file mode 100644 index 0000000000000000000000000000000000000000..d0cb8c24ab787505e412d4a54fdfc4083a7c19c4 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/events.py @@ -0,0 +1,496 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Awaitable, Callable, Type, TypeVar + +import rich.repr +from rich.style import Style + +from ._types import MessageTarget +from .geometry import Offset, Size +from .message import Message + +MouseEventT = TypeVar("MouseEventT", bound="MouseEvent") + +if TYPE_CHECKING: + from .timer import Timer as TimerClass + from .timer import TimerCallback + from .widget import Widget + + +@rich.repr.auto +class Event(Message): + """The base class for all events.""" + + def __rich_repr__(self) -> rich.repr.Result: + return + yield + + +@rich.repr.auto +class Callback(Event, bubble=False, verbose=True): + def __init__( + self, sender: MessageTarget, callback: Callable[[], Awaitable[None]] + ) -> None: + self.callback = callback + super().__init__(sender) + + def __rich_repr__(self) -> rich.repr.Result: + yield "callback", self.callback + + +class InvokeCallbacks(Event, bubble=False, verbose=True): + """Sent after the Screen is updated""" + + +class ShutdownRequest(Event): + pass + + +class Shutdown(Event): + pass + + +class Load(Event, bubble=False): + """ + Sent when the App is running but *before* the terminal is in application mode. + + Use this event to run any set up that doesn't require any visuals such as loading + configuration and binding keys. + + + """ + + +class Idle(Event, bubble=False): + """Sent when there are no more items in the message queue. + + This is a pseudo-event in that it is created by the Textual system and doesn't go + through the usual message queue. + + """ + + +class Action(Event): + __slots__ = ["action"] + + def __init__(self, sender: MessageTarget, action: str) -> None: + super().__init__(sender) + self.action = action + + def __rich_repr__(self) -> rich.repr.Result: + yield "action", self.action + + +class Resize(Event, bubble=False): + """Sent when the app or widget has been resized. + Args: + sender (MessageTarget): The sender of the event (the Screen). + size (Size): The new size of the Widget. + virtual_size (Size): The virtual size (scrollable size) of the Widget. + container_size (Size | None, optional): The size of the Widget's container widget. Defaults to None. + + """ + + __slots__ = ["size", "virtual_size", "container_size"] + + def __init__( + self, + sender: MessageTarget, + size: Size, + virtual_size: Size, + container_size: Size | None = None, + ) -> None: + self.size = size + self.virtual_size = virtual_size + self.container_size = size if container_size is None else container_size + super().__init__(sender) + + def can_replace(self, message: "Message") -> bool: + return isinstance(message, Resize) + + def __rich_repr__(self) -> rich.repr.Result: + yield "size", self.size + yield "virtual_size", self.virtual_size + yield "container_size", self.container_size, self.size + + +class Compose(Event, bubble=False, verbose=True): + """Sent to a widget to request it to compose and mount children.""" + + +class Mount(Event, bubble=False, verbose=True): + """Sent when a widget is *mounted* and may receive messages.""" + + +class Remove(Event, bubble=False): + """Sent to a widget to ask it to remove itself from the DOM.""" + + def __init__(self, sender: MessageTarget, widget: Widget) -> None: + self.widget = widget + super().__init__(sender) + + +class Show(Event, bubble=False): + """Sent when a widget has become visible.""" + + +class Hide(Event, bubble=False): + """Sent when a widget has been hidden. + + A widget may be hidden by setting its `visible` flag to `False`, if it is no longer in a layout, + or if it has been offset beyond the edges of the terminal. + + """ + + +@rich.repr.auto +class MouseCapture(Event, bubble=False): + """Sent when the mouse has been captured. + + When a mouse has been captures, all further mouse events will be sent to the capturing widget. + + + Args: + sender (MessageTarget): The sender of the event, (in this case the app). + mouse_position (Point): The position of the mouse when captured. + + """ + + def __init__(self, sender: MessageTarget, mouse_position: Offset) -> None: + super().__init__(sender) + self.mouse_position = mouse_position + + def __rich_repr__(self) -> rich.repr.Result: + yield None, self.mouse_position + + +@rich.repr.auto +class MouseRelease(Event, bubble=False): + """Mouse has been released. + + Args: + sender (MessageTarget): The sender of the event, (in this case the app). + mouse_position (Point): The position of the mouse when released. + """ + + def __init__(self, sender: MessageTarget, mouse_position: Offset) -> None: + super().__init__(sender) + self.mouse_position = mouse_position + + def __rich_repr__(self) -> rich.repr.Result: + yield None, self.mouse_position + + +class InputEvent(Event): + pass + + +@rich.repr.auto +class Key(InputEvent): + """Sent when the user hits a key on the keyboard. + + Args: + sender (MessageTarget): The sender of the event (the App). + key (str): A key name (textual.keys.Keys). + char (str | None, optional): A printable character or None if it is not printable. + """ + + __slots__ = ["key", "char"] + + def __init__(self, sender: MessageTarget, key: str, char: str | None) -> None: + super().__init__(sender) + self.key = key + self.char = (key if len(key) == 1 else None) if char is None else char + + def __rich_repr__(self) -> rich.repr.Result: + yield "key", self.key + yield "char", self.char, None + + @property + def key_name(self) -> str | None: + """Name of a key suitable for use as a Python identifier.""" + return self.key.replace("+", "_") + + @property + def is_printable(self) -> bool: + """Return True if the key is printable. Currently, we assume any key event that + isn't defined in key bindings is printable. + + Returns: + bool: True if the key is printable. + """ + return False if self.char is None else self.char.isprintable() + + +@rich.repr.auto +class MouseEvent(InputEvent, bubble=True): + """Sent in response to a mouse event. + + Args: + sender (MessageTarget): The sender of the event. + x (int): The relative x coordinate. + y (int): The relative y coordinate. + delta_x (int): Change in x since the last message. + delta_y (int): Change in y since the last message. + button (int): Indexed of the pressed button. + shift (bool): True if the shift key is pressed. + meta (bool): True if the meta key is pressed. + ctrl (bool): True if the ctrl key is pressed. + screen_x (int, optional): The absolute x coordinate. + screen_y (int, optional): The absolute y coordinate. + style (Style, optional): The Rich Style under the mouse cursor. + + """ + + __slots__ = [ + "x", + "y", + "delta_x", + "delta_y", + "button", + "shift", + "meta", + "ctrl", + "screen_x", + "screen_y", + "_style", + ] + + def __init__( + self, + sender: MessageTarget, + x: int, + y: int, + delta_x: int, + delta_y: int, + button: int, + shift: bool, + meta: bool, + ctrl: bool, + screen_x: int | None = None, + screen_y: int | None = None, + style: Style | None = None, + ) -> None: + super().__init__(sender) + self.x = x + self.y = y + self.delta_x = delta_x + self.delta_y = delta_y + self.button = button + self.shift = shift + self.meta = meta + self.ctrl = ctrl + self.screen_x = x if screen_x is None else screen_x + self.screen_y = y if screen_y is None else screen_y + self._style = style or Style() + + @classmethod + def from_event(cls: Type[MouseEventT], event: MouseEvent) -> MouseEventT: + new_event = cls( + event.sender, + event.x, + event.y, + event.delta_x, + event.delta_y, + event.button, + event.shift, + event.meta, + event.ctrl, + event.screen_x, + event.screen_y, + event._style, + ) + return new_event + + def __rich_repr__(self) -> rich.repr.Result: + yield "x", self.x + yield "y", self.y + yield "delta_x", self.delta_x, 0 + yield "delta_y", self.delta_y, 0 + if self.screen_x != self.x: + yield "screen_x", self.screen_x + if self.screen_y != self.y: + yield "screen_y", self.screen_y + yield "button", self.button, 0 + yield "shift", self.shift, False + yield "meta", self.meta, False + yield "ctrl", self.ctrl, False + + @property + def offset(self) -> Offset: + """The mouse coordinate as an offset. + + Returns: + Offset: Mouse coordinate. + + """ + return Offset(self.x, self.y) + + @property + def screen_offset(self) -> Offset: + """Mouse coordinate relative to the screen. + + Returns: + Offset: Mouse coordinate. + """ + return Offset(self.screen_x, self.screen_y) + + @property + def delta(self) -> Offset: + """Mouse coordinate delta (change since last event). + + Returns: + Offset: Mouse coordinate. + + """ + return Offset(self.delta_x, self.delta_y) + + @property + def style(self) -> Style: + """The (Rich) Style under the cursor.""" + return self._style or Style() + + @style.setter + def style(self, style: Style) -> None: + self._style = style + + def get_content_offset(self, widget: Widget) -> Offset | None: + """Get offset within a widget's content area, or None if offset is not in content (i.e. padding or border). + + Args: + widget (Widget): Widget receiving the event. + + Returns: + Offset | None: An offset where the origin is at the top left of the content area. + """ + if self.offset not in widget.content_region: + return None + return self.offset - widget.gutter.top_left + + def _apply_offset(self, x: int, y: int) -> MouseEvent: + return self.__class__( + self.sender, + x=self.x + x, + y=self.y + y, + delta_x=self.delta_x, + delta_y=self.delta_y, + button=self.button, + shift=self.shift, + meta=self.meta, + ctrl=self.ctrl, + screen_x=self.screen_x, + screen_y=self.screen_y, + style=self.style, + ) + + +@rich.repr.auto +class MouseMove(MouseEvent, bubble=False, verbose=True): + """Sent when the mouse cursor moves.""" + + +@rich.repr.auto +class MouseDown(MouseEvent, bubble=True, verbose=True): + pass + + +@rich.repr.auto +class MouseUp(MouseEvent, bubble=True, verbose=True): + pass + + +class MouseScrollDown(InputEvent, bubble=True, verbose=True): + __slots__ = ["x", "y"] + + def __init__(self, sender: MessageTarget, x: int, y: int) -> None: + super().__init__(sender) + self.x = x + self.y = y + + +class MouseScrollUp(InputEvent, bubble=True, verbose=True): + __slots__ = ["x", "y"] + + def __init__(self, sender: MessageTarget, x: int, y: int) -> None: + super().__init__(sender) + self.x = x + self.y = y + + +class Click(MouseEvent, bubble=True): + pass + + +@rich.repr.auto +class Timer(Event, bubble=False, verbose=True): + __slots__ = ["time", "count", "callback"] + + def __init__( + self, + sender: MessageTarget, + timer: "TimerClass", + time: float, + count: int = 0, + callback: TimerCallback | None = None, + ) -> None: + super().__init__(sender) + self.timer = timer + self.time = time + self.count = count + self.callback = callback + + def __rich_repr__(self) -> rich.repr.Result: + yield self.timer.name + yield "count", self.count + + +class Enter(Event, bubble=False, verbose=True): + pass + + +class Leave(Event, bubble=False, verbose=True): + pass + + +class Focus(Event, bubble=False): + pass + + +class Blur(Event, bubble=False): + pass + + +class DescendantFocus(Event, bubble=True, verbose=True): + pass + + +class DescendantBlur(Event, bubble=True, verbose=True): + pass + + +@rich.repr.auto +class Paste(Event, bubble=False): + """Event containing text that was pasted into the Textual application. + This event will only appear when running in a terminal emulator that supports + bracketed paste mode. Textual will enable bracketed pastes when an app starts, + and disable it when the app shuts down. + + Args: + sender (MessageTarget): The sender of the event, (in this case the app). + text: The text that has been pasted. + """ + + def __init__(self, sender: MessageTarget, text: str) -> None: + super().__init__(sender) + self.text = text + + def __rich_repr__(self) -> rich.repr.Result: + yield "text", self.text + + +class ScreenResume(Event, bubble=False): + pass + + +class ScreenSuspend(Event, bubble=False): + pass diff --git a/testbed/Textualize__textual/src/textual/features.py b/testbed/Textualize__textual/src/textual/features.py new file mode 100644 index 0000000000000000000000000000000000000000..3d7aa6c0a2635b8c7307ff08b63b21532c1b4815 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/features.py @@ -0,0 +1,31 @@ +from __future__ import annotations + +import sys + +from typing import cast + +if sys.version_info >= (3, 8): + from typing import Final, Literal +else: + from typing_extensions import Final, Literal + +FEATURES: Final = {"devtools", "debug", "headless"} + +FeatureFlag = Literal["devtools", "debug", "headless"] + + +def parse_features(features: str) -> frozenset[FeatureFlag]: + """Parse features env var + + Args: + features (str): Comma separated feature flags + + Returns: + frozenset[FeatureFlag]: A frozen set of known features. + """ + + features_set = frozenset( + feature.strip().lower() for feature in features.split(",") if feature.strip() + ).intersection(FEATURES) + + return cast("frozenset[FeatureFlag]", features_set) diff --git a/testbed/Textualize__textual/src/textual/file_monitor.py b/testbed/Textualize__textual/src/textual/file_monitor.py new file mode 100644 index 0000000000000000000000000000000000000000..562682db8f663248f77c4823c8f416774bddd470 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/file_monitor.py @@ -0,0 +1,36 @@ +import os +from pathlib import PurePath +from typing import Callable + +import rich.repr + +from ._callback import invoke + + +@rich.repr.auto +class FileMonitor: + """Monitors a file for changes and invokes a callback when it does.""" + + def __init__(self, path: PurePath, callback: Callable) -> None: + self.path = path + self.callback = callback + self._modified = self._get_modified() + + def _get_modified(self) -> float: + """Get the modified time for a file being watched.""" + return os.stat(self.path).st_mtime + + def check(self) -> bool: + """Check the monitored file. Return True if it was changed.""" + modified = self._get_modified() + changed = modified != self._modified + self._modified = modified + return changed + + async def __call__(self) -> None: + if self.check(): + await self.on_change() + + async def on_change(self) -> None: + """Called when file changes.""" + await invoke(self.callback) diff --git a/testbed/Textualize__textual/src/textual/geometry.py b/testbed/Textualize__textual/src/textual/geometry.py new file mode 100644 index 0000000000000000000000000000000000000000..e6dac8220999ec317407b687c1145093dd8aa635 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/geometry.py @@ -0,0 +1,1040 @@ +""" + +Functions and classes to manage terminal geometry (anything involving coordinates or dimensions). + +""" + +from __future__ import annotations + +import sys +from functools import lru_cache +from operator import attrgetter, itemgetter +from typing import Any, Collection, NamedTuple, Tuple, TypeVar, Union, cast + +if sys.version_info >= (3, 10): + from typing import TypeAlias +else: # pragma: no cover + from typing_extensions import TypeAlias + +SpacingDimensions: TypeAlias = Union[ + int, Tuple[int], Tuple[int, int], Tuple[int, int, int, int] +] + +T = TypeVar("T", int, float) + + +def clamp(value: T, minimum: T, maximum: T) -> T: + """Adjust a value to it is not less than a minimum and not greater + than a maximum value. + + Args: + value (T): A value. + minimum (T): Minimum value. + maximum (T): maximum value. + + Returns: + T: New value that is not less than the minimum or greater than the maximum. + """ + if minimum > maximum: + maximum, minimum = minimum, maximum + if value < minimum: + return minimum + elif value > maximum: + return maximum + else: + return value + + +class Offset(NamedTuple): + """A cell offset defined by x and y coordinates. Offsets are typically relative to the + top left of the terminal or other container. + + Textual prefers the names `x` and `y`, but you could consider `x` to be the _column_ and `y` to be the _row_. + + """ + + x: int = 0 + """Offset in the x-axis (horizontal)""" + y: int = 0 + """Offset in the y-axis (vertical)""" + + @property + def is_origin(self) -> bool: + """Check if the point is at the origin (0, 0). + + Returns: + bool: True if the offset is the origin. + + """ + return self == (0, 0) + + def __bool__(self) -> bool: + return self != (0, 0) + + def __add__(self, other: object) -> Offset: + if isinstance(other, tuple): + _x, _y = self + x, y = other + return Offset(_x + x, _y + y) + return NotImplemented + + def __sub__(self, other: object) -> Offset: + if isinstance(other, tuple): + _x, _y = self + x, y = other + return Offset(_x - x, _y - y) + return NotImplemented + + def __mul__(self, other: object) -> Offset: + if isinstance(other, (float, int)): + x, y = self + return Offset(int(x * other), int(y * other)) + return NotImplemented + + def __neg__(self) -> Offset: + x, y = self + return Offset(-x, -y) + + def blend(self, destination: Offset, factor: float) -> Offset: + """Blend (interpolate) to a new point. + + Args: + destination (Point): Point where factor would be 1.0. + factor (float): A value between 0 and 1.0. + + Returns: + Point: A new point on a line between self and destination. + """ + x1, y1 = self + x2, y2 = destination + return Offset( + int(x1 + (x2 - x1) * factor), + int(y1 + (y2 - y1) * factor), + ) + + def get_distance_to(self, other: Offset) -> float: + """Get the distance to another offset. + + Args: + other (Offset): An offset. + + Returns: + float: Distance to other offset. + """ + x1, y1 = self + x2, y2 = other + distance = ((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)) ** 0.5 + return distance + + +class Size(NamedTuple): + """The dimensions of a rectangular region.""" + + width: int = 0 + """The width in cells.""" + + height: int = 0 + """The height in cells.""" + + def __bool__(self) -> bool: + """A Size is Falsy if it has area 0.""" + return self.width * self.height != 0 + + @property + def area(self) -> int: + """Get the area of the size. + + Returns: + int: Area in cells. + """ + return self.width * self.height + + @property + def region(self) -> Region: + """Get a region of the same size. + + Returns: + Region: A region with the same size at (0, 0). + + """ + width, height = self + return Region(0, 0, width, height) + + @property + def line_range(self) -> range: + """Get a range covering lines. + + Returns: + range: A builtin range object. + """ + return range(self.height) + + def __add__(self, other: object) -> Size: + if isinstance(other, tuple): + width, height = self + width2, height2 = other + return Size(max(0, width + width2), max(0, height + height2)) + return NotImplemented + + def __sub__(self, other: object) -> Size: + if isinstance(other, tuple): + width, height = self + width2, height2 = other + return Size(max(0, width - width2), max(0, height - height2)) + return NotImplemented + + def contains(self, x: int, y: int) -> bool: + """Check if a point is in area defined by the size. + + Args: + x (int): X coordinate. + y (int): Y coordinate. + + Returns: + bool: True if the point is within the region. + """ + width, height = self + return width > x >= 0 and height > y >= 0 + + def contains_point(self, point: tuple[int, int]) -> bool: + """Check if a point is in the area defined by the size. + + Args: + point (tuple[int, int]): A tuple of x and y coordinates. + + Returns: + bool: True if the point is within the region. + """ + x, y = point + width, height = self + return width > x >= 0 and height > y >= 0 + + def __contains__(self, other: Any) -> bool: + try: + x, y = other + except Exception: + raise TypeError( + "Dimensions.__contains__ requires an iterable of two integers" + ) + width, height = self + return width > x >= 0 and height > y >= 0 + + +class Region(NamedTuple): + """Defines a rectangular region. + + A Region consists of a coordinate (x and y) and dimensions (width and height). + + ``` + (x, y) + ┌────────────────────┐ ▲ + │ │ │ + │ │ │ + │ │ height + │ │ │ + │ │ │ + └────────────────────┘ ▼ + ◀─────── width ──────▶ + ``` + + """ + + x: int = 0 + """Offset in the x-axis (horizontal).""" + y: int = 0 + """Offset in the y-axis (vertical).""" + width: int = 0 + """The width of the region.""" + height: int = 0 + """The height of the region.""" + + @classmethod + def from_union(cls, regions: Collection[Region]) -> Region: + """Create a Region from the union of other regions. + + Args: + regions (Collection[Region]): One or more regions. + + Returns: + Region: A Region that encloses all other regions. + """ + if not regions: + raise ValueError("At least one region expected") + min_x = min(regions, key=itemgetter(0)).x + max_x = max(regions, key=attrgetter("right")).right + min_y = min(regions, key=itemgetter(1)).y + max_y = max(regions, key=attrgetter("bottom")).bottom + return cls(min_x, min_y, max_x - min_x, max_y - min_y) + + @classmethod + def from_corners(cls, x1: int, y1: int, x2: int, y2: int) -> Region: + """Construct a Region form the top left and bottom right corners. + + Args: + x1 (int): Top left x. + y1 (int): Top left y. + x2 (int): Bottom right x. + y2 (int): Bottom right y. + + Returns: + Region: A new region. + """ + return cls(x1, y1, x2 - x1, y2 - y1) + + @classmethod + def from_offset(cls, offset: tuple[int, int], size: tuple[int, int]) -> Region: + """Create a region from offset and size. + + Args: + offset (Point): Offset (top left point). + size (tuple[int, int]): Dimensions of region. + + Returns: + Region: A region instance. + """ + x, y = offset + width, height = size + return cls(x, y, width, height) + + @classmethod + def get_scroll_to_visible(cls, window_region: Region, region: Region) -> Offset: + """Calculate the smallest offset required to translate a window so that it contains + another region. + + This method is used to calculate the required offset to scroll something in to view. + + Args: + window_region (Region): The window region. + region (Region): The region to move inside the window. + + Returns: + Offset: An offset required to add to region to move it inside window_region. + """ + + if region in window_region: + # Region is already inside the window, so no need to move it. + return Offset(0, 0) + + window_left, window_top, window_right, window_bottom = window_region.corners + region = region.crop_size(window_region.size) + left, top, right, bottom = region.corners + delta_x = delta_y = 0 + + if not ( + (window_right > left >= window_left) + and (window_right > right >= window_left) + ): + # The region does not fit + # The window needs to scroll on the X axis to bring region in to view + delta_x = min( + left - window_left, + left - (window_right - region.width), + key=abs, + ) + + if not ( + (window_bottom > top >= window_top) + and (window_bottom > bottom >= window_top) + ): + # The window needs to scroll on the Y axis to bring region in to view + delta_y = min( + top - window_top, + top - (window_bottom - region.height), + key=abs, + ) + return Offset(delta_x, delta_y) + + def __bool__(self) -> bool: + """A Region is considered False when it has no area.""" + _, _, width, height = self + return width * height > 0 + + @property + def column_span(self) -> tuple[int, int]: + """Get the start and end columns (x coord). + + The end value is exclusive. + + Returns: + tuple[int, int]: Pair of x coordinates (column numbers). + + """ + return (self.x, self.x + self.width) + + @property + def line_span(self) -> tuple[int, int]: + """Get the start and end line number (y coord). + + The end value is exclusive. + + Returns: + tuple[int, int]: Pair of y coordinates (line numbers). + + """ + return (self.y, self.y + self.height) + + @property + def right(self) -> int: + """Maximum X value (non inclusive). + + Returns: + int: x coordinate. + + """ + return self.x + self.width + + @property + def bottom(self) -> int: + """Maximum Y value (non inclusive). + + Returns: + int: y coordinate. + + """ + return self.y + self.height + + @property + def area(self) -> int: + """Get the area within the region. + + Returns: + int: Area covered by this region. + + """ + return self.width * self.height + + @property + def offset(self) -> Offset: + """Get the start point of the region. + + Returns: + Offset: Top left offset. + + """ + return Offset(self.x, self.y) + + @property + def bottom_left(self) -> Offset: + """Bottom left offset of the region. + + Returns: + Offset: Bottom left offset. + + """ + x, y, _width, height = self + return Offset(x, y + height) + + @property + def top_right(self) -> Offset: + """Top right offset of the region. + + Returns: + Offset: Top right. + + """ + x, y, width, _height = self + return Offset(x + width, y) + + @property + def bottom_right(self) -> Offset: + """Bottom right of the region. + + Returns: + Offset: Bottom right. + + """ + x, y, width, height = self + return Offset(x + width, y + height) + + @property + def size(self) -> Size: + """Get the size of the region. + + Returns: + Size: Size of the region. + + """ + return Size(self.width, self.height) + + @property + def corners(self) -> tuple[int, int, int, int]: + """Get the top left and bottom right coordinates as a tuple of integers. + + Returns: + tuple[int, int, int, int]: A tuple of `(, , , )`. + """ + x, y, width, height = self + return x, y, x + width, y + height + + @property + def column_range(self) -> range: + """A range object for X coordinates.""" + return range(self.x, self.x + self.width) + + @property + def line_range(self) -> range: + """A range object for Y coordinates.""" + return range(self.y, self.y + self.height) + + @property + def reset_offset(self) -> Region: + """An region of the same size at (0, 0). + + Returns: + Region: reset region. + + """ + _, _, width, height = self + return Region(0, 0, width, height) + + def __add__(self, other: object) -> Region: + if isinstance(other, tuple): + ox, oy = other + x, y, width, height = self + return Region(x + ox, y + oy, width, height) + return NotImplemented + + def __sub__(self, other: object) -> Region: + if isinstance(other, tuple): + ox, oy = other + x, y, width, height = self + return Region(x - ox, y - oy, width, height) + return NotImplemented + + def at_offset(self, offset: tuple[int, int]) -> Region: + """Get a new Region with the same size at a given offset. + + Args: + offset (tuple[int, int]): An offset. + + Returns: + Region: New Region with adjusted offset. + """ + x, y = offset + _x, _y, width, height = self + return Region(x, y, width, height) + + def crop_size(self, size: tuple[int, int]) -> Region: + """Get a region with the same offset, with a size no larger than `size`. + + Args: + size (tuple[int, int]): Maximum width and height (WIDTH, HEIGHT). + + Returns: + Region: New region that could fit within `size`. + """ + x, y, width1, height1 = self + width2, height2 = size + return Region(x, y, min(width1, width2), min(height1, height2)) + + def expand(self, size: tuple[int, int]) -> Region: + """Increase the size of the region by adding a border. + + Args: + size (tuple[int, int]): Additional width and height. + + Returns: + Region: A new region. + """ + expand_width, expand_height = size + x, y, width, height = self + return Region( + x - expand_width, + y - expand_height, + width + expand_width * 2, + height + expand_height * 2, + ) + + def clip_size(self, size: tuple[int, int]) -> Region: + """Clip the size to fit within minimum values. + + Args: + size (tuple[int, int]): Maximum width and height. + + Returns: + Region: No region, not bigger than size. + """ + x, y, width, height = self + max_width, max_height = size + return Region(x, y, min(width, max_width), min(height, max_height)) + + @lru_cache(maxsize=1024) + def overlaps(self, other: Region) -> bool: + """Check if another region overlaps this region. + + Args: + other (Region): A Region. + + Returns: + bool: True if other region shares any cells with this region. + """ + x, y, x2, y2 = self.corners + ox, oy, ox2, oy2 = other.corners + + return ((x2 > ox >= x) or (x2 > ox2 > x) or (ox < x and ox2 >= x2)) and ( + (y2 > oy >= y) or (y2 > oy2 > y) or (oy < y and oy2 >= y2) + ) + + def contains(self, x: int, y: int) -> bool: + """Check if a point is in the region. + + Args: + x (int): X coordinate. + y (int): Y coordinate. + + Returns: + bool: True if the point is within the region. + """ + self_x, self_y, width, height = self + return (self_x + width > x >= self_x) and (self_y + height > y >= self_y) + + def contains_point(self, point: tuple[int, int]) -> bool: + """Check if a point is in the region. + + Args: + point (tuple[int, int]): A tuple of x and y coordinates. + + Returns: + bool: True if the point is within the region. + """ + x1, y1, x2, y2 = self.corners + try: + ox, oy = point + except Exception: + raise TypeError(f"a tuple of two integers is required, not {point!r}") + return (x2 > ox >= x1) and (y2 > oy >= y1) + + @lru_cache(maxsize=1024) + def contains_region(self, other: Region) -> bool: + """Check if a region is entirely contained within this region. + + Args: + other (Region): A region. + + Returns: + bool: True if the other region fits perfectly within this region. + """ + x1, y1, x2, y2 = self.corners + ox, oy, ox2, oy2 = other.corners + return ( + (x2 >= ox >= x1) + and (y2 >= oy >= y1) + and (x2 >= ox2 >= x1) + and (y2 >= oy2 >= y1) + ) + + def translate(self, offset: tuple[int, int]) -> Region: + """Move the offset of the Region. + + Args: + offset (tuple[int, int]): Offset to add to region. + + Returns: + Region: A new region shifted by (x, y) + """ + + self_x, self_y, width, height = self + offset_x, offset_y = offset + return Region(self_x + offset_x, self_y + offset_y, width, height) + + @lru_cache(maxsize=4096) + def __contains__(self, other: Any) -> bool: + """Check if a point is in this region.""" + if isinstance(other, Region): + return self.contains_region(other) + else: + try: + return self.contains_point(other) + except TypeError: + return False + + def clip(self, width: int, height: int) -> Region: + """Clip this region to fit within width, height. + + Args: + width (int): Width of bounds. + height (int): Height of bounds. + + Returns: + Region: Clipped region. + """ + x1, y1, x2, y2 = self.corners + + _clamp = clamp + new_region = Region.from_corners( + _clamp(x1, 0, width), + _clamp(y1, 0, height), + _clamp(x2, 0, width), + _clamp(y2, 0, height), + ) + return new_region + + def grow(self, margin: tuple[int, int, int, int]) -> Region: + """Grow a region by adding spacing. + + Args: + margin (tuple[int, int, in, int]): Grow space by `(, , , )`. + + Returns: + Region: New region. + """ + + top, right, bottom, left = margin + x, y, width, height = self + return Region( + x=x - left, + y=y - top, + width=max(0, width + left + right), + height=max(0, height + top + bottom), + ) + + def shrink(self, margin: tuple[int, int, int, int]) -> Region: + """Shrink a region by subtracting spacing. + + Args: + margin (tuple[int, int, int, int]): Shrink space by `(, , , )`. + + Returns: + Region: The new, smaller region. + """ + + top, right, bottom, left = margin + x, y, width, height = self + return Region( + x=x + left, + y=y + top, + width=max(0, width - (left + right)), + height=max(0, height - (top + bottom)), + ) + + @lru_cache(maxsize=4096) + def intersection(self, region: Region) -> Region: + """Get the overlapping portion of the two regions. + + Args: + region (Region): A region that overlaps this region. + + Returns: + Region: A new region that covers when the two regions overlap. + """ + # Unrolled because this method is used a lot + x1, y1, w1, h1 = self + cx1, cy1, w2, h2 = region + x2 = x1 + w1 + y2 = y1 + h1 + cx2 = cx1 + w2 + cy2 = cy1 + h2 + + rx1 = cx2 if x1 > cx2 else (cx1 if x1 < cx1 else x1) + ry1 = cy2 if y1 > cy2 else (cy1 if y1 < cy1 else y1) + rx2 = cx2 if x2 > cx2 else (cx1 if x2 < cx1 else x2) + ry2 = cy2 if y2 > cy2 else (cy1 if y2 < cy1 else y2) + + return Region(rx1, ry1, rx2 - rx1, ry2 - ry1) + + @lru_cache(maxsize=4096) + def union(self, region: Region) -> Region: + """Get the smallest region that contains both regions. + + Args: + region (Region): Another region. + + Returns: + Region: An optimally sized region to cover both regions. + """ + x1, y1, x2, y2 = self.corners + ox1, oy1, ox2, oy2 = region.corners + + union_region = self.from_corners( + min(x1, ox1), min(y1, oy1), max(x2, ox2), max(y2, oy2) + ) + return union_region + + @lru_cache(maxsize=1024) + def split(self, cut_x: int, cut_y: int) -> tuple[Region, Region, Region, Region]: + """Split a region in to 4 from given x and y offsets (cuts). + + ``` + cut_x ↓ + ┌────────┐ ┌───┐ + │ │ │ │ + │ 0 │ │ 1 │ + │ │ │ │ + cut_y → └────────┘ └───┘ + ┌────────┐ ┌───┐ + │ 2 │ │ 3 │ + └────────┘ └───┘ + ``` + + Args: + cut_x (int): Offset from self.x where the cut should be made. If negative, the cut + is taken from the right edge. + cut_y (int): Offset from self.y where the cut should be made. If negative, the cut + is taken from the lower edge. + + Returns: + tuple[Region, Region, Region, Region]: Four new regions which add up to the original (self). + """ + + x, y, width, height = self + if cut_x < 0: + cut_x = width + cut_x + if cut_y < 0: + cut_y = height + cut_y + + _Region = Region + return ( + _Region(x, y, cut_x, cut_y), + _Region(x + cut_x, y, width - cut_x, cut_y), + _Region(x, y + cut_y, cut_x, height - cut_y), + _Region(x + cut_x, y + cut_y, width - cut_x, height - cut_y), + ) + + @lru_cache(maxsize=1024) + def split_vertical(self, cut: int) -> tuple[Region, Region]: + """Split a region in to two, from a given x offset. + + ``` + cut ↓ + ┌────────┐┌───┐ + │ 0 ││ 1 │ + │ ││ │ + └────────┘└───┘ + ``` + + Args: + cut (int): An offset from self.x where the cut should be made. If cut is negative, + it is taken from the right edge. + + Returns: + tuple[Region, Region]: Two regions, which add up to the original (self). + """ + + x, y, width, height = self + if cut < 0: + cut = width + cut + + return ( + Region(x, y, cut, height), + Region(x + cut, y, width - cut, height), + ) + + @lru_cache(maxsize=1024) + def split_horizontal(self, cut: int) -> tuple[Region, Region]: + """Split a region in to two, from a given x offset. + + ``` + ┌─────────┐ + │ 0 │ + │ │ + cut → └─────────┘ + ┌─────────┐ + │ 1 │ + └─────────┘ + ``` + + Args: + cut (int): An offset from self.x where the cut should be made. May be negative, + for the offset to start from the right edge. + + Returns: + tuple[Region, Region]: Two regions, which add up to the original (self). + """ + x, y, width, height = self + if cut < 0: + cut = height + cut + + return ( + Region(x, y, width, cut), + Region(x, y + cut, width, height - cut), + ) + + +class Spacing(NamedTuple): + """The spacing around a renderable.""" + + top: int = 0 + """Space from the top of a region.""" + right: int = 0 + """Space from the left of a region.""" + bottom: int = 0 + """Space from the bottom of a region.""" + left: int = 0 + """Space from the left of a region.""" + + def __bool__(self) -> bool: + return self != (0, 0, 0, 0) + + @property + def width(self) -> int: + """Total space in width. + + Returns: + int: Width. + + """ + return self.left + self.right + + @property + def height(self) -> int: + """Total space in height. + + Returns: + int: Height. + + """ + return self.top + self.bottom + + @property + def top_left(self) -> tuple[int, int]: + """Top left space. + + Returns: + tuple[int, int]: `(, )` + + """ + return (self.left, self.top) + + @property + def bottom_right(self) -> tuple[int, int]: + """Bottom right space. + + Returns: + tuple[int, int]: `(, )` + + """ + return (self.right, self.bottom) + + @property + def totals(self) -> tuple[int, int]: + """Get total horizontal and vertical space. + + Returns: + tuple[int, int]: `(, )` + + + """ + top, right, bottom, left = self + return (left + right, top + bottom) + + @property + def css(self) -> str: + """Gets a string containing the spacing in CSS format. + + Returns: + str: Spacing in CSS format. + + """ + top, right, bottom, left = self + if top == right == bottom == left: + return f"{top}" + if (top, right) == (bottom, left): + return f"{top} {right}" + else: + return f"{top} {right} {bottom} {left}" + + @classmethod + def unpack(cls, pad: SpacingDimensions) -> Spacing: + """Unpack padding specified in CSS style. + + Args: + pad (SpacingDimensions): An integer, or tuple of 1, 2, or 4 integers. + + Raises: + ValueError: If `pad` is an invalid value. + + Returns: + Spacing: New Spacing object. + """ + if isinstance(pad, int): + return cls(pad, pad, pad, pad) + pad_len = len(pad) + if pad_len == 1: + _pad = pad[0] + return cls(_pad, _pad, _pad, _pad) + if pad_len == 2: + pad_top, pad_right = cast(Tuple[int, int], pad) + return cls(pad_top, pad_right, pad_top, pad_right) + if pad_len == 4: + top, right, bottom, left = cast(Tuple[int, int, int, int], pad) + return cls(top, right, bottom, left) + raise ValueError( + f"1, 2 or 4 integers required for spacing properties; {pad_len} given" + ) + + @classmethod + def vertical(cls, amount: int) -> Spacing: + """Construct a Spacing with a given amount of spacing on vertical edges, + and no horizontal spacing. + + Args: + amount (int): The magnitude of spacing to apply to vertical edges + + Returns: + Spacing: `Spacing(amount, 0, amount, 0)` + """ + return Spacing(amount, 0, amount, 0) + + @classmethod + def horizontal(cls, amount: int) -> Spacing: + """Construct a Spacing with a given amount of spacing on horizontal edges, + and no vertical spacing. + + Args: + amount (int): The magnitude of spacing to apply to horizontal edges + + Returns: + Spacing: `Spacing(0, amount, 0, amount)` + """ + return Spacing(0, amount, 0, amount) + + @classmethod + def all(cls, amount: int) -> Spacing: + """Construct a Spacing with a given amount of spacing on all edges. + + Args: + amount (int): The magnitude of spacing to apply to all edges + + Returns: + Spacing: `Spacing(amount, amount, amount, amount)` + """ + return Spacing(amount, amount, amount, amount) + + def __add__(self, other: object) -> Spacing: + if isinstance(other, tuple): + top1, right1, bottom1, left1 = self + top2, right2, bottom2, left2 = other + return Spacing( + top1 + top2, right1 + right2, bottom1 + bottom2, left1 + left2 + ) + return NotImplemented + + def __sub__(self, other: object) -> Spacing: + if isinstance(other, tuple): + top1, right1, bottom1, left1 = self + top2, right2, bottom2, left2 = other + return Spacing( + top1 - top2, right1 - right2, bottom1 - bottom2, left1 - left2 + ) + return NotImplemented + + def grow_maximum(self, other: Spacing) -> Spacing: + """Grow spacing with a maximum. + + Args: + other (Spacing): Spacing object. + + Returns: + Spacing: New spacing were the values are maximum of the two values. + """ + top, right, bottom, left = self + other_top, other_right, other_bottom, other_left = other + return Spacing( + max(top, other_top), + max(right, other_right), + max(bottom, other_bottom), + max(left, other_left), + ) + + +NULL_OFFSET = Offset(0, 0) diff --git a/testbed/Textualize__textual/src/textual/keys.py b/testbed/Textualize__textual/src/textual/keys.py new file mode 100644 index 0000000000000000000000000000000000000000..6fd47cf0942d59e5ba53b07f92db003c23c47a00 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/keys.py @@ -0,0 +1,208 @@ +from dataclasses import dataclass +from enum import Enum + +# Adapted from prompt toolkit https://github.com/prompt-toolkit/python-prompt-toolkit/blob/master/prompt_toolkit/keys.py + + +class Keys(str, Enum): + """ + List of keys for use in key bindings. + + Note that this is an "StrEnum", all values can be compared against + strings. + """ + + value: str + + Space = "space" + Escape = "escape" # Also Control-[ + ShiftEscape = "shift+escape" + Return = "return" + + ControlAt = "ctrl+@" # Also Control-Space. + + ControlA = "ctrl+a" + ControlB = "ctrl+b" + ControlC = "ctrl+c" + ControlD = "ctrl+d" + ControlE = "ctrl+e" + ControlF = "ctrl+f" + ControlG = "ctrl+g" + ControlH = "ctrl+h" + ControlI = "ctrl+i" # Tab + ControlJ = "ctrl+j" # Newline + ControlK = "ctrl+k" + ControlL = "ctrl+l" + ControlM = "ctrl+m" # Carriage return + ControlN = "ctrl+n" + ControlO = "ctrl+o" + ControlP = "ctrl+p" + ControlQ = "ctrl+q" + ControlR = "ctrl+r" + ControlS = "ctrl+s" + ControlT = "ctrl+t" + ControlU = "ctrl+u" + ControlV = "ctrl+v" + ControlW = "ctrl+w" + ControlX = "ctrl+x" + ControlY = "ctrl+y" + ControlZ = "ctrl+z" + + Control1 = "ctrl+1" + Control2 = "ctrl+2" + Control3 = "ctrl+3" + Control4 = "ctrl+4" + Control5 = "ctrl+5" + Control6 = "ctrl+6" + Control7 = "ctrl+7" + Control8 = "ctrl+8" + Control9 = "ctrl+9" + Control0 = "ctrl+0" + + ControlShift1 = "ctrl+shift+1" + ControlShift2 = "ctrl+shift+2" + ControlShift3 = "ctrl+shift+3" + ControlShift4 = "ctrl+shift+4" + ControlShift5 = "ctrl+shift+5" + ControlShift6 = "ctrl+shift+6" + ControlShift7 = "ctrl+shift+7" + ControlShift8 = "ctrl+shift+8" + ControlShift9 = "ctrl+shift+9" + ControlShift0 = "ctrl+shift+0" + + ControlBackslash = "ctrl+\\" + ControlSquareClose = "ctrl+]" + ControlCircumflex = "ctrl+^" + ControlUnderscore = "ctrl+_" + + Left = "left" + Right = "right" + Up = "up" + Down = "down" + Home = "home" + End = "end" + Insert = "insert" + Delete = "delete" + PageUp = "pageup" + PageDown = "pagedown" + + ControlLeft = "ctrl+left" + ControlRight = "ctrl+right" + ControlUp = "ctrl+up" + ControlDown = "ctrl+down" + ControlHome = "ctrl+home" + ControlEnd = "ctrl+end" + ControlInsert = "ctrl+insert" + ControlDelete = "ctrl+delete" + ControlPageUp = "ctrl+pageup" + ControlPageDown = "ctrl+pagedown" + + ShiftLeft = "shift+left" + ShiftRight = "shift+right" + ShiftUp = "shift+up" + ShiftDown = "shift+down" + ShiftHome = "shift+home" + ShiftEnd = "shift+end" + ShiftInsert = "shift+insert" + ShiftDelete = "shift+delete" + ShiftPageUp = "shift+pageup" + ShiftPageDown = "shift+pagedown" + + ControlShiftLeft = "ctrl+shift+left" + ControlShiftRight = "ctrl+shift+right" + ControlShiftUp = "ctrl+shift+up" + ControlShiftDown = "ctrl+shift+down" + ControlShiftHome = "ctrl+shift+home" + ControlShiftEnd = "ctrl+shift+end" + ControlShiftInsert = "ctrl+shift+insert" + ControlShiftDelete = "ctrl+shift+delete" + ControlShiftPageUp = "ctrl+shift+pageup" + ControlShiftPageDown = "ctrl+shift+pagedown" + + BackTab = "shift+tab" # shift + tab + + F1 = "f1" + F2 = "f2" + F3 = "f3" + F4 = "f4" + F5 = "f5" + F6 = "f6" + F7 = "f7" + F8 = "f8" + F9 = "f9" + F10 = "f10" + F11 = "f11" + F12 = "f12" + F13 = "f13" + F14 = "f14" + F15 = "f15" + F16 = "f16" + F17 = "f17" + F18 = "f18" + F19 = "f19" + F20 = "f20" + F21 = "f21" + F22 = "f22" + F23 = "f23" + F24 = "f24" + + ControlF1 = "ctrl+f1" + ControlF2 = "ctrl+f2" + ControlF3 = "ctrl+f3" + ControlF4 = "ctrl+f4" + ControlF5 = "ctrl+f5" + ControlF6 = "ctrl+f6" + ControlF7 = "ctrl+f7" + ControlF8 = "ctrl+f8" + ControlF9 = "ctrl+f9" + ControlF10 = "ctrl+f10" + ControlF11 = "ctrl+f11" + ControlF12 = "ctrl+f12" + ControlF13 = "ctrl+f13" + ControlF14 = "ctrl+f14" + ControlF15 = "ctrl+f15" + ControlF16 = "ctrl+f16" + ControlF17 = "ctrl+f17" + ControlF18 = "ctrl+f18" + ControlF19 = "ctrl+f19" + ControlF20 = "ctrl+f20" + ControlF21 = "ctrl+f21" + ControlF22 = "ctrl+f22" + ControlF23 = "ctrl+f23" + ControlF24 = "ctrl+f24" + + # Matches any key. + Any = "" + + # Special. + ScrollUp = "" + ScrollDown = "" + + CPRResponse = "" + Vt100MouseEvent = "" + WindowsMouseEvent = "" + + # For internal use: key which is ignored. + # (The key binding for this key should not do anything.) + Ignore = "" + + # Some 'Key' aliases (for backwardshift+compatibility). + ControlSpace = "ctrl-at" + Tab = "tab" + Enter = "enter" + Backspace = "backspace" + + # ShiftControl was renamed to ControlShift in + # 888fcb6fa4efea0de8333177e1bbc792f3ff3c24 (20 Feb 2020). + ShiftControlLeft = ControlShiftLeft + ShiftControlRight = ControlShiftRight + ShiftControlHome = ControlShiftHome + ShiftControlEnd = ControlShiftEnd + + +# Unicode db contains some obscure names +# This mapping replaces them with more common terms +KEY_NAME_REPLACEMENTS = { + "solidus": "slash", + "reverse_solidus": "backslash", +} diff --git a/testbed/Textualize__textual/src/textual/layouts/grid.py b/testbed/Textualize__textual/src/textual/layouts/grid.py new file mode 100644 index 0000000000000000000000000000000000000000..ea9466461c317997efd3899c53e890c2f232c274 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/layouts/grid.py @@ -0,0 +1,160 @@ +from __future__ import annotations + +from fractions import Fraction +from typing import TYPE_CHECKING, Iterable + +from .._layout import ArrangeResult, Layout, WidgetPlacement +from .._resolve import resolve +from ..css.scalar import Scalar +from ..geometry import Region, Size, Spacing + +if TYPE_CHECKING: + from ..widget import Widget + + +class GridLayout(Layout): + """Used to layout Widgets in to a grid.""" + + name = "grid" + + def arrange( + self, parent: Widget, children: list[Widget], size: Size + ) -> ArrangeResult: + styles = parent.styles + row_scalars = styles.grid_rows or [Scalar.parse("1fr")] + column_scalars = styles.grid_columns or [Scalar.parse("1fr")] + gutter_horizontal = styles.grid_gutter_horizontal + gutter_vertical = styles.grid_gutter_vertical + table_size_columns = max(1, styles.grid_size_columns) + table_size_rows = styles.grid_size_rows + viewport = parent.screen.size + + def cell_coords(column_count: int) -> Iterable[tuple[int, int]]: + """Iterate over table coordinates ad infinitum. + + Args: + column_count (int): Number of columns + + """ + row = 0 + while True: + for column in range(column_count): + yield (column, row) + row += 1 + + def widget_coords( + column_start: int, row_start: int, columns: int, rows: int + ) -> set[tuple[int, int]]: + """Get coords occupied by a cell. + + Args: + column_start (int): Start column. + row_start (int): Start_row. + columns (int): Number of columns. + rows (int): Number of rows. + + Returns: + set[tuple[int, int]]: Set of coords. + """ + return { + (column, row) + for column in range(column_start, column_start + columns) + for row in range(row_start, row_start + rows) + } + + def repeat_scalars(scalars: Iterable[Scalar], count: int) -> list[Scalar]: + """Repeat an iterable of scalars as many times as required to return + a list of `count` values. + + Args: + scalars (Iterable[T]): Iterable of values. + count (int): Number of values to return. + + Returns: + list[T]: A list of values. + """ + limited_values = list(scalars)[:] + while len(limited_values) < count: + limited_values.extend(scalars) + return limited_values[:count] + + cell_map: dict[tuple[int, int], tuple[Widget, bool]] = {} + cell_size_map: dict[Widget, tuple[int, int, int, int]] = {} + + column_count = table_size_columns + next_coord = iter(cell_coords(column_count)).__next__ + cell_coord = (0, 0) + column = row = 0 + + for child in children: + child_styles = child.styles + column_span = child_styles.column_span or 1 + row_span = child_styles.row_span or 1 + # Find a slot where this cell fits + # A cell on a previous row may have a row span + while True: + column, row = cell_coord + coords = widget_coords(column, row, column_span, row_span) + if cell_map.keys().isdisjoint(coords): + for coord in coords: + cell_map[coord] = (child, coord == cell_coord) + cell_size_map[child] = ( + column, + row, + column_span - 1, + row_span - 1, + ) + break + else: + cell_coord = next_coord() + continue + cell_coord = next_coord() + + # Resolve columns / rows + columns = resolve( + repeat_scalars(column_scalars, table_size_columns), + size.width, + gutter_vertical, + size, + viewport, + ) + rows = resolve( + repeat_scalars( + row_scalars, table_size_rows if table_size_rows else row + 1 + ), + size.height, + gutter_horizontal, + size, + viewport, + ) + + placements: list[WidgetPlacement] = [] + add_placement = placements.append + fraction_unit = Fraction(1) + widgets: list[Widget] = [] + add_widget = widgets.append + max_column = len(columns) - 1 + max_row = len(rows) - 1 + margin = Spacing() + for widget, (column, row, column_span, row_span) in cell_size_map.items(): + x = columns[column][0] + if row > max_row: + break + y = rows[row][0] + x2, cell_width = columns[min(max_column, column + column_span)] + y2, cell_height = rows[min(max_row, row + row_span)] + cell_size = Size(cell_width + x2 - x, cell_height + y2 - y) + width, height, margin = widget._get_box_model( + cell_size, + viewport, + fraction_unit, + ) + region = ( + Region(x, y, int(width + margin.width), int(height + margin.height)) + .shrink(margin) + .clip_size(cell_size) + ) + add_placement(WidgetPlacement(region, margin, widget)) + add_widget(widget) + + return (placements, set(widgets)) diff --git a/testbed/Textualize__textual/src/textual/message_pump.py b/testbed/Textualize__textual/src/textual/message_pump.py new file mode 100644 index 0000000000000000000000000000000000000000..d7567b082b2ec428257e42aa1e98e050acef0916 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/message_pump.py @@ -0,0 +1,553 @@ +""" + +A message pump is a class that processes messages. + +It is a base class for the App, Screen, and Widgets. + +""" + +from __future__ import annotations + +import asyncio +import inspect +from asyncio import CancelledError, Queue, QueueEmpty, Task +from functools import partial +from typing import TYPE_CHECKING, Any, Awaitable, Callable, Iterable +from weakref import WeakSet + +from . import events, log, messages, Logger +from ._callback import invoke +from ._context import NoActiveAppError, active_app +from .timer import Timer, TimerCallback +from .case import camel_to_snake +from .events import Event +from .message import Message +from .reactive import Reactive + +if TYPE_CHECKING: + from .app import App + + +class NoParent(Exception): + pass + + +class CallbackError(Exception): + pass + + +class MessagePumpClosed(Exception): + pass + + +class MessagePumpMeta(type): + """Metaclass for message pump. This exists to populate a Message inner class of a Widget with the + parent classes' name. + + """ + + def __new__( + cls, + name: str, + bases: tuple[type, ...], + class_dict: dict[str, Any], + **kwargs, + ): + namespace = camel_to_snake(name) + isclass = inspect.isclass + for value in class_dict.values(): + if isclass(value) and issubclass(value, Message): + if not value.namespace: + value.namespace = namespace + class_obj = super().__new__(cls, name, bases, class_dict, **kwargs) + return class_obj + + +class MessagePump(metaclass=MessagePumpMeta): + def __init__(self, parent: MessagePump | None = None) -> None: + self._message_queue: Queue[Message | None] = Queue() + self._parent = parent + self._running: bool = False + self._closing: bool = False + self._closed: bool = False + self._disabled_messages: set[type[Message]] = set() + self._pending_message: Message | None = None + self._task: Task | None = None + self._timers: WeakSet[Timer] = WeakSet() + + @property + def task(self) -> Task: + assert self._task is not None + return self._task + + @property + def has_parent(self) -> bool: + return self._parent is not None + + @property + def app(self) -> "App": + """ + Get the current app. + + Returns: + App: The current app. + + Raises: + NoActiveAppError: if no active app could be found for the current asyncio context + """ + try: + return active_app.get() + except LookupError: + raise NoActiveAppError() + + @property + def is_parent_active(self) -> bool: + return bool( + self._parent and not self._parent._closed and not self._parent._closing + ) + + @property + def is_running(self) -> bool: + return self._running + + @property + def log(self) -> Logger: + """Get a logger for this object. + + Returns: + Logger: A logger. + """ + return self.app._logger + + def _attach(self, parent: MessagePump) -> None: + """Set the parent, and therefore attach this node to the tree. + + Args: + parent (MessagePump): Parent node. + """ + self._parent = parent + + def _detach(self) -> None: + """Set the parent to None to remove the node from the tree.""" + self._parent = None + + def check_message_enabled(self, message: Message) -> bool: + return type(message) not in self._disabled_messages + + def disable_messages(self, *messages: type[Message]) -> None: + """Disable message types from being processed.""" + self._disabled_messages.update(messages) + + def enable_messages(self, *messages: type[Message]) -> None: + """Enable processing of messages types.""" + self._disabled_messages.difference_update(messages) + + async def _get_message(self) -> Message: + """Get the next event on the queue, or None if queue is closed. + + Returns: + Optional[Event]: Event object or None. + """ + if self._closed: + raise MessagePumpClosed("The message pump is closed") + if self._pending_message is not None: + try: + return self._pending_message + finally: + self._pending_message = None + message = await self._message_queue.get() + if message is None: + self._closed = True + raise MessagePumpClosed("The message pump is now closed") + return message + + def _peek_message(self) -> Message | None: + """Peek the message at the head of the queue (does not remove it from the queue), + or return None if the queue is empty. + + Returns: + Optional[Message]: The message or None. + """ + if self._pending_message is None: + try: + message = self._message_queue.get_nowait() + except QueueEmpty: + pass + else: + if message is None: + self._closed = True + raise MessagePumpClosed("The message pump is now closed") + self._pending_message = message + + if self._pending_message is not None: + return self._pending_message + return None + + def set_timer( + self, + delay: float, + callback: TimerCallback | None = None, + *, + name: str | None = None, + pause: bool = False, + ) -> Timer: + """Make a function call after a delay. + + Args: + delay (float): Time to wait before invoking callback. + callback (TimerCallback | None, optional): Callback to call after time has expired. Defaults to None. + name (str | None, optional): Name of the timer (for debug). Defaults to None. + pause (bool, optional): Start timer paused. Defaults to False. + + Returns: + Timer: A timer object. + """ + timer = Timer( + self, + delay, + self, + name=name or f"set_timer#{Timer._timer_count}", + callback=callback, + repeat=0, + pause=pause, + ) + timer.start() + self._timers.add(timer) + return timer + + def set_interval( + self, + interval: float, + callback: TimerCallback | None = None, + *, + name: str | None = None, + repeat: int = 0, + pause: bool = False, + ) -> Timer: + """Call a function at periodic intervals. + + Args: + interval (float): Time between calls. + callback (TimerCallback | None, optional): Function to call. Defaults to None. + name (str | None, optional): Name of the timer object. Defaults to None. + repeat (int, optional): Number of times to repeat the call or 0 for continuous. Defaults to 0. + pause (bool, optional): Start the timer paused. Defaults to False. + + Returns: + Timer: A timer object. + """ + timer = Timer( + self, + interval, + self, + name=name or f"set_interval#{Timer._timer_count}", + callback=callback, + repeat=repeat or None, + pause=pause, + ) + timer.start() + self._timers.add(timer) + return timer + + def call_later(self, callback: Callable, *args, **kwargs) -> None: + """Schedule a callback to run after all messages are processed and the screen + has been refreshed. Positional and keyword arguments are passed to the callable. + + Args: + callback (Callable): A callable. + """ + # We send the InvokeLater message to ourselves first, to ensure we've cleared + # out anything already pending in our own queue. + message = messages.InvokeLater(self, partial(callback, *args, **kwargs)) + self.post_message_no_wait(message) + + def _on_invoke_later(self, message: messages.InvokeLater) -> None: + # Forward InvokeLater message to the Screen + self.app.screen._invoke_later(message.callback) + + def _close_messages_no_wait(self) -> None: + """Request the message queue to exit.""" + self._message_queue.put_nowait(None) + + async def _close_messages(self) -> None: + """Close message queue, and optionally wait for queue to finish processing.""" + if self._closed or self._closing: + return + self._closing = True + stop_timers = list(self._timers) + for timer in stop_timers: + await timer.stop() + self._timers.clear() + await self._message_queue.put(None) + + if self._task is not None and asyncio.current_task() != self._task: + # Ensure everything is closed before returning + await self._task + + def _start_messages(self) -> None: + """Start messages task.""" + Reactive.initialize_object(self) + self._task = asyncio.create_task(self._process_messages()) + + async def _process_messages(self) -> None: + self._running = True + try: + await self._process_messages_loop() + except CancelledError: + pass + finally: + self._running = False + for timer in list(self._timers): + await timer.stop() + + async def _process_messages_loop(self) -> None: + """Process messages until the queue is closed.""" + _rich_traceback_guard = True + + while not self._closed: + try: + message = await self._get_message() + except MessagePumpClosed: + break + except CancelledError: + raise + except Exception as error: + raise error from None + + # Combine any pending messages that may supersede this one + while not (self._closed or self._closing): + try: + pending = self._peek_message() + except MessagePumpClosed: + break + if pending is None or not message.can_replace(pending): + break + try: + message = await self._get_message() + except MessagePumpClosed: + break + + try: + await self._dispatch_message(message) + except CancelledError: + raise + except Exception as error: + self.app._handle_exception(error) + break + finally: + self._message_queue.task_done() + if self._message_queue.empty(): + if not self._closed: + event = events.Idle(self) + for _cls, method in self._get_dispatch_methods( + "on_idle", event + ): + try: + await invoke(method, event) + except Exception as error: + self.app._handle_exception(error) + break + + log("CLOSED", self) + + async def _dispatch_message(self, message: Message) -> None: + """Dispatch a message received from the message queue. + + Args: + message (Message): A message object + """ + _rich_traceback_guard = True + if message.no_dispatch: + return + + # Allow apps to treat events and messages separately + if isinstance(message, Event): + await self.on_event(message) + else: + await self._on_message(message) + + def _get_dispatch_methods( + self, method_name: str, message: Message + ) -> Iterable[tuple[type, Callable[[Message], Awaitable]]]: + """Gets handlers from the MRO + + Args: + method_name (str): Handler method name. + message (Message): Message object. + + """ + private_method = f"_{method_name}" + for cls in self.__class__.__mro__: + if message._no_default_action: + break + method = cls.__dict__.get(private_method) or cls.__dict__.get(method_name) + if method is not None: + yield cls, method.__get__(self, cls) + + async def on_event(self, event: events.Event) -> None: + """Called to process an event. + + Args: + event (events.Event): An Event object. + """ + await self._on_message(event) + + async def _on_message(self, message: Message) -> None: + """Called to process a message. + + Args: + message (Message): A Message object. + """ + _rich_traceback_guard = True + handler_name = message._handler_name + + # Look through the MRO to find a handler + for cls, method in self._get_dispatch_methods(handler_name, message): + log.event.verbosity(message.verbose)( + message, + ">>>", + self, + f"method=<{cls.__name__}.{handler_name}>", + ) + await invoke(method, message) + + # Bubble messages up the DOM (if enabled on the message) + if message.bubble and self._parent and not message._stop_propagation: + if message.sender == self._parent: + # parent is sender, so we stop propagation after parent + message.stop() + if self.is_parent_active and not self._parent._closing: + await message._bubble_to(self._parent) + + def check_idle(self) -> None: + """Prompt the message pump to call idle if the queue is empty.""" + if self._message_queue.empty(): + self.post_message_no_wait(messages.Prompt(sender=self)) + + async def post_message(self, message: Message) -> bool: + """Post a message or an event to this message pump. + + Args: + message (Message): A message object. + + Returns: + bool: True if the messages was posted successfully, False if the message was not posted + (because the message pump was in the process of closing). + """ + + if self._closing or self._closed: + return False + if not self.check_message_enabled(message): + return True + await self._message_queue.put(message) + return True + + # TODO: This may not be needed, or may only be needed by the timer + # Consider removing or making private + async def _post_priority_message(self, message: Message) -> bool: + """Post a "priority" messages which will be processes prior to regular messages. + + Note that you should rarely need this in a regular app. It exists primarily to allow + timer messages to skip the queue, so that they can be more regular. + + Args: + message (Message): A message. + + Returns: + bool: True if the messages was processed, False if it wasn't. + """ + # TODO: Allow priority messages to jump the queue + if self._closing or self._closed: + return False + if not self.check_message_enabled(message): + return False + await self._message_queue.put(message) + return True + + def post_message_no_wait(self, message: Message) -> bool: + """Posts a message on the queue. + + Args: + message (Message): A message (or Event). + + Returns: + bool: True if the messages was processed, False if it wasn't. + """ + if self._closing or self._closed: + return False + if not self.check_message_enabled(message): + return False + self._message_queue.put_nowait(message) + return True + + async def _post_message_from_child(self, message: Message) -> bool: + if self._closing or self._closed: + return False + return await self.post_message(message) + + def _post_message_from_child_no_wait(self, message: Message) -> bool: + if self._closing or self._closed: + return False + return self.post_message_no_wait(message) + + async def on_callback(self, event: events.Callback) -> None: + await invoke(event.callback) + + def emit_no_wait(self, message: Message) -> bool: + """Send a message to the _parent_, non async version. + + Args: + message (Message): A message object. + + Returns: + bool: True if the message was posted successfully. + """ + if self._parent: + return self._parent._post_message_from_child_no_wait(message) + else: + return False + + async def emit(self, message: Message) -> bool: + """Send a message to the _parent_. + + Args: + message (Message): A message object. + + Returns: + bool: True if the message was posted successfully. + """ + if self._parent: + return await self._parent._post_message_from_child(message) + else: + return False + + # TODO: Does dispatch_key belong on message pump? + async def dispatch_key(self, event: events.Key) -> bool: + """Dispatch a key event to method. + + This method will call the method named 'key_' if it exists. + + Args: + event (events.Key): A key event. + + Returns: + bool: True if key was handled, otherwise False. + """ + key_method = getattr(self, f"key_{event.key_name}", None) or getattr( + self, f"_key_{event.key_name}", None + ) + if key_method is not None: + await invoke(key_method, event) + return True + return False + + async def on_timer(self, event: events.Timer) -> None: + event.prevent_default() + event.stop() + if event.callback is not None: + try: + await invoke(event.callback) + except Exception as error: + raise CallbackError( + f"unable to run callback {event.callback!r}; {error}" + ) diff --git a/testbed/Textualize__textual/src/textual/messages.py b/testbed/Textualize__textual/src/textual/messages.py new file mode 100644 index 0000000000000000000000000000000000000000..2b1ff4792d2596f6239bcb7adf2bcf56f42a6885 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/messages.py @@ -0,0 +1,81 @@ +from __future__ import annotations +from typing import TYPE_CHECKING + +import rich.repr + +from .geometry import Region +from ._types import CallbackType +from .message import Message + + +if TYPE_CHECKING: + from .message_pump import MessagePump + from .widget import Widget + + +@rich.repr.auto +class Update(Message, verbose=True): + def __init__(self, sender: MessagePump, widget: Widget): + super().__init__(sender) + self.widget = widget + + def __rich_repr__(self) -> rich.repr.Result: + yield self.sender + yield self.widget + + def __eq__(self, other: object) -> bool: + if isinstance(other, Update): + return self.widget == other.widget + return NotImplemented + + def can_replace(self, message: Message) -> bool: + # Update messages can replace update for the same widget + return isinstance(message, Update) and self.widget == message.widget + + +@rich.repr.auto +class Layout(Message, verbose=True): + def can_replace(self, message: Message) -> bool: + return isinstance(message, Layout) + + +@rich.repr.auto +class InvokeLater(Message, verbose=True, bubble=False): + def __init__(self, sender: MessagePump, callback: CallbackType) -> None: + self.callback = callback + super().__init__(sender) + + def __rich_repr__(self) -> rich.repr.Result: + yield "callback", self.callback + + +@rich.repr.auto +class ScrollToRegion(Message, bubble=False): + """Ask the parent to scroll a given region in to view.""" + + def __init__(self, sender: MessagePump, region: Region) -> None: + self.region = region + super().__init__(sender) + + +@rich.repr.auto +class StylesUpdated(Message, verbose=True): + def __init__(self, sender: MessagePump) -> None: + super().__init__(sender) + + def can_replace(self, message: Message) -> bool: + return isinstance(message, StylesUpdated) + + +class Prompt(Message, no_dispatch=True): + """Used to 'wake up' an event loop.""" + + def can_replace(self, message: Message) -> bool: + return isinstance(message, Prompt) + + +class TerminalSupportsSynchronizedOutput(Message): + """ + Used to make the App aware that the terminal emulator supports synchronised output. + @link https://gist.github.com/christianparpart/d8a62cc1ab659194337d73e399004036 + """ diff --git a/testbed/Textualize__textual/src/textual/py.typed b/testbed/Textualize__textual/src/textual/py.typed new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/testbed/Textualize__textual/src/textual/reactive.py b/testbed/Textualize__textual/src/textual/reactive.py new file mode 100644 index 0000000000000000000000000000000000000000..74c962b452c6aea72e33a44075567b1610de2f9f --- /dev/null +++ b/testbed/Textualize__textual/src/textual/reactive.py @@ -0,0 +1,248 @@ +from __future__ import annotations + +from functools import partial +from inspect import isawaitable +from typing import TYPE_CHECKING, Any, Callable, Generic, Type, TypeVar, Union +from weakref import WeakSet + + +from . import events +from ._callback import count_parameters, invoke +from ._types import MessageTarget + +if TYPE_CHECKING: + from .app import App + from .widget import Widget + + Reactable = Union[Widget, App] + + +ReactiveType = TypeVar("ReactiveType") + + +T = TypeVar("T") + + +class Reactive(Generic[ReactiveType]): + """Reactive descriptor. + + Args: + default (ReactiveType | Callable[[], ReactiveType]): A default value or callable that returns a default. + layout (bool, optional): Perform a layout on change. Defaults to False. + repaint (bool, optional): Perform a repaint on change. Defaults to True. + init (bool, optional): Call watchers on initialize (post mount). Defaults to False. + + """ + + def __init__( + self, + default: ReactiveType | Callable[[], ReactiveType], + *, + layout: bool = False, + repaint: bool = True, + init: bool = False, + ) -> None: + self._default = default + self._layout = layout + self._repaint = repaint + self._init = init + + @classmethod + def init( + cls, + default: ReactiveType | Callable[[], ReactiveType], + *, + layout: bool = False, + repaint: bool = True, + ) -> Reactive: + """A reactive variable that calls watchers and compute on initialize (post mount). + + Args: + default (ReactiveType | Callable[[], ReactiveType]): A default value or callable that returns a default. + layout (bool, optional): Perform a layout on change. Defaults to False. + repaint (bool, optional): Perform a repaint on change. Defaults to True. + + Returns: + Reactive: A Reactive instance which calls watchers or initialize. + """ + return cls(default, layout=layout, repaint=repaint, init=True) + + @classmethod + def var( + cls, + default: ReactiveType | Callable[[], ReactiveType], + ) -> Reactive: + """A reactive variable that doesn't update or layout. + + Args: + default (ReactiveType | Callable[[], ReactiveType]): A default value or callable that returns a default. + + Returns: + Reactive: A Reactive descriptor. + """ + return cls(default, layout=False, repaint=False, init=True) + + @classmethod + def initialize_object(cls, obj: object) -> None: + """Call any watchers / computes for the first time. + + Args: + obj (Reactable): An object with Reactive descriptors + """ + + startswith = str.startswith + for key in obj.__class__.__dict__.keys(): + if startswith(key, "_init_"): + name = key[6:] + if not hasattr(obj, name): + default = getattr(obj, key) + setattr(obj, name, default() if callable(default) else default) + + def __set_name__(self, owner: Type[MessageTarget], name: str) -> None: + + if hasattr(owner, f"compute_{name}"): + try: + computes = getattr(owner, "__computes") + except AttributeError: + computes = [] + setattr(owner, "__computes", computes) + computes.append(name) + + self.name = name + self.internal_name = f"_reactive_{name}" + default = self._default + + if self._init: + setattr(owner, f"_init_{name}", default) + else: + setattr( + owner, self.internal_name, default() if callable(default) else default + ) + + def __get__(self, obj: Reactable, obj_type: type[object]) -> ReactiveType: + return getattr(obj, self.internal_name) + + def __set__(self, obj: Reactable, value: ReactiveType) -> None: + name = self.name + current_value = getattr(obj, self.internal_name, None) + validate_function = getattr(obj, f"validate_{name}", None) + first_set = getattr(obj, f"__first_set_{self.internal_name}", True) + if callable(validate_function) and not first_set: + value = validate_function(value) + if current_value != value or first_set: + setattr(obj, f"__first_set_{self.internal_name}", False) + setattr(obj, self.internal_name, value) + self._check_watchers(obj, name, current_value, first_set=first_set) + if self._layout or self._repaint: + obj.refresh(repaint=self._repaint, layout=self._layout) + + @classmethod + def _check_watchers( + cls, obj: Reactable, name: str, old_value: Any, first_set: bool = False + ) -> None: + + internal_name = f"_reactive_{name}" + value = getattr(obj, internal_name) + + async def update_watcher( + obj: Reactable, watch_function: Callable, old_value: Any, value: Any + ) -> None: + _rich_traceback_guard = True + if count_parameters(watch_function) == 2: + watch_result = watch_function(old_value, value) + else: + watch_result = watch_function(value) + if isawaitable(watch_result): + await watch_result + await Reactive._compute(obj) + + watch_function = getattr(obj, f"watch_{name}", None) + if callable(watch_function): + obj.post_message_no_wait( + events.Callback( + obj, + callback=partial( + update_watcher, obj, watch_function, old_value, value + ), + ) + ) + + watcher_name = f"__{name}_watchers" + watchers = getattr(obj, watcher_name, ()) + for watcher in watchers: + obj.post_message_no_wait( + events.Callback( + obj, + callback=partial(update_watcher, obj, watcher, old_value, value), + ) + ) + + if not first_set: + obj.post_message_no_wait( + events.Callback(obj, callback=partial(Reactive._compute, obj)) + ) + + @classmethod + async def _compute(cls, obj: Reactable) -> None: + _rich_traceback_guard = True + computes = getattr(obj, "__computes", []) + for compute in computes: + try: + compute_method = getattr(obj, f"compute_{compute}") + except AttributeError: + continue + + value = await invoke(compute_method) + setattr(obj, compute, value) + + +class reactive(Reactive[ReactiveType]): + """Create a reactive attribute. + + Args: + default (ReactiveType | Callable[[], ReactiveType]): A default value or callable that returns a default. + layout (bool, optional): Perform a layout on change. Defaults to False. + repaint (bool, optional): Perform a repaint on change. Defaults to True. + init (bool, optional): Call watchers on initialize (post mount). Defaults to True. + + """ + + def __init__( + self, + default: ReactiveType | Callable[[], ReactiveType], + *, + layout: bool = False, + repaint: bool = True, + init: bool = True, + ) -> None: + super().__init__(default, layout=layout, repaint=repaint, init=init) + + +class var(Reactive[ReactiveType]): + """Create a reactive attribute (with no auto-refresh). + + Args: + default (ReactiveType | Callable[[], ReactiveType]): A default value or callable that returns a default. + """ + + def __init__(self, default: ReactiveType | Callable[[], ReactiveType]) -> None: + super().__init__(default, layout=False, repaint=False, init=True) + + +def watch( + obj: Reactable, attribute_name: str, callback: Callable[[Any], object] +) -> None: + """Watch a reactive variable on an object. + + Args: + obj (Reactable): The parent object. + attribute_name (str): The attribute to watch. + callback (Callable[[Any], object]): A callable to call when the attribute changes. + """ + watcher_name = f"__{attribute_name}_watchers" + current_value = getattr(obj, attribute_name, None) + if not hasattr(obj, watcher_name): + setattr(obj, watcher_name, WeakSet()) + watchers = getattr(obj, watcher_name) + watchers.add(callback) + Reactive._check_watchers(obj, attribute_name, current_value) diff --git a/testbed/Textualize__textual/src/textual/render.py b/testbed/Textualize__textual/src/textual/render.py new file mode 100644 index 0000000000000000000000000000000000000000..ca8fe72bd02dda40a529e7325e2f7f9c1cf80e2a --- /dev/null +++ b/testbed/Textualize__textual/src/textual/render.py @@ -0,0 +1,22 @@ +from rich.console import Console, RenderableType +from rich.protocol import rich_cast + + +def measure(console: Console, renderable: RenderableType, default: int) -> int: + """Measure a rich renderable. + + Args: + console (Console): A console object. + renderable (RenderableType): Rich renderable. + default (int): Default width to use if renderable does not expose dimensions. + + Returns: + int: Width in cells + """ + width = default + renderable = rich_cast(renderable) + get_console_width = getattr(renderable, "__rich_measure__", None) + if get_console_width is not None: + render_width = get_console_width(console, console.options).maximum + width = max(0, render_width) + return width diff --git a/testbed/Textualize__textual/src/textual/renderables/__init__.py b/testbed/Textualize__textual/src/textual/renderables/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/testbed/Textualize__textual/src/textual/renderables/_blend_colors.py b/testbed/Textualize__textual/src/textual/renderables/_blend_colors.py new file mode 100644 index 0000000000000000000000000000000000000000..8bfcd753a41b2313f7f2b696c8642368022544e5 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/renderables/_blend_colors.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from rich.color import Color + + +def blend_colors(color1: Color, color2: Color, ratio: float) -> Color: + """Given two RGB colors, return a color that sits some distance between + them in RGB color space. + + Args: + color1 (Color): The first color. + color2 (Color): The second color. + ratio (float): The ratio of color1 to color2. + + Returns: + Color: A Color representing the blending of the two supplied colors. + """ + r1, g1, b1 = color1.triplet + r2, g2, b2 = color2.triplet + + return Color.from_rgb( + r1 + (r2 - r1) * ratio, + g1 + (g2 - g1) * ratio, + b1 + (b2 - b1) * ratio, + ) + + +def blend_colors_rgb( + color1: tuple[int, int, int], color2: tuple[int, int, int], ratio: float +) -> Color: + """Blend two colors given as a tuple of 3 values for red, green, and blue. + + Args: + color1 (tuple[int, int, int]): The first color. + color2 (tuple[int, int, int]): The second color. + ratio (float): The ratio of color1 to color2. + + Returns: + Color: A Color representing the blending of the two supplied colors. + """ + r1, g1, b1 = color1 + r2, g2, b2 = color2 + return Color.from_rgb( + r1 + (r2 - r1) * ratio, + g1 + (g2 - g1) * ratio, + b1 + (b2 - b1) * ratio, + ) diff --git a/testbed/Textualize__textual/src/textual/renderables/align.py b/testbed/Textualize__textual/src/textual/renderables/align.py new file mode 100644 index 0000000000000000000000000000000000000000..3aa2442ab836eff6078c2eae8ab6dbadb58b065a --- /dev/null +++ b/testbed/Textualize__textual/src/textual/renderables/align.py @@ -0,0 +1,56 @@ +from __future__ import annotations + +from rich.console import Console, ConsoleOptions, RenderableType, RenderResult +from rich.measure import Measurement +from rich.segment import Segment +from rich.style import Style + +from .._segment_tools import align_lines +from ..css.types import AlignHorizontal, AlignVertical +from ..geometry import Size + + +class Align: + def __init__( + self, + renderable: RenderableType, + size: Size, + style: Style, + horizontal: AlignHorizontal, + vertical: AlignVertical, + ) -> None: + """Align a child renderable + + Args: + renderable (RenderableType): Renderable to align. + size (Size): Size of container. + style (Style): Style of any padding. + horizontal (AlignHorizontal): Horizontal alignment. + vertical (AlignVertical): Vertical alignment. + """ + self.renderable = renderable + self.size = size + self.style = style + self.horizontal = horizontal + self.vertical = vertical + + def __rich_console__( + self, console: Console, options: ConsoleOptions + ) -> RenderResult: + lines = console.render_lines(self.renderable, options, pad=False) + new_line = Segment.line() + for line in align_lines( + lines, + self.style, + self.size, + self.horizontal, + self.vertical, + ): + yield from line + yield new_line + + def __rich_measure__( + self, console: "Console", options: "ConsoleOptions" + ) -> Measurement: + width, _ = self.size + return Measurement(width, width) diff --git a/testbed/Textualize__textual/src/textual/renderables/gradient.py b/testbed/Textualize__textual/src/textual/renderables/gradient.py new file mode 100644 index 0000000000000000000000000000000000000000..7d5fb3243e382c1939b4004ed46e7dde9f83a89e --- /dev/null +++ b/testbed/Textualize__textual/src/textual/renderables/gradient.py @@ -0,0 +1,44 @@ +from __future__ import annotations + +from rich.console import ConsoleOptions, Console, RenderResult + +from rich.segment import Segment +from rich.style import Style + +from ..color import Color + + +class VerticalGradient: + """Draw a vertical gradient.""" + + def __init__(self, color1: str, color2: str) -> None: + self._color1 = Color.parse(color1) + self._color2 = Color.parse(color2) + + def __rich_console__( + self, console: Console, options: ConsoleOptions + ) -> RenderResult: + width = options.max_width + height = options.height or options.max_height + color1 = self._color1 + color2 = self._color2 + default_color = Color(0, 0, 0).rich_color + from_color = Style.from_color + blend = color1.blend + rich_color1 = color1.rich_color + for y in range(height): + line_color = from_color( + default_color, + ( + blend(color2, y / (height - 1)).rich_color + if height > 1 + else rich_color1 + ), + ) + yield Segment(f"{width * ' '}\n", line_color) + + +if __name__ == "__main__": + from rich import print + + print(VerticalGradient("red", "blue")) diff --git a/testbed/Textualize__textual/src/textual/renderables/sparkline.py b/testbed/Textualize__textual/src/textual/renderables/sparkline.py new file mode 100644 index 0000000000000000000000000000000000000000..5630c6bb6c358b6f52e09725239079d93e8ad71e --- /dev/null +++ b/testbed/Textualize__textual/src/textual/renderables/sparkline.py @@ -0,0 +1,107 @@ +from __future__ import annotations + +import statistics +from typing import Sequence, Iterable, Callable, TypeVar + +from rich.color import Color +from rich.console import ConsoleOptions, Console, RenderResult +from rich.segment import Segment +from rich.style import Style + +from textual.renderables._blend_colors import blend_colors + +T = TypeVar("T", int, float) + + +class Sparkline: + """A sparkline representing a series of data. + + Args: + data (Sequence[T]): The sequence of data to render. + width (int, optional): The width of the sparkline/the number of buckets to partition the data into. + min_color (Color, optional): The color of values equal to the min value in data. + max_color (Color, optional): The color of values equal to the max value in data. + summary_function (Callable[list[T]]): Function that will be applied to each bucket. + """ + + BARS = "▁▂▃▄▅▆▇█" + + def __init__( + self, + data: Sequence[T], + *, + width: int | None, + min_color: Color = Color.from_rgb(0, 255, 0), + max_color: Color = Color.from_rgb(255, 0, 0), + summary_function: Callable[[list[T]], float] = max, + ) -> None: + self.data = data + self.width = width + self.min_color = Style.from_color(min_color) + self.max_color = Style.from_color(max_color) + self.summary_function = summary_function + + @classmethod + def _buckets(cls, data: Sequence[T], num_buckets: int) -> Iterable[list[T]]: + """Partition ``data`` into ``num_buckets`` buckets. For example, the data + [1, 2, 3, 4] partitioned into 2 buckets is [[1, 2], [3, 4]]. + + Args: + data (Sequence[T]): The data to partition. + num_buckets (int): The number of buckets to partition the data into. + """ + num_steps, remainder = divmod(len(data), num_buckets) + for i in range(num_buckets): + start = i * num_steps + min(i, remainder) + end = (i + 1) * num_steps + min(i + 1, remainder) + partition = data[start:end] + if partition: + yield partition + + def __rich_console__( + self, console: Console, options: ConsoleOptions + ) -> RenderResult: + width = self.width or options.max_width + len_data = len(self.data) + if len_data == 0: + yield Segment("▁" * width, self.min_color) + return + if len_data == 1: + yield Segment("█" * width, self.max_color) + return + + minimum, maximum = min(self.data), max(self.data) + extent = maximum - minimum or 1 + + buckets = list(self._buckets(self.data, num_buckets=self.width)) + + bucket_index = 0 + bars_rendered = 0 + step = len(buckets) / width + summary_function = self.summary_function + min_color, max_color = self.min_color.color, self.max_color.color + while bars_rendered < width: + partition = buckets[int(bucket_index)] + partition_summary = summary_function(partition) + height_ratio = (partition_summary - minimum) / extent + bar_index = int(height_ratio * (len(self.BARS) - 1)) + bar_color = blend_colors(min_color, max_color, height_ratio) + bars_rendered += 1 + bucket_index += step + yield Segment(self.BARS[bar_index], Style.from_color(bar_color)) + + +if __name__ == "__main__": + console = Console() + + def last(l): + return l[-1] + + funcs = min, max, last, statistics.median, statistics.mean + nums = [10, 2, 30, 60, 45, 20, 7, 8, 9, 10, 50, 13, 10, 6, 5, 4, 3, 7, 20] + console.print(f"data = {nums}\n") + for f in funcs: + console.print( + f"{f.__name__}:\t", Sparkline(nums, width=12, summary_function=f), end="" + ) + console.print("\n") diff --git a/testbed/Textualize__textual/src/textual/renderables/text_opacity.py b/testbed/Textualize__textual/src/textual/renderables/text_opacity.py new file mode 100644 index 0000000000000000000000000000000000000000..dffb5667bb3bb4a8bc70fc3ca39de1c908eacc1d --- /dev/null +++ b/testbed/Textualize__textual/src/textual/renderables/text_opacity.py @@ -0,0 +1,124 @@ +import functools +from typing import Iterable + +from rich.cells import cell_len +from rich.color import Color +from rich.console import ConsoleOptions, Console, RenderResult, RenderableType +from rich.segment import Segment +from rich.style import Style + +from textual.renderables._blend_colors import blend_colors + + +@functools.lru_cache(maxsize=1024) +def _get_blended_style_cached( + bg_color: Color, fg_color: Color, opacity: float +) -> Style: + """Blend from one color to another. + + Cached because when a UI is static the opacity will be constant. + + Args: + bg_color (Color): Background color. + fg_color (Color): Foreground color. + opacity (float): Opacity. + + Returns: + Style: Resulting style. + """ + return Style.from_color( + color=blend_colors(bg_color, fg_color, ratio=opacity), + bgcolor=bg_color, + ) + + +class TextOpacity: + """Blend foreground in to background.""" + + def __init__(self, renderable: RenderableType, opacity: float = 1.0) -> None: + """Wrap a renderable to blend foreground color into the background color. + + Args: + renderable (RenderableType): The RenderableType to manipulate. + opacity (float): The opacity as a float. A value of 1.0 means text is fully visible. + """ + self.renderable = renderable + self.opacity = opacity + + @classmethod + def process_segments( + cls, segments: Iterable[Segment], opacity: float + ) -> Iterable[Segment]: + """Apply opacity to segments. + + Args: + segments (Iterable[Segment]): Incoming segments. + opacity (float): Opacity to apply. + + Returns: + Iterable[Segment]: Segments with applied opacity. + + """ + _Segment = Segment + _from_color = Style.from_color + if opacity == 0: + for text, style, control in segments: + invisible_style = _from_color(bgcolor=style.bgcolor) + yield _Segment(cell_len(text) * " ", invisible_style) + else: + for segment in segments: + text, style, control = segment + if not style: + yield segment + continue + + color = style.color + bgcolor = style.bgcolor + if color and color.triplet and bgcolor and bgcolor.triplet: + color_style = _get_blended_style_cached(bgcolor, color, opacity) + yield _Segment(text, style + color_style) + else: + yield segment + + def __rich_console__( + self, console: Console, options: ConsoleOptions + ) -> RenderResult: + segments = console.render(self.renderable, options) + return self.process_segments(segments, self.opacity) + + +if __name__ == "__main__": + from rich.live import Live + from rich.panel import Panel + from rich.text import Text + + from time import sleep + + console = Console() + + panel = Panel.fit( + Text("Steak: £30", style="#fcffde on #03761e"), + title="Menu", + style="#ffffff on #000000", + ) + console.print(panel) + + opacity_panel = TextOpacity(panel, opacity=0.5) + console.print(opacity_panel) + + def frange(start, end, step): + current = start + while current < end: + yield current + current += step + + while current >= 0: + yield current + current -= step + + import itertools + + with Live(opacity_panel, refresh_per_second=60) as live: + for value in itertools.cycle(frange(0, 1, 0.05)): + opacity_panel.value = value + sleep(0.05) diff --git a/testbed/Textualize__textual/src/textual/renderables/tint.py b/testbed/Textualize__textual/src/textual/renderables/tint.py new file mode 100644 index 0000000000000000000000000000000000000000..022862b3a8daf96df7f51481eb7897cf9ebd7e8c --- /dev/null +++ b/testbed/Textualize__textual/src/textual/renderables/tint.py @@ -0,0 +1,75 @@ +from __future__ import annotations + +from typing import Iterable + +from rich.console import ConsoleOptions, Console, RenderResult, RenderableType +from rich.segment import Segment +from rich.style import Style + +from ..color import Color + + +class Tint: + """Applies a color on top of an existing renderable.""" + + def __init__(self, renderable: RenderableType, color: Color) -> None: + """Wrap a renderable to apply a tint color. + + Args: + renderable (RenderableType): A renderable. + color (Color): A color (presumably with alpha). + """ + self.renderable = renderable + self.color = color + + @classmethod + def process_segments( + cls, segments: Iterable[Segment], color: Color + ) -> Iterable[Segment]: + """Apply tint to segments. + + Args: + segments (Iterable[Segment]): Incoming segments. + color (Color): Color of tint. + + Returns: + Iterable[Segment]: Segments with applied tint. + + """ + from_rich_color = Color.from_rich_color + style_from_color = Style.from_color + _Segment = Segment + + NULL_STYLE = Style() + for segment in segments: + text, style, control = segment + if control: + yield segment + else: + style = style or NULL_STYLE + yield _Segment( + text, + ( + style + + style_from_color( + ( + (from_rich_color(style.color) + color).rich_color + if style.color is not None + else None + ), + ( + (from_rich_color(style.bgcolor) + color).rich_color + if style.bgcolor is not None + else None + ), + ) + ), + control, + ) + + def __rich_console__( + self, console: Console, options: ConsoleOptions + ) -> RenderResult: + segments = console.render(self.renderable, options) + color = self.color + return self.process_segments(segments, color) diff --git a/testbed/Textualize__textual/src/textual/richreadme.md b/testbed/Textualize__textual/src/textual/richreadme.md new file mode 100644 index 0000000000000000000000000000000000000000..090795a07a5905c1b7ed6afaff17712cc3aaccad --- /dev/null +++ b/testbed/Textualize__textual/src/textual/richreadme.md @@ -0,0 +1,444 @@ +[![Downloads](https://pepy.tech/badge/rich/month)](https://pepy.tech/project/rich) +[![PyPI version](https://badge.fury.io/py/rich.svg)](https://badge.fury.io/py/rich) +[![codecov](https://codecov.io/gh/willmcgugan/rich/branch/master/graph/badge.svg)](https://codecov.io/gh/willmcgugan/rich) +[![Rich blog](https://img.shields.io/badge/blog-rich%20news-yellowgreen)](https://www.willmcgugan.com/tag/rich/) +[![Twitter Follow](https://img.shields.io/twitter/follow/willmcgugan.svg?style=social)](https://twitter.com/willmcgugan) + +![Logo](https://github.com/willmcgugan/rich/raw/master/imgs/logo.svg) + +[中文 readme](https://github.com/willmcgugan/rich/blob/master/README.cn.md) • [Lengua española readme](https://github.com/willmcgugan/rich/blob/master/README.es.md) • [Deutsche readme](https://github.com/willmcgugan/rich/blob/master/README.de.md) • [Läs på svenska](https://github.com/willmcgugan/rich/blob/master/README.sv.md) • [日本語 readme](https://github.com/willmcgugan/rich/blob/master/README.ja.md) • [한국어 readme](https://github.com/willmcgugan/rich/blob/master/README.kr.md) + +Rich is a Python library for _rich_ text and beautiful formatting in the terminal. + +The [Rich API](https://rich.readthedocs.io/en/latest/) makes it easy to add color and style to terminal output. Rich can also render pretty tables, progress bars, markdown, syntax highlighted source code, tracebacks, and more — out of the box. + +![Features](https://github.com/willmcgugan/rich/raw/master/imgs/features.png) + +For a video introduction to Rich see [calmcode.io](https://calmcode.io/rich/introduction.html) by [@fishnets88](https://twitter.com/fishnets88). + +See what [people are saying about Rich](https://www.willmcgugan.com/blog/pages/post/rich-tweets/). + +## Compatibility + +Rich works with Linux, OSX, and Windows. True color / emoji works with new Windows Terminal, classic terminal is limited to 16 colors. Rich requires Python 3.6.1 or later. + +Rich works with [Jupyter notebooks](https://jupyter.org/) with no additional configuration required. + +## Installing + +Install with `pip` or your favorite PyPi package manager. + +``` +pip install rich +``` + +Run the following to test Rich output on your terminal: + +``` +python -m rich +``` + +## Rich Print + +To effortlessly add rich output to your application, you can import the [rich print](https://rich.readthedocs.io/en/latest/introduction.html#quick-start) method, which has the same signature as the builtin Python function. Try this: + +```python +from rich import print + +print("Hello, [bold magenta]World[/bold magenta]!", ":vampire:", locals()) +``` + +![Hello World](https://github.com/willmcgugan/rich/raw/master/imgs/print.png) + +## Rich REPL + +Rich can be installed in the Python REPL, so that any data structures will be pretty printed and highlighted. + +```python +>>> from rich import pretty +>>> pretty.install() +``` + +![REPL](https://github.com/willmcgugan/rich/raw/master/imgs/repl.png) + +## Using the Console + +For more control over rich terminal content, import and construct a [Console](https://rich.readthedocs.io/en/latest/reference/console.html#rich.console.Console) object. + +```python +from rich.console import Console + +console = Console() +``` + +The Console object has a `print` method which has an intentionally similar interface to the builtin `print` function. Here's an example of use: + +```python +console.print("Hello", "World!") +``` + +As you might expect, this will print `"Hello World!"` to the terminal. Note that unlike the builtin `print` function, Rich will word-wrap your text to fit within the terminal width. + +There are a few ways of adding color and style to your output. You can set a style for the entire output by adding a `style` keyword argument. Here's an example: + +```python +console.print("Hello", "World!", style="bold red") +``` + +The output will be something like the following: + +![Hello World](https://github.com/willmcgugan/rich/raw/master/imgs/hello_world.png) + +That's fine for styling a line of text at a time. For more finely grained styling, Rich renders a special markup which is similar in syntax to [bbcode](https://en.wikipedia.org/wiki/BBCode). Here's an example: + +```python +console.print("Where there is a [bold cyan]Will[/bold cyan] there [u]is[/u] a [i]way[/i].") +``` + +![Console Markup](https://github.com/willmcgugan/rich/raw/master/imgs/where_there_is_a_will.png) + +You can use a Console object to generate sophisticated output with minimal effort. See the [Console API](https://rich.readthedocs.io/en/latest/console.html) docs for details. + +## Rich Inspect + +Rich has an [inspect](https://rich.readthedocs.io/en/latest/reference/init.html?highlight=inspect#rich.inspect) function which can produce a report on any Python object, such as class, instance, or builtin. + +```python +>>> my_list = ["foo", "bar"] +>>> from rich import inspect +>>> inspect(my_list, methods=True) +``` + +![Log](https://github.com/willmcgugan/rich/raw/master/imgs/inspect.png) + +See the [inspect docs](https://rich.readthedocs.io/en/latest/reference/init.html#rich.inspect) for details. + +# Rich Library + +Rich contains a number of builtin _renderables_ you can use to create elegant output in your CLI and help you debug your code. + +Click the following headings for details: + +
+Log + +The Console object has a `log()` method which has a similar interface to `print()`, but also renders a column for the current time and the file and line which made the call. By default Rich will do syntax highlighting for Python structures and for repr strings. If you log a collection (i.e. a dict or a list) Rich will pretty print it so that it fits in the available space. Here's an example of some of these features. + +```python +from rich.console import Console +console = Console() + +test_data = [ + {"jsonrpc": "2.0", "method": "sum", "params": [None, 1, 2, 4, False, True], "id": "1",}, + {"jsonrpc": "2.0", "method": "notify_hello", "params": [7]}, + {"jsonrpc": "2.0", "method": "subtract", "params": [42, 23], "id": "2"}, +] + +def test_log(): + enabled = False + context = { + "foo": "bar", + } + movies = ["Deadpool", "Rise of the Skywalker"] + console.log("Hello from", console, "!") + console.log(test_data, log_locals=True) + + +test_log() +``` + +The above produces the following output: + +![Log](https://github.com/willmcgugan/rich/raw/master/imgs/log.png) + +Note the `log_locals` argument, which outputs a table containing the local variables where the log method was called. + +The log method could be used for logging to the terminal for long running applications such as servers, but is also a very nice debugging aid. + +
+
+Logging Handler + +You can also use the builtin [Handler class](https://rich.readthedocs.io/en/latest/logging.html) to format and colorize output from Python's logging module. Here's an example of the output: + +![Logging](https://github.com/willmcgugan/rich/raw/master/imgs/logging.png) + +
+ +
+Emoji + +To insert an emoji in to console output place the name between two colons. Here's an example: + +```python +>>> console.print(":smiley: :vampire: :pile_of_poo: :thumbs_up: :raccoon:") +😃 🧛 💩 👍 🦝 +``` + +Please use this feature wisely. + +
+ +
+Tables + +Rich can render flexible [tables](https://rich.readthedocs.io/en/latest/tables.html) with unicode box characters. There is a large variety of formatting options for borders, styles, cell alignment etc. + +![table movie](https://github.com/willmcgugan/rich/raw/master/imgs/table_movie.gif) + +The animation above was generated with [table_movie.py](https://github.com/willmcgugan/rich/blob/master/examples/table_movie.py) in the examples directory. + +Here's a simpler table example: + +```python +from rich.console import Console +from rich.table import Table + +console = Console() + +table = Table(show_header=True, header_style="bold magenta") +table.add_column("Date", style="dim", width=12) +table.add_column("Title") +table.add_column("Production Budget", justify="right") +table.add_column("Box Office", justify="right") +table.add_row( + "Dev 20, 2019", "Star Wars: The Rise of Skywalker", "$275,000,000", "$375,126,118" +) +table.add_row( + "May 25, 2018", + "[red]Solo[/red]: A Star Wars Story", + "$275,000,000", + "$393,151,347", +) +table.add_row( + "Dec 15, 2017", + "Star Wars Ep. VIII: The Last Jedi", + "$262,000,000", + "[bold]$1,332,539,889[/bold]", +) + +console.print(table) +``` + +This produces the following output: + +![table](https://github.com/willmcgugan/rich/raw/master/imgs/table.png) + +Note that console markup is rendered in the same way as `print()` and `log()`. In fact, anything that is renderable by Rich may be included in the headers / rows (even other tables). + +The `Table` class is smart enough to resize columns to fit the available width of the terminal, wrapping text as required. Here's the same example, with the terminal made smaller than the table above: + +![table2](https://github.com/willmcgugan/rich/raw/master/imgs/table2.png) + +
+ +
+Progress Bars + +Rich can render multiple flicker-free [progress](https://rich.readthedocs.io/en/latest/progress.html) bars to track long-running tasks. + +For basic usage, wrap any sequence in the `track` function and iterate over the result. Here's an example: + +```python +from rich.progress import track + +for step in track(range(100)): + do_step(step) +``` + +It's not much harder to add multiple progress bars. Here's an example taken from the docs: + +![progress](https://github.com/willmcgugan/rich/raw/master/imgs/progress.gif) + +The columns may be configured to show any details you want. Built-in columns include percentage complete, file size, file speed, and time remaining. Here's another example showing a download in progress: + +![progress](https://github.com/willmcgugan/rich/raw/master/imgs/downloader.gif) + +To try this out yourself, see [examples/downloader.py](https://github.com/willmcgugan/rich/blob/master/examples/downloader.py) which can download multiple URLs simultaneously while displaying progress. + +
+ +
+Status + +For situations where it is hard to calculate progress, you can use the [status](https://rich.readthedocs.io/en/latest/reference/console.html#rich.console.Console.status) method which will display a 'spinner' animation and message. The animation won't prevent you from using the console as normal. Here's an example: + +```python +from time import sleep +from rich.console import Console + +console = Console() +tasks = [f"task {n}" for n in range(1, 11)] + +with console.status("[bold green]Working on tasks...") as status: + while tasks: + task = tasks.pop(0) + sleep(1) + console.log(f"{task} complete") +``` + +This generates the following output in the terminal. + +![status](https://github.com/willmcgugan/rich/raw/master/imgs/status.gif) + +The spinner animations were borrowed from [cli-spinners](https://www.npmjs.com/package/cli-spinners). You can select a spinner by specifying the `spinner` parameter. Run the following command to see the available values: + +``` +python -m rich.spinner +``` + +The above command generate the following output in the terminal: + +![spinners](https://github.com/willmcgugan/rich/raw/master/imgs/spinners.gif) + +
+ +
+Tree + +Rich can render a [tree](https://rich.readthedocs.io/en/latest/tree.html) with guide lines. A tree is ideal for displaying a file structure, or any other hierarchical data. + +The labels of the tree can be simple text or anything else Rich can render. Run the following for a demonstration: + +``` +python -m rich.tree +``` + +This generates the following output: + +![markdown](https://github.com/willmcgugan/rich/raw/master/imgs/tree.png) + +See the [tree.py](https://github.com/willmcgugan/rich/blob/master/examples/tree.py) example for a script that displays a tree view of any directory, similar to the linux `tree` command. + +
+ +
+Columns + +Rich can render content in neat [columns](https://rich.readthedocs.io/en/latest/columns.html) with equal or optimal width. Here's a very basic clone of the (macOS / Linux) `ls` command which displays a directory listing in columns: + +```python +import os +import sys + +from rich import print +from rich.columns import Columns + +directory = os.listdir(sys.argv[1]) +print(Columns(directory)) +``` + +The following screenshot is the output from the [columns example](https://github.com/willmcgugan/rich/blob/master/examples/columns.py) which displays data pulled from an API in columns: + +![columns](https://github.com/willmcgugan/rich/raw/master/imgs/columns.png) + +
+ +
+Markdown + +Rich can render [markdown](https://rich.readthedocs.io/en/latest/markdown.html) and does a reasonable job of translating the formatting to the terminal. + +To render markdown import the `Markdown` class and construct it with a string containing markdown code. Then print it to the console. Here's an example: + +```python +from rich.console import Console +from rich.markdown import Markdown + +console = Console() +with open("README.md") as readme: + markdown = Markdown(readme.read()) +console.print(markdown) +``` + +This will produce output something like the following: + +![markdown](https://github.com/willmcgugan/rich/raw/master/imgs/markdown.png) + +
+ +
+Syntax Highlighting + +Rich uses the [pygments](https://pygments.org/) library to implement [syntax highlighting](https://rich.readthedocs.io/en/latest/syntax.html). Usage is similar to rendering markdown; construct a `Syntax` object and print it to the console. Here's an example: + +```python +from rich.console import Console +from rich.syntax import Syntax + +my_code = ''' +def iter_first_last(values: Iterable[T]) -> Iterable[Tuple[bool, bool, T]]: + """Iterate and generate a tuple with a flag for first and last value.""" + iter_values = iter(values) + try: + previous_value = next(iter_values) + except StopIteration: + return + first = True + for value in iter_values: + yield first, False, previous_value + first = False + previous_value = value + yield first, True, previous_value +''' +syntax = Syntax(my_code, "python", theme="monokai", line_numbers=True) +console = Console() +console.print(syntax) +``` + +This will produce the following output: + +![syntax](https://github.com/willmcgugan/rich/raw/master/imgs/syntax.png) + +
+ +
+Tracebacks + +Rich can render [beautiful tracebacks](https://rich.readthedocs.io/en/latest/traceback.html) which are easier to read and show more code than standard Python tracebacks. You can set Rich as the default traceback handler so all uncaught exceptions will be rendered by Rich. + +Here's what it looks like on OSX (similar on Linux): + +![traceback](https://github.com/willmcgugan/rich/raw/master/imgs/traceback.png) + +
+ +All Rich renderables make use of the [Console Protocol](https://rich.readthedocs.io/en/latest/protocol.html), which you can also use to implement your own Rich content. + +# Rich for enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of Rich and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source packages you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact packages you use. [Learn more.](https://tidelift.com/subscription/pkg/pypi-rich?utm_source=pypi-rich&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + +# Project using Rich + +Here are a few projects using Rich: + +- [BrancoLab/BrainRender](https://github.com/BrancoLab/BrainRender) + a python package for the visualization of three dimensional neuro-anatomical data +- [Ciphey/Ciphey](https://github.com/Ciphey/Ciphey) + Automated decryption tool +- [emeryberger/scalene](https://github.com/emeryberger/scalene) + a high-performance, high-precision CPU and memory profiler for Python +- [hedythedev/StarCli](https://github.com/hedythedev/starcli) + Browse GitHub trending projects from your command line +- [intel/cve-bin-tool](https://github.com/intel/cve-bin-tool) + This tool scans for a number of common, vulnerable components (openssl, libpng, libxml2, expat and a few others) to let you know if your system includes common libraries with known vulnerabilities. +- [nf-core/tools](https://github.com/nf-core/tools) + Python package with helper tools for the nf-core community. +- [cansarigol/pdbr](https://github.com/cansarigol/pdbr) + pdb + Rich library for enhanced debugging +- [plant99/felicette](https://github.com/plant99/felicette) + Satellite imagery for dummies. +- [seleniumbase/SeleniumBase](https://github.com/seleniumbase/SeleniumBase) + Automate & test 10x faster with Selenium & pytest. Batteries included. +- [smacke/ffsubsync](https://github.com/smacke/ffsubsync) + Automagically synchronize subtitles with video. +- [tryolabs/norfair](https://github.com/tryolabs/norfair) + Lightweight Python library for adding real-time 2D object tracking to any detector. +- [ansible/ansible-lint](https://github.com/ansible/ansible-lint) Ansible-lint checks playbooks for practices and behaviour that could potentially be improved +- [ansible-community/molecule](https://github.com/ansible-community/molecule) Ansible Molecule testing framework +- +[Many more](https://github.com/willmcgugan/rich/network/dependents)! + + diff --git a/testbed/Textualize__textual/src/textual/scroll_view.py b/testbed/Textualize__textual/src/textual/scroll_view.py new file mode 100644 index 0000000000000000000000000000000000000000..0fc2a4cc9f8e88f2f399fb9ed70ad6eeec489c43 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/scroll_view.py @@ -0,0 +1,91 @@ +from __future__ import annotations + +from rich.console import RenderableType + +from .geometry import Size +from .widget import Widget + + +class ScrollView(Widget): + """ + A base class for a Widget that handles it's own scrolling (i.e. doesn't rely + on the compositor to render children). + + """ + + DEFAULT_CSS = """ + ScrollView { + overflow-y: auto; + overflow-x: auto; + } + """ + + @property + def is_scrollable(self) -> bool: + """Always scrollable.""" + return True + + @property + def is_transparent(self) -> bool: + """Not transparent, i.e. renders something.""" + return False + + def on_mount(self): + self._refresh_scrollbars() + + def get_content_width(self, container: Size, viewport: Size) -> int: + """Gets the width of the content area. + + Args: + container (Size): Size of the container (immediate parent) widget. + viewport (Size): Size of the viewport. + + Returns: + int: The optimal width of the content. + """ + return self.virtual_size.width + + def get_content_height(self, container: Size, viewport: Size, width: int) -> int: + """Gets the height (number of lines) in the content area. + + Args: + container (Size): Size of the container (immediate parent) widget. + viewport (Size): Size of the viewport. + width (int): Width of renderable. + + Returns: + int: The height of the content. + """ + return self.virtual_size.height + + def _size_updated( + self, size: Size, virtual_size: Size, container_size: Size + ) -> None: + """Called when size is updated. + + Args: + size (Size): New size. + virtual_size (Size): New virtual size. + container_size (Size): New container size. + """ + if ( + self._size != size + or virtual_size != self.virtual_size + or container_size != self.container_size + ): + self._size = size + virtual_size = self.virtual_size + self._scroll_update(virtual_size) + self._container_size = size - self.styles.gutter.totals + self.scroll_to(self.scroll_x, self.scroll_y, animate=False) + self.refresh() + + def render(self) -> RenderableType: + """Render the scrollable region (if `render_lines` is not implemented). + + Returns: + RenderableType: Renderable object. + """ + from rich.panel import Panel + + return Panel(f"{self.scroll_offset} {self.show_vertical_scrollbar}") diff --git a/testbed/Textualize__textual/src/textual/scrollbar.py b/testbed/Textualize__textual/src/textual/scrollbar.py new file mode 100644 index 0000000000000000000000000000000000000000..04aa18ee608700f0e037d3125b3432700360a708 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/scrollbar.py @@ -0,0 +1,337 @@ +from __future__ import annotations + +from math import ceil + +import rich.repr +from rich.color import Color +from rich.console import ConsoleOptions, RenderableType, RenderResult +from rich.segment import Segment, Segments +from rich.style import NULL_STYLE, Style, StyleType + +from . import events +from ._types import MessageTarget +from .geometry import Offset +from .message import Message +from .reactive import Reactive +from .renderables.blank import Blank +from .widget import Widget + + +class ScrollMessage(Message, bubble=False): + pass + + +@rich.repr.auto +class ScrollUp(ScrollMessage, verbose=True): + """Message sent when clicking above handle.""" + + +@rich.repr.auto +class ScrollDown(ScrollMessage, verbose=True): + """Message sent when clicking below handle.""" + + +@rich.repr.auto +class ScrollLeft(ScrollMessage, verbose=True): + """Message sent when clicking above handle.""" + + +@rich.repr.auto +class ScrollRight(ScrollMessage, verbose=True): + """Message sent when clicking below handle.""" + + +class ScrollTo(ScrollMessage, verbose=True): + """Message sent when click and dragging handle.""" + + def __init__( + self, + sender: MessageTarget, + x: float | None = None, + y: float | None = None, + animate: bool = True, + ) -> None: + self.x = x + self.y = y + self.animate = animate + super().__init__(sender) + + def __rich_repr__(self) -> rich.repr.Result: + yield "x", self.x, None + yield "y", self.y, None + yield "animate", self.animate, True + + +class ScrollBarRender: + def __init__( + self, + virtual_size: int = 100, + window_size: int = 0, + position: float = 0, + thickness: int = 1, + vertical: bool = True, + style: StyleType = "bright_magenta on #555555", + ) -> None: + self.virtual_size = virtual_size + self.window_size = window_size + self.position = position + self.thickness = thickness + self.vertical = vertical + self.style = style + + @classmethod + def render_bar( + cls, + size: int = 25, + virtual_size: float = 50, + window_size: float = 20, + position: float = 0, + thickness: int = 1, + vertical: bool = True, + back_color: Color = Color.parse("#555555"), + bar_color: Color = Color.parse("bright_magenta"), + ) -> Segments: + + if vertical: + bars = ["▁", "▂", "▃", "▄", "▅", "▆", "▇", " "] + else: + bars = ["▉", "▊", "▋", "▌", "▍", "▎", "▏", " "] + + back = back_color + bar = bar_color + + len_bars = len(bars) + + width_thickness = thickness if vertical else 1 + + _Segment = Segment + _Style = Style + blank = " " * width_thickness + + foreground_meta = {"@mouse.up": "release", "@mouse.down": "grab"} + if window_size and size and virtual_size and size != virtual_size: + step_size = virtual_size / size + + start = int(position / step_size * len_bars) + end = start + max(len_bars, int(ceil(window_size / step_size * len_bars))) + + start_index, start_bar = divmod(max(0, start), len_bars) + end_index, end_bar = divmod(max(0, end), len_bars) + + upper = {"@mouse.up": "scroll_up"} + lower = {"@mouse.up": "scroll_down"} + + upper_back_segment = Segment(blank, _Style(bgcolor=back, meta=upper)) + lower_back_segment = Segment(blank, _Style(bgcolor=back, meta=lower)) + + segments = [upper_back_segment] * int(size) + segments[end_index:] = [lower_back_segment] * (size - end_index) + + segments[start_index:end_index] = [ + _Segment(blank, _Style(bgcolor=bar, meta=foreground_meta)) + ] * (end_index - start_index) + + # Apply the smaller bar characters to head and tail of scrollbar for more "granularity" + if start_index < len(segments): + bar_character = bars[len_bars - 1 - start_bar] + if bar_character != " ": + segments[start_index] = _Segment( + bar_character * width_thickness, + _Style(bgcolor=back, color=bar, meta=foreground_meta) + if vertical + else _Style(bgcolor=bar, color=back, meta=foreground_meta), + ) + if end_index < len(segments): + bar_character = bars[len_bars - 1 - end_bar] + if bar_character != " ": + segments[end_index] = _Segment( + bar_character * width_thickness, + _Style(bgcolor=bar, color=back, meta=foreground_meta) + if vertical + else _Style(bgcolor=back, color=bar, meta=foreground_meta), + ) + else: + style = _Style(bgcolor=back) + segments = [_Segment(blank, style=style)] * int(size) + if vertical: + return Segments(segments, new_lines=True) + else: + return Segments((segments + [_Segment.line()]) * thickness, new_lines=False) + + def __rich_console__( + self, console: Console, options: ConsoleOptions + ) -> RenderResult: + size = ( + (options.height or console.height) + if self.vertical + else (options.max_width or console.width) + ) + thickness = ( + (options.max_width or console.width) + if self.vertical + else (options.height or console.height) + ) + + _style = console.get_style(self.style) + + bar = self.render_bar( + size=size, + window_size=self.window_size, + virtual_size=self.virtual_size, + position=self.position, + vertical=self.vertical, + thickness=thickness, + back_color=_style.bgcolor or Color.parse("#555555"), + bar_color=_style.color or Color.parse("bright_magenta"), + ) + yield bar + + +@rich.repr.auto +class ScrollBar(Widget): + + DEFAULT_CSS = """ + ScrollBar { + hover-color: ; + hover-background:; + hover-style: ; + link-color: transparent; + link-background: transparent; + } + """ + + def __init__( + self, vertical: bool = True, name: str | None = None, *, thickness: int = 1 + ) -> None: + self.vertical = vertical + self.thickness = thickness + self.grabbed_position: float = 0 + super().__init__(name=name) + self.auto_links = False + + window_virtual_size: Reactive[int] = Reactive(100) + window_size: Reactive[int] = Reactive(0) + position: Reactive[int] = Reactive(0) + mouse_over: Reactive[bool] = Reactive(False) + grabbed: Reactive[Offset | None] = Reactive(None) + + def __rich_repr__(self) -> rich.repr.Result: + yield from super().__rich_repr__() + yield "window_virtual_size", self.window_virtual_size + yield "window_size", self.window_size + yield "position", self.position + if self.thickness > 1: + yield "thickness", self.thickness + + def render(self) -> RenderableType: + styles = self.parent.styles + background = ( + styles.scrollbar_background_hover + if self.mouse_over + else styles.scrollbar_background + ) + color = ( + styles.scrollbar_color_active if self.grabbed else styles.scrollbar_color + ) + color = background + color + scrollbar_style = Style.from_color(color.rich_color, background.rich_color) + return ScrollBarRender( + virtual_size=self.window_virtual_size, + window_size=( + self.window_size if self.window_size < self.window_virtual_size else 0 + ), + position=self.position, + thickness=self.thickness, + vertical=self.vertical, + style=scrollbar_style, + ) + + def _on_hide(self, event: events.Hide) -> None: + if self.grabbed: + self.release_mouse() + + def _on_enter(self, event: events.Enter) -> None: + self.mouse_over = True + + def _on_leave(self, event: events.Leave) -> None: + self.mouse_over = False + + async def action_scroll_down(self) -> None: + await self.emit(ScrollDown(self) if self.vertical else ScrollRight(self)) + + async def action_scroll_up(self) -> None: + await self.emit(ScrollUp(self) if self.vertical else ScrollLeft(self)) + + def action_grab(self) -> None: + self.capture_mouse() + + def action_released(self) -> None: + self.capture_mouse(False) + + async def _on_mouse_up(self, event: events.MouseUp) -> None: + if self.grabbed: + self.release_mouse() + event.stop() + + def _on_mouse_capture(self, event: events.MouseCapture) -> None: + self.grabbed = event.mouse_position + self.grabbed_position = self.position + + def _on_mouse_release(self, event: events.MouseRelease) -> None: + self.grabbed = None + event.stop() + + async def _on_mouse_move(self, event: events.MouseMove) -> None: + if self.grabbed and self.window_size: + x: float | None = None + y: float | None = None + if self.vertical: + y = round( + self.grabbed_position + + ( + (event.screen_y - self.grabbed.y) + * (self.window_virtual_size / self.window_size) + ) + ) + else: + x = round( + self.grabbed_position + + ( + (event.screen_x - self.grabbed.x) + * (self.window_virtual_size / self.window_size) + ) + ) + await self.emit(ScrollTo(self, x=x, y=y)) + event.stop() + + async def _on_click(self, event: events.Click) -> None: + event.stop() + + +class ScrollBarCorner(Widget): + """Widget which fills the gap between horizontal and vertical scrollbars, + should they both be present.""" + + def __init__(self, name: str | None = None): + super().__init__(name=name) + + def render(self) -> RenderableType: + assert self.parent is not None + styles = self.parent.styles + color = styles.scrollbar_corner_color + return Blank(color) + + +if __name__ == "__main__": + from rich.console import Console + + console = Console() + + thickness = 2 + console.print(f"Bars thickness: {thickness}") + + console.print("Vertical bar:") + console.print(ScrollBarRender.render_bar(thickness=thickness)) + + console.print("Horizontal bar:") + console.print(ScrollBarRender.render_bar(vertical=False, thickness=thickness)) diff --git a/testbed/Textualize__textual/src/textual/suggestions.py b/testbed/Textualize__textual/src/textual/suggestions.py new file mode 100644 index 0000000000000000000000000000000000000000..e3fb20db2d208ab67445a5f5e7ecdadd5da65bb6 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/suggestions.py @@ -0,0 +1,38 @@ +from __future__ import annotations + +from difflib import get_close_matches +from typing import Sequence + + +def get_suggestion(word: str, possible_words: Sequence[str]) -> str | None: + """ + Returns a close match of `word` amongst `possible_words`. + + Args: + word (str): The word we want to find a close match for + possible_words (Sequence[str]): The words amongst which we want to find a close match + + Returns: + str | None: The closest match amongst the `possible_words`. Returns `None` if no close matches could be found. + + Example: returns "red" for word "redu" and possible words ("yellow", "red") + """ + possible_matches = get_close_matches(word, possible_words, n=1) + return None if not possible_matches else possible_matches[0] + + +def get_suggestions(word: str, possible_words: Sequence[str], count: int) -> list[str]: + """ + Returns a list of up to `count` matches of `word` amongst `possible_words`. + + Args: + word (str): The word we want to find a close match for + possible_words (Sequence[str]): The words amongst which we want to find close matches + + Returns: + list[str]: The closest matches amongst the `possible_words`, from the closest to the least close. + Returns an empty list if no close matches could be found. + + Example: returns ["yellow", "ellow"] for word "yllow" and possible words ("yellow", "red", "ellow") + """ + return get_close_matches(word, possible_words, n=count) diff --git a/testbed/Textualize__textual/src/textual/timer.py b/testbed/Textualize__textual/src/textual/timer.py new file mode 100644 index 0000000000000000000000000000000000000000..938b0e1c61064c9e5b1c5ea951e2a0116c47931d --- /dev/null +++ b/testbed/Textualize__textual/src/textual/timer.py @@ -0,0 +1,182 @@ +""" + +Timer objects are created by [set_interval][textual.message_pump.MessagePump.set_interval] or + [set_interval][textual.message_pump.MessagePump.set_timer]. + +""" + +from __future__ import annotations + +import asyncio +import weakref +from asyncio import ( + CancelledError, + Event, + Task, +) +from typing import Awaitable, Callable, Union + +from rich.repr import Result, rich_repr + +from . import events +from ._callback import invoke +from ._context import active_app +from . import _clock +from ._types import MessageTarget + +TimerCallback = Union[Callable[[], Awaitable[None]], Callable[[], None]] + + +class EventTargetGone(Exception): + pass + + +@rich_repr +class Timer: + """A class to send timer-based events. + + Args: + event_target (MessageTarget): The object which will receive the timer events. + interval (float): The time between timer events. + sender (MessageTarget): The sender of the event. + name (str | None, optional): A name to assign the event (for debugging). Defaults to None. + callback (TimerCallback | None, optional): A optional callback to invoke when the event is handled. Defaults to None. + repeat (int | None, optional): The number of times to repeat the timer, or None to repeat forever. Defaults to None. + skip (bool, optional): Enable skipping of scheduled events that couldn't be sent in time. Defaults to True. + pause (bool, optional): Start the timer paused. Defaults to False. + """ + + _timer_count: int = 1 + + def __init__( + self, + event_target: MessageTarget, + interval: float, + sender: MessageTarget, + *, + name: str | None = None, + callback: TimerCallback | None = None, + repeat: int | None = None, + skip: bool = True, + pause: bool = False, + ) -> None: + self._target_repr = repr(event_target) + self._target = weakref.ref(event_target) + self._interval = interval + self.sender = sender + self.name = f"Timer#{self._timer_count}" if name is None else name + self._timer_count += 1 + self._callback = callback + self._repeat = repeat + self._skip = skip + self._active = Event() + self._task: Task | None = None + self._reset: bool = False + if not pause: + self._active.set() + + def __rich_repr__(self) -> Result: + yield self._interval + yield "name", self.name + yield "repeat", self._repeat, None + + @property + def target(self) -> MessageTarget: + target = self._target() + if target is None: + raise EventTargetGone() + return target + + def start(self) -> Task: + """Start the timer return the task. + + Returns: + Task: A Task instance for the timer. + """ + self._task = asyncio.create_task(self._run_timer()) + return self._task + + def stop_no_wait(self) -> None: + """Stop the timer.""" + if self._task is not None: + self._task.cancel() + self._task = None + + async def stop(self) -> None: + """Stop the timer, and block until it exits.""" + if self._task is not None: + self._active.set() + self._task.cancel() + self._task = None + + def pause(self) -> None: + """Pause the timer. + + A paused timer will not send events until it is resumed. + + """ + self._active.clear() + + def reset(self) -> None: + """Reset the timer, so it starts from the beginning.""" + self._active.set() + self._reset = True + + def resume(self) -> None: + """Resume a paused timer.""" + self._active.set() + + async def _run_timer(self) -> None: + """Run the timer task.""" + try: + await self._run() + except CancelledError: + pass + + async def _run(self) -> None: + """Run the timer.""" + count = 0 + _repeat = self._repeat + _interval = self._interval + await self._active.wait() + start = _clock.get_time_no_wait() + while _repeat is None or count <= _repeat: + next_timer = start + ((count + 1) * _interval) + now = await _clock.get_time() + if self._skip and next_timer < now: + count += 1 + continue + now = await _clock.get_time() + wait_time = max(0, next_timer - now) + if wait_time: + await _clock.sleep(wait_time) + + count += 1 + await self._active.wait() + if self._reset: + start = _clock.get_time_no_wait() + count = 0 + self._reset = False + continue + try: + await self._tick(next_timer=next_timer, count=count) + except EventTargetGone: + break + + async def _tick(self, *, next_timer: float, count: int) -> None: + """Triggers the Timer's action: either call its callback, or sends an event to its target""" + if self._callback is not None: + try: + await invoke(self._callback) + except Exception as error: + app = active_app.get() + app._handle_exception(error) + else: + event = events.Timer( + self.sender, + timer=self, + time=next_timer, + count=count, + callback=self._callback, + ) + await self.target._post_priority_message(event) diff --git a/testbed/Textualize__textual/src/textual/widget.py b/testbed/Textualize__textual/src/textual/widget.py new file mode 100644 index 0000000000000000000000000000000000000000..43f48fa4079991fb55b14c60c3088b6098b365b1 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/widget.py @@ -0,0 +1,1994 @@ +from __future__ import annotations + +from asyncio import Lock +from fractions import Fraction +from itertools import islice +from operator import attrgetter +from typing import TYPE_CHECKING, ClassVar, Collection, Iterable, NamedTuple, cast + +import rich.repr +from rich.console import ( + Console, + ConsoleOptions, + ConsoleRenderable, + JustifyMethod, + RenderableType, + RenderResult, + RichCast, +) +from rich.measure import Measurement +from rich.segment import Segment +from rich.style import Style +from rich.text import Text + +from . import errors, events, messages +from ._animator import BoundAnimator, DEFAULT_EASING, Animatable, EasingFunction +from ._arrange import DockArrangeResult, arrange +from ._context import active_app +from ._layout import Layout +from ._segment_tools import align_lines +from ._styles_cache import StylesCache +from ._types import Lines +from .binding import NoBinding +from .box_model import BoxModel, get_box_model +from .css.scalar import ScalarOffset +from .dom import DOMNode, NoScreen +from .geometry import Offset, Region, Size, Spacing, clamp +from .layouts.vertical import VerticalLayout +from .message import Message +from .messages import CallbackType +from .reactive import Reactive +from .render import measure + +if TYPE_CHECKING: + from .app import App, ComposeResult + from .scrollbar import ( + ScrollBar, + ScrollBarCorner, + ScrollDown, + ScrollLeft, + ScrollRight, + ScrollTo, + ScrollUp, + ) + + +_JUSTIFY_MAP: dict[str, JustifyMethod] = { + "start": "left", + "end": "right", + "justify": "full", +} + + +class _Styled: + """Apply a style to a renderable. + + Args: + renderable (RenderableType): Any renderable. + style (StyleType): A style to apply across the entire renderable. + """ + + def __init__( + self, renderable: "RenderableType", style: Style, link_style: Style | None + ) -> None: + self.renderable = renderable + self.style = style + self.link_style = link_style + + def __rich_console__( + self, console: "Console", options: "ConsoleOptions" + ) -> "RenderResult": + style = console.get_style(self.style) + result_segments = console.render(self.renderable, options) + + _Segment = Segment + if style: + apply = style.__add__ + result_segments = ( + _Segment(text, apply(_style), control) + for text, _style, control in result_segments + ) + link_style = self.link_style + if link_style: + result_segments = ( + _Segment( + text, + style + if style._meta is None + else (style + link_style if "@click" in style.meta else style), + control, + ) + for text, style, control in result_segments + ) + return result_segments + + def __rich_measure__( + self, console: "Console", options: "ConsoleOptions" + ) -> Measurement: + return self.renderable.__rich_measure__(console, options) + + +class RenderCache(NamedTuple): + """Stores results of a previous render.""" + + size: Size + lines: Lines + + +@rich.repr.auto +class Widget(DOMNode): + """ + A Widget is the base class for Textual widgets. + + See also [static][textual.widgets._static.Static] for starting point for your own widgets. + + """ + + DEFAULT_CSS = """ + Widget{ + scrollbar-background: $panel-darken-1; + scrollbar-background-hover: $panel-darken-2; + scrollbar-color: $primary-lighten-1; + scrollbar-color-active: $warning-darken-1; + scrollbar-corner-color: $panel-darken-1; + scrollbar-size-vertical: 2; + scrollbar-size-horizontal: 1; + link-background:; + link-color: $text; + link-style: underline; + hover-background: $accent; + hover-color: $text; + hover-style: bold not underline; + } + """ + COMPONENT_CLASSES: ClassVar[set[str]] = set() + + can_focus: bool = False + """Widget may receive focus.""" + can_focus_children: bool = True + """Widget's children may receive focus.""" + expand = Reactive(False) + """Rich renderable may expand.""" + shrink = Reactive(True) + """Rich renderable may shrink.""" + auto_links = Reactive(True) + """Widget will highlight links automatically.""" + + hover_style: Reactive[Style] = Reactive(Style, repaint=False) + highlight_link_id: Reactive[str] = Reactive("") + + def __init__( + self, + *children: Widget, + name: str | None = None, + id: str | None = None, + classes: str | None = None, + ) -> None: + + self._size = Size(0, 0) + self._container_size = Size(0, 0) + self._layout_required = False + self._repaint_required = False + self._default_layout = VerticalLayout() + self._animate: BoundAnimator | None = None + self.highlight_style: Style | None = None + + self._vertical_scrollbar: ScrollBar | None = None + self._horizontal_scrollbar: ScrollBar | None = None + self._scrollbar_corner: ScrollBarCorner | None = None + + self._render_cache = RenderCache(Size(0, 0), []) + # Regions which need to be updated (in Widget) + self._dirty_regions: set[Region] = set() + # Regions which need to be transferred from cache to screen + self._repaint_regions: set[Region] = set() + + # Cache the auto content dimensions + # TODO: add mechanism to explicitly clear this + self._content_width_cache: tuple[object, int] = (None, 0) + self._content_height_cache: tuple[object, int] = (None, 0) + + self._arrangement: DockArrangeResult | None = None + self._arrangement_cache_key: tuple[int, Size] = (-1, Size()) + + self._styles_cache = StylesCache() + self._rich_style_cache: dict[str, Style] = {} + self._stabilized_scrollbar_size: Size | None = None + self._lock = Lock() + + super().__init__( + name=name, + id=id, + classes=self.DEFAULT_CLASSES if classes is None else classes, + ) + self._add_children(*children) + + virtual_size = Reactive(Size(0, 0), layout=True) + auto_width = Reactive(True) + auto_height = Reactive(True) + has_focus = Reactive(False) + descendant_has_focus = Reactive(False) + mouse_over = Reactive(False) + scroll_x = Reactive(0.0, repaint=False, layout=False) + scroll_y = Reactive(0.0, repaint=False, layout=False) + scroll_target_x = Reactive(0.0, repaint=False) + scroll_target_y = Reactive(0.0, repaint=False) + show_vertical_scrollbar = Reactive(False, layout=True) + show_horizontal_scrollbar = Reactive(False, layout=True) + + @property + def siblings(self) -> list[Widget]: + """Get the widget's siblings (self is removed from the return list). + + Returns: + list[Widget]: A list of siblings. + """ + parent = self.parent + if parent is not None: + siblings = list(parent.children) + siblings.remove(self) + return siblings + else: + return [] + + @property + def allow_vertical_scroll(self) -> bool: + """Check if vertical scroll is permitted. + + May be overridden if you want different logic regarding allowing scrolling. + + Returns: + bool: True if the widget may scroll _vertically_. + """ + return self.is_scrollable and self.show_vertical_scrollbar + + @property + def allow_horizontal_scroll(self) -> bool: + """Check if horizontal scroll is permitted. + + May be overridden if you want different logic regarding allowing scrolling. + + Returns: + bool: True if the widget may scroll _horizontally_. + """ + return self.is_scrollable and self.show_horizontal_scrollbar + + @property + def _allow_scroll(self) -> bool: + """Check if both axis may be scrolled. + + Returns: + bool: True if horizontal and vertical scrolling is enabled. + """ + return self.is_scrollable and ( + self.allow_horizontal_scroll or self.allow_vertical_scroll + ) + + @property + def offset(self) -> Offset: + """Widget offset from origin. + + Returns: + Offset: Relative offset. + """ + return self.styles.offset.resolve(self.size, self.app.size) + + @offset.setter + def offset(self, offset: Offset) -> None: + self.styles.offset = ScalarOffset.from_offset(offset) + + def get_component_rich_style(self, name: str) -> Style: + """Get a *Rich* style for a component. + + Args: + name (str): Name of component. + + Returns: + Style: A Rich style object. + """ + style = self._rich_style_cache.get(name) + if style is None: + style = self.get_component_styles(name).rich_style + self._rich_style_cache[name] = style + return style + + def _arrange(self, size: Size) -> DockArrangeResult: + """Arrange children. + + Args: + size (Size): Size of container. + + Returns: + ArrangeResult: Widget locations. + """ + + arrange_cache_key = (self.children._updates, size) + if ( + self._arrangement is not None + and arrange_cache_key == self._arrangement_cache_key + ): + return self._arrangement + + self._arrangement_cache_key = arrange_cache_key + self._arrangement = arrange(self, self.children, size, self.screen.size) + return self._arrangement + + def _clear_arrangement_cache(self) -> None: + """Clear arrangement cache, forcing a new arrange operation.""" + self._arrangement = None + + def mount(self, *anon_widgets: Widget, **widgets: Widget) -> None: + """Mount child widgets (making this widget a container). + + Widgets may be passed as positional arguments or keyword arguments. If keyword arguments, + the keys will be set as the Widget's id. + + Example: + ```python + self.mount(Static("hello"), header=Header()) + ``` + + """ + self.app._register(self, *anon_widgets, **widgets) + self.app.screen.refresh(layout=True) + + def compose(self) -> ComposeResult: + """Called by Textual to create child widgets. + + Extend this to build a UI. + + Example: + ```python + def compose(self) -> ComposeResult: + yield Header() + yield Container( + TreeControl(), Viewer() + ) + yield Footer() + ``` + + """ + return + yield + + def _post_register(self, app: App) -> None: + """Called when the instance is registered. + + Args: + app (App): App instance. + """ + # Parse the Widget's CSS + for path, css, tie_breaker in self.get_default_css(): + self.app.stylesheet.add_source( + css, path=path, is_default_css=True, tie_breaker=tie_breaker + ) + + def _get_box_model( + self, container: Size, viewport: Size, fraction_unit: Fraction + ) -> BoxModel: + """Process the box model for this widget. + + Args: + container (Size): The size of the container widget (with a layout) + viewport (Size): The viewport size. + fraction_unit (Fraction): The unit used for `fr` units. + + Returns: + BoxModel: The size and margin for this widget. + """ + box_model = get_box_model( + self.styles, + container, + viewport, + fraction_unit, + self.get_content_width, + self.get_content_height, + ) + return box_model + + def get_content_width(self, container: Size, viewport: Size) -> int: + """Called by textual to get the width of the content area. May be overridden in a subclass. + + Args: + container (Size): Size of the container (immediate parent) widget. + viewport (Size): Size of the viewport. + + Returns: + int: The optimal width of the content. + """ + if self.is_container: + assert self._layout is not None + return self._layout.get_content_width(self, container, viewport) + + cache_key = container.width + if self._content_width_cache[0] == cache_key: + return self._content_width_cache[1] + + console = self.app.console + renderable = self._render() + + width = measure(console, renderable, container.width) + if self.expand: + width = max(container.width, width) + if self.shrink: + width = min(width, container.width) + + self._content_width_cache = (cache_key, width) + return width + + def get_content_height(self, container: Size, viewport: Size, width: int) -> int: + """Called by Textual to get the height of the content area. May be overridden in a subclass. + + Args: + container (Size): Size of the container (immediate parent) widget. + viewport (Size): Size of the viewport. + width (int): Width of renderable. + + Returns: + int: The height of the content. + """ + + if self.is_container: + assert self._layout is not None + height = ( + self._layout.get_content_height( + self, + container, + viewport, + width, + ) + + self.scrollbar_size_horizontal + ) + else: + cache_key = width + + if self._content_height_cache[0] == cache_key: + return self._content_height_cache[1] + + renderable = self.render() + options = self._console.options.update_width(width).update(highlight=False) + segments = self._console.render(renderable, options) + # Cheaper than counting the lines returned from render_lines! + height = sum(text.count("\n") for text, _, _ in segments) + self._content_height_cache = (cache_key, height) + + return height + + def watch_hover_style( + self, previous_hover_style: Style, hover_style: Style + ) -> None: + if self.auto_links: + self.highlight_link_id = hover_style.link_id + + def watch_scroll_x(self, new_value: float) -> None: + self.horizontal_scrollbar.position = int(new_value) + self.refresh(layout=True) + self.horizontal_scrollbar.refresh() + + def watch_scroll_y(self, new_value: float) -> None: + self.vertical_scrollbar.position = int(new_value) + self.refresh(layout=True) + self.vertical_scrollbar.refresh() + + def validate_scroll_x(self, value: float) -> float: + return clamp(value, 0, self.max_scroll_x) + + def validate_scroll_target_x(self, value: float) -> float: + return clamp(value, 0, self.max_scroll_x) + + def validate_scroll_y(self, value: float) -> float: + return clamp(value, 0, self.max_scroll_y) + + def validate_scroll_target_y(self, value: float) -> float: + return clamp(value, 0, self.max_scroll_y) + + @property + def max_scroll_x(self) -> int: + """The maximum value of `scroll_x`.""" + return max( + 0, + self.virtual_size.width + - self.container_size.width + + self.scrollbar_size_vertical, + ) + + @property + def max_scroll_y(self) -> int: + """The maximum value of `scroll_y`.""" + return max( + 0, + self.virtual_size.height + - self.container_size.height + + self.scrollbar_size_horizontal, + ) + + @property + def scrollbar_corner(self) -> ScrollBarCorner: + """Return the ScrollBarCorner - the cells that appear between the + horizontal and vertical scrollbars (only when both are visible). + """ + from .scrollbar import ScrollBarCorner + + if self._scrollbar_corner is not None: + return self._scrollbar_corner + self._scrollbar_corner = ScrollBarCorner() + self.app._start_widget(self, self._scrollbar_corner) + return self._scrollbar_corner + + @property + def vertical_scrollbar(self) -> ScrollBar: + """Get a vertical scrollbar (create if necessary). + + Returns: + ScrollBar: ScrollBar Widget. + """ + from .scrollbar import ScrollBar + + if self._vertical_scrollbar is not None: + return self._vertical_scrollbar + self._vertical_scrollbar = scroll_bar = ScrollBar( + vertical=True, name="vertical", thickness=self.scrollbar_size_vertical + ) + self._vertical_scrollbar.display = False + self.app._start_widget(self, scroll_bar) + return scroll_bar + + @property + def horizontal_scrollbar(self) -> ScrollBar: + """Get a vertical scrollbar (create if necessary). + + Returns: + ScrollBar: ScrollBar Widget. + """ + from .scrollbar import ScrollBar + + if self._horizontal_scrollbar is not None: + return self._horizontal_scrollbar + self._horizontal_scrollbar = scroll_bar = ScrollBar( + vertical=False, name="horizontal", thickness=self.scrollbar_size_horizontal + ) + self._horizontal_scrollbar.display = False + + self.app._start_widget(self, scroll_bar) + return scroll_bar + + def _refresh_scrollbars(self) -> None: + """Refresh scrollbar visibility.""" + if not self.is_scrollable: + return + + styles = self.styles + overflow_x = styles.overflow_x + overflow_y = styles.overflow_y + width, height = self.container_size + + show_horizontal = self.show_horizontal_scrollbar + if overflow_x == "hidden": + show_horizontal = False + if overflow_x == "scroll": + show_horizontal = True + elif overflow_x == "auto": + show_horizontal = self.virtual_size.width > width + + show_vertical = self.show_vertical_scrollbar + if overflow_y == "hidden": + show_vertical = False + elif overflow_y == "scroll": + show_vertical = True + elif overflow_y == "auto": + show_vertical = self.virtual_size.height > height + + if ( + overflow_x == "auto" + and show_vertical + and not show_horizontal + and self._stabilized_scrollbar_size != self.container_size + ): + show_horizontal = ( + self.virtual_size.width + styles.scrollbar_size_vertical > width + ) + self._stabilized_scrollbar_size = self.container_size + + self.show_horizontal_scrollbar = show_horizontal + self.show_vertical_scrollbar = show_vertical + self.horizontal_scrollbar.display = show_horizontal + self.vertical_scrollbar.display = show_vertical + + @property + def scrollbars_enabled(self) -> tuple[bool, bool]: + """A tuple of booleans that indicate if scrollbars are enabled. + + Returns: + tuple[bool, bool]: A tuple of (, ) + + """ + if not self.is_scrollable: + return False, False + + enabled = self.show_vertical_scrollbar, self.show_horizontal_scrollbar + return enabled + + @property + def scrollbar_size_vertical(self) -> int: + """Get the width used by the *vertical* scrollbar. + + Returns: + int: Number of columns in the vertical scrollbar. + """ + styles = self.styles + if styles.scrollbar_gutter == "stable" and styles.overflow_y == "auto": + return styles.scrollbar_size_vertical + return styles.scrollbar_size_vertical if self.show_vertical_scrollbar else 0 + + @property + def scrollbar_size_horizontal(self) -> int: + """Get the height used by the *horizontal* scrollbar. + + Returns: + int: Number of rows in the horizontal scrollbar. + """ + styles = self.styles + if styles.scrollbar_gutter == "stable" and styles.overflow_x == "auto": + return styles.scrollbar_size_horizontal + return styles.scrollbar_size_horizontal if self.show_horizontal_scrollbar else 0 + + @property + def scrollbar_gutter(self) -> Spacing: + """Spacing required to fit scrollbar(s). + + Returns: + Spacing: Scrollbar gutter spacing. + """ + gutter = Spacing( + 0, self.scrollbar_size_vertical, self.scrollbar_size_horizontal, 0 + ) + return gutter + + @property + def gutter(self) -> Spacing: + """Spacing for padding / border / scrollbars. + + Returns: + Spacing: Additional spacing around content area. + + """ + return self.styles.gutter + self.scrollbar_gutter + + @property + def size(self) -> Size: + """The size of the content area. + + Returns: + Size: Content area size. + """ + return self.content_region.size + + @property + def outer_size(self) -> Size: + """The size of the widget (including padding and border). + + Returns: + Size: Outer size. + """ + return self._size + + @property + def container_size(self) -> Size: + """The size of the container (parent widget). + + Returns: + Size: Container size. + """ + return self._container_size + + @property + def content_region(self) -> Region: + """Gets an absolute region containing the content (minus padding and border). + + Returns: + Region: Screen region that contains a widget's content. + """ + content_region = self.region.shrink(self.styles.gutter) + return content_region + + @property + def content_offset(self) -> Offset: + """An offset from the Widget origin where the content begins. + + Returns: + Offset: Offset from widget's origin. + + """ + x, y = self.gutter.top_left + return Offset(x, y) + + @property + def content_size(self) -> Size: + """Get the size of the content area.""" + return self.region.shrink(self.styles.gutter).size + + @property + def region(self) -> Region: + """The region occupied by this widget, relative to the Screen. + + Raises: + NoScreen: If there is no screen. + errors.NoWidget: If the widget is not on the screen. + + Returns: + Region: Region within screen occupied by widget. + """ + try: + return self.screen.find_widget(self).region + except NoScreen: + return Region() + except errors.NoWidget: + return Region() + + @property + def container_viewport(self) -> Region: + """The viewport region (parent window). + + Returns: + Region: The region that contains this widget. + """ + if self.parent is None: + return self.size.region + assert isinstance(self.parent, Widget) + return self.parent.region + + @property + def virtual_region(self) -> Region: + """The widget region relative to it's container. Which may not be visible, + depending on scroll offset. + """ + try: + return self.screen.find_widget(self).virtual_region + except NoScreen: + return Region() + except errors.NoWidget: + return Region() + + @property + def window_region(self) -> Region: + """The region within the scrollable area that is currently visible. + + Returns: + Region: New region. + """ + window_region = self.region.at_offset(self.scroll_offset) + return window_region + + @property + def virtual_region_with_margin(self) -> Region: + """The widget region relative to its container (*including margin*), which may not be visible, + depending on the scroll offset. + + Returns: + Region: The virtual region of the Widget, inclusive of its margin. + """ + return self.virtual_region.grow(self.styles.margin) + + @property + def focusable_children(self) -> list[Widget]: + """Get the children which may be focused. + + Returns: + list[Widget]: List of widgets that can receive focus. + + """ + focusable = [ + child for child in self.children if child.display and child.visible + ] + return sorted(focusable, key=attrgetter("_focus_sort_key")) + + @property + def _focus_sort_key(self) -> tuple[int, int]: + """Key function to sort widgets in to focus order.""" + x, y, _, _ = self.virtual_region + top, _, _, left = self.styles.margin + return y - top, x - left + + @property + def scroll_offset(self) -> Offset: + """Get the current scroll offset. + + Returns: + Offset: Offset a container has been scrolled by. + """ + return Offset(int(self.scroll_x), int(self.scroll_y)) + + @property + def is_transparent(self) -> bool: + """Check if the background styles is not set. + + Returns: + bool: ``True`` if there is background color, otherwise ``False``. + """ + return self.is_scrollable and self.styles.background.is_transparent + + @property + def _console(self) -> Console: + """Get the current console. + + Returns: + Console: A Rich console object. + + """ + return active_app.get().console + + def animate( + self, + attribute: str, + value: float | Animatable, + *, + final_value: object = ..., + duration: float | None = None, + speed: float | None = None, + delay: float = 0.0, + easing: EasingFunction | str = DEFAULT_EASING, + on_complete: CallbackType | None = None, + ) -> None: + """Animate an attribute. + + Args: + attribute (str): Name of the attribute to animate. + value (float | Animatable): The value to animate to. + final_value (object, optional): The final value of the animation. Defaults to `value` if not set. + duration (float | None, optional): The duration of the animate. Defaults to None. + speed (float | None, optional): The speed of the animation. Defaults to None. + delay (float, optional): A delay (in seconds) before the animation starts. Defaults to 0.0. + easing (EasingFunction | str, optional): An easing method. Defaults to "in_out_cubic". + on_complete (CallbackType | None, optional): A callable to invoke when the animation is finished. Defaults to None. + + """ + if self._animate is None: + self._animate = self.app.animator.bind(self) + assert self._animate is not None + self._animate( + attribute, + value, + final_value=final_value, + duration=duration, + speed=speed, + delay=delay, + easing=easing, + on_complete=on_complete, + ) + + @property + def _layout(self) -> Layout: + """Get the layout object if set in styles, or a default layout. + + Returns: + Layout: A layout object. + + """ + return self.styles.layout or self._default_layout + + @property + def is_container(self) -> bool: + """Check if this widget is a container (contains other widgets). + + Returns: + bool: True if this widget is a container. + """ + return self.styles.layout is not None or bool(self.children) + + @property + def is_scrollable(self) -> bool: + """Check if this Widget may be scrolled. + + Returns: + bool: True if this widget may be scrolled. + """ + return self.styles.layout is not None or bool(self.children) + + @property + def layer(self) -> str: + """Get the name of this widgets layer. + + Returns: + str: Name of layer. + + """ + return self.styles.layer or "default" + + @property + def layers(self) -> tuple[str, ...]: + """Layers of from parent. + + Returns: + tuple[str, ...]: Tuple of layer names. + """ + for node in self.ancestors: + if not isinstance(node, Widget): + break + if node.styles.has_rule("layers"): + return node.styles.layers + return ("default",) + + @property + def link_style(self) -> Style: + """Style of links.""" + styles = self.styles + _, background = self.background_colors + link_background = background + styles.link_background + link_color = link_background + ( + link_background.get_contrast_text(styles.link_color.a) + if styles.auto_link_color + else styles.link_color + ) + style = styles.link_style + Style.from_color( + link_color.rich_color, + link_background.rich_color, + ) + return style + + @property + def link_hover_style(self) -> Style: + """Style of links with mouse hover.""" + styles = self.styles + _, background = self.background_colors + hover_background = background + styles.hover_background + hover_color = hover_background + ( + hover_background.get_contrast_text(styles.hover_color.a) + if styles.auto_hover_color + else styles.hover_color + ) + style = styles.hover_style + Style.from_color( + hover_color.rich_color, + hover_background.rich_color, + ) + return style + + def _set_dirty(self, *regions: Region) -> None: + """Set the Widget as 'dirty' (requiring re-paint). + + Regions should be specified as positional args. If no regions are added, then + the entire widget will be considered dirty. + + Args: + *regions (Region): Regions which require a repaint. + + """ + if regions: + content_offset = self.content_offset + widget_regions = [region.translate(content_offset) for region in regions] + self._dirty_regions.update(widget_regions) + self._repaint_regions.update(widget_regions) + self._styles_cache.set_dirty(*widget_regions) + else: + self._dirty_regions.clear() + self._repaint_regions.clear() + self._styles_cache.clear() + self._dirty_regions.add(self.outer_size.region) + self._repaint_regions.add(self.outer_size.region) + + def _exchange_repaint_regions(self) -> Collection[Region]: + """Get a copy of the regions which need a repaint, and clear internal cache. + + Returns: + Collection[Region]: Regions to repaint. + """ + regions = self._repaint_regions.copy() + self._repaint_regions.clear() + return regions + + def scroll_to( + self, + x: float | None = None, + y: float | None = None, + *, + animate: bool = True, + speed: float | None = None, + duration: float | None = None, + ) -> bool: + """Scroll to a given (absolute) coordinate, optionally animating. + + Args: + x (int | None, optional): X coordinate (column) to scroll to, or None for no change. Defaults to None. + y (int | None, optional): Y coordinate (row) to scroll to, or None for no change. Defaults to None. + animate (bool, optional): Animate to new scroll position. Defaults to True. + speed (float | None, optional): Speed of scroll if animate is True. Or None to use duration. + duration (float | None, optional): Duration of animation, if animate is True and speed is None. + + Returns: + bool: True if the scroll position changed, otherwise False. + """ + scrolled_x = scrolled_y = False + if animate: + # TODO: configure animation speed + if duration is None and speed is None: + speed = 50 + if x is not None: + self.scroll_target_x = x + if x != self.scroll_x: + self.animate( + "scroll_x", + self.scroll_target_x, + speed=speed, + duration=duration, + easing="out_cubic", + ) + scrolled_x = True + if y is not None: + self.scroll_target_y = y + if y != self.scroll_y: + self.animate( + "scroll_y", + self.scroll_target_y, + speed=speed, + duration=duration, + easing="out_cubic", + ) + scrolled_y = True + + else: + if x is not None: + scroll_x = self.scroll_x + self.scroll_target_x = self.scroll_x = x + scrolled_x = scroll_x != self.scroll_x + if y is not None: + scroll_y = self.scroll_y + self.scroll_target_y = self.scroll_y = y + scrolled_y = scroll_y != self.scroll_y + + return scrolled_x or scrolled_y + + def scroll_relative( + self, + x: float | None = None, + y: float | None = None, + *, + animate: bool = True, + speed: float | None = None, + duration: float | None = None, + ) -> bool: + """Scroll relative to current position. + + Args: + x (int | None, optional): X distance (columns) to scroll, or ``None`` for no change. Defaults to None. + y (int | None, optional): Y distance (rows) to scroll, or ``None`` for no change. Defaults to None. + animate (bool, optional): Animate to new scroll position. Defaults to False. + speed (float | None, optional): Speed of scroll if animate is True. Or None to use duration. + duration (float | None, optional): Duration of animation, if animate is True and speed is None. + + Returns: + bool: True if the scroll position changed, otherwise False. + """ + return self.scroll_to( + None if x is None else (self.scroll_x + x), + None if y is None else (self.scroll_y + y), + animate=animate, + speed=speed, + duration=duration, + ) + + def scroll_home( + self, + *, + animate: bool = True, + speed: float | None = None, + duration: float | None = None, + ) -> bool: + """Scroll to home position. + + Args: + animate (bool, optional): Animate scroll. Defaults to True. + speed (float | None, optional): Speed of scroll if animate is True. Or None to use duration. + duration (float | None, optional): Duration of animation, if animate is True and speed is None. + + Returns: + bool: True if any scrolling was done. + """ + if speed is None and duration is None: + duration = 1.0 + return self.scroll_to(0, 0, animate=animate, speed=speed, duration=duration) + + def scroll_end( + self, + *, + animate: bool = True, + speed: float | None = None, + duration: float | None = None, + ) -> bool: + """Scroll to the end of the container. + + Args: + animate (bool, optional): Animate scroll. Defaults to True. + speed (float | None, optional): Speed of scroll if animate is True. Or None to use duration. + duration (float | None, optional): Duration of animation, if animate is True and speed is None. + + Returns: + bool: True if any scrolling was done. + + """ + if speed is None and duration is None: + duration = 1.0 + return self.scroll_to( + 0, self.max_scroll_y, animate=animate, speed=speed, duration=duration + ) + + def scroll_left( + self, + *, + animate: bool = True, + speed: float | None = None, + duration: float | None = None, + ) -> bool: + """Scroll one cell left. + + Args: + animate (bool, optional): Animate scroll. Defaults to True. + speed (float | None, optional): Speed of scroll if animate is True. Or None to use duration. + duration (float | None, optional): Duration of animation, if animate is True and speed is None. + + Returns: + bool: True if any scrolling was done. + + """ + return self.scroll_to( + x=self.scroll_target_x - 1, animate=animate, speed=speed, duration=duration + ) + + def scroll_right( + self, + *, + animate: bool = True, + speed: float | None = None, + duration: float | None = None, + ) -> bool: + """Scroll on cell right. + + Args: + animate (bool, optional): Animate scroll. Defaults to True. + speed (float | None, optional): Speed of scroll if animate is True. Or None to use duration. + duration (float | None, optional): Duration of animation, if animate is True and speed is None. + + Returns: + bool: True if any scrolling was done. + + """ + return self.scroll_to( + x=self.scroll_target_x + 1, animate=animate, speed=speed, duration=duration + ) + + def scroll_down( + self, + *, + animate: bool = True, + speed: float | None = None, + duration: float | None = None, + ) -> bool: + """Scroll one line down. + + Args: + animate (bool, optional): Animate scroll. Defaults to True. + speed (float | None, optional): Speed of scroll if animate is True. Or None to use duration. + duration (float | None, optional): Duration of animation, if animate is True and speed is None. + + Returns: + bool: True if any scrolling was done. + + """ + return self.scroll_to( + y=self.scroll_target_y + 1, animate=animate, speed=speed, duration=duration + ) + + def scroll_up( + self, + *, + animate: bool = True, + speed: float | None = None, + duration: float | None = None, + ) -> bool: + """Scroll one line up. + + Args: + animate (bool, optional): Animate scroll. Defaults to True. + speed (float | None, optional): Speed of scroll if animate is True. Or None to use duration. + duration (float | None, optional): Duration of animation, if animate is True and speed is None. + + Returns: + bool: True if any scrolling was done. + + """ + return self.scroll_to( + y=self.scroll_target_y - 1, animate=animate, speed=speed, duration=duration + ) + + def scroll_page_up( + self, + *, + animate: bool = True, + speed: float | None = None, + duration: float | None = None, + ) -> bool: + """Scroll one page up. + + Args: + animate (bool, optional): Animate scroll. Defaults to True. + speed (float | None, optional): Speed of scroll if animate is True. Or None to use duration. + duration (float | None, optional): Duration of animation, if animate is True and speed is None. + + Returns: + bool: True if any scrolling was done. + + """ + return self.scroll_to( + y=self.scroll_target_y - self.container_size.height, + animate=animate, + speed=speed, + duration=duration, + ) + + def scroll_page_down( + self, + *, + animate: bool = True, + speed: float | None = None, + duration: float | None = None, + ) -> bool: + """Scroll one page down. + + Args: + animate (bool, optional): Animate scroll. Defaults to True. + speed (float | None, optional): Speed of scroll if animate is True. Or None to use duration. + duration (float | None, optional): Duration of animation, if animate is True and speed is None. + + Returns: + bool: True if any scrolling was done. + + """ + return self.scroll_to( + y=self.scroll_target_y + self.container_size.height, + animate=animate, + speed=speed, + duration=duration, + ) + + def scroll_page_left( + self, + *, + animate: bool = True, + speed: float | None = None, + duration: float | None = None, + ) -> bool: + """Scroll one page left. + + Args: + animate (bool, optional): Animate scroll. Defaults to True. + speed (float | None, optional): Speed of scroll if animate is True. Or None to use duration. + duration (float | None, optional): Duration of animation, if animate is True and speed is None. + + Returns: + bool: True if any scrolling was done. + + """ + if speed is None and duration is None: + duration = 0.3 + return self.scroll_to( + x=self.scroll_target_x - self.container_size.width, + animate=animate, + speed=speed, + duration=duration, + ) + + def scroll_page_right( + self, + *, + animate: bool = True, + speed: float | None = None, + duration: float | None = None, + ) -> bool: + """Scroll one page right. + + Args: + animate (bool, optional): Animate scroll. Defaults to True. + speed (float | None, optional): Speed of scroll if animate is True. Or None to use duration. + duration (float | None, optional): Duration of animation, if animate is True and speed is None. + + Returns: + bool: True if any scrolling was done. + + """ + if speed is None and duration is None: + duration = 0.3 + return self.scroll_to( + x=self.scroll_target_x + self.container_size.width, + animate=animate, + speed=speed, + duration=duration, + ) + + def scroll_to_widget( + self, + widget: Widget, + *, + animate: bool = True, + speed: float | None = None, + duration: float | None = None, + ) -> bool: + """Scroll scrolling to bring a widget in to view. + + Args: + widget (Widget): A descendant widget. + animate (bool, optional): True to animate, or False to jump. Defaults to True. + speed (float | None, optional): Speed of scroll if animate is True. Or None to use duration. + duration (float | None, optional): Duration of animation, if animate is True and speed is None. + + Returns: + bool: True if any scrolling has occurred in any descendant, otherwise False. + """ + + # Grow the region by the margin so to keep the margin in view. + region = widget.virtual_region_with_margin + scrolled = False + + while isinstance(widget.parent, Widget) and widget is not self: + container = widget.parent + scroll_offset = container.scroll_to_region( + region, + spacing=widget.parent.gutter, + animate=animate, + speed=speed, + duration=duration, + ) + if scroll_offset: + scrolled = True + + # Adjust the region by the amount we just scrolled it, and convert to + # it's parent's virtual coordinate system. + region = ( + ( + region.translate(-scroll_offset) + .translate(-widget.scroll_offset) + .translate(container.virtual_region.offset) + ) + .grow(container.styles.margin) + .intersection(container.virtual_region) + ) + widget = container + return scrolled + + def scroll_to_region( + self, + region: Region, + *, + spacing: Spacing | None = None, + animate: bool = True, + speed: float | None = None, + duration: float | None = None, + ) -> Offset: + """Scrolls a given region in to view, if required. + + This method will scroll the least distance required to move `region` fully within + the scrollable area. + + Args: + region (Region): A region that should be visible. + spacing (Spacing | None, optional): Optional spacing around the region. Defaults to None. + animate (bool, optional): True to animate, or False to jump. Defaults to True. + speed (float | None, optional): Speed of scroll if animate is True. Or None to use duration. + duration (float | None, optional): Duration of animation, if animate is True and speed is None. + + Returns: + Offset: The distance that was scrolled. + """ + window = self.content_region.at_offset(self.scroll_offset) + if spacing is not None: + window = window.shrink(spacing) + + if window in region: + return Offset() + + delta_x, delta_y = Region.get_scroll_to_visible(window, region) + scroll_x, scroll_y = self.scroll_offset + delta = Offset( + clamp(scroll_x + delta_x, 0, self.max_scroll_x) - scroll_x, + clamp(scroll_y + delta_y, 0, self.max_scroll_y) - scroll_y, + ) + if delta: + if speed is None and duration is None: + duration = 0.2 + self.scroll_relative( + delta.x or None, + delta.y or None, + animate=animate if (abs(delta_y) > 1 or delta_x) else False, + speed=speed, + duration=duration, + ) + return delta + + def scroll_visible( + self, + animate: bool = True, + speed: float | None = None, + duration: float | None = None, + ) -> None: + """Scroll the container to make this widget visible. + + Args: + animate (bool, optional): _description_. Defaults to True. + speed (float | None, optional): _description_. Defaults to None. + duration (float | None, optional): _description_. Defaults to None. + """ + parent = self.parent + if isinstance(parent, Widget): + self.call_later( + parent.scroll_to_widget, + self, + animate=animate, + speed=speed, + duration=duration, + ) + + def __init_subclass__( + cls, + can_focus: bool | None = None, + can_focus_children: bool | None = None, + inherit_css: bool = True, + ) -> None: + base = cls.__mro__[0] + super().__init_subclass__(inherit_css=inherit_css) + if issubclass(base, Widget): + cls.can_focus = base.can_focus if can_focus is None else can_focus + cls.can_focus_children = ( + base.can_focus_children + if can_focus_children is None + else can_focus_children + ) + + def __rich_repr__(self) -> rich.repr.Result: + yield "id", self.id, None + if self.name: + yield "name", self.name + if self.classes: + yield "classes", set(self.classes) + pseudo_classes = self.pseudo_classes + if pseudo_classes: + yield "pseudo_classes", set(pseudo_classes) + + def _get_scrollable_region(self, region: Region) -> Region: + """Adjusts the Widget region to accommodate scrollbars. + + Args: + region (Region): A region for the widget. + + Returns: + Region: The widget region minus scrollbars. + """ + show_vertical_scrollbar, show_horizontal_scrollbar = self.scrollbars_enabled + + scrollbar_size_horizontal = self.styles.scrollbar_size_horizontal + scrollbar_size_vertical = self.styles.scrollbar_size_vertical + + if self.styles.scrollbar_gutter == "stable": + # Let's _always_ reserve some space, whether the scrollbar is actually displayed or not: + show_vertical_scrollbar = True + scrollbar_size_vertical = self.styles.scrollbar_size_vertical + + if show_horizontal_scrollbar and show_vertical_scrollbar: + (region, _, _, _) = region.split( + -scrollbar_size_vertical, + -scrollbar_size_horizontal, + ) + elif show_vertical_scrollbar: + region, _ = region.split_vertical(-scrollbar_size_vertical) + elif show_horizontal_scrollbar: + region, _ = region.split_horizontal(-scrollbar_size_horizontal) + return region + + def _arrange_scrollbars(self, region: Region) -> Iterable[tuple[Widget, Region]]: + """Arrange the 'chrome' widgets (typically scrollbars) for a layout element. + + Args: + region (Region): The containing region. + + Returns: + Iterable[tuple[Widget, Region]]: Tuples of scrollbar Widget and region. + + """ + + show_vertical_scrollbar, show_horizontal_scrollbar = self.scrollbars_enabled + + scrollbar_size_horizontal = self.scrollbar_size_horizontal + scrollbar_size_vertical = self.scrollbar_size_vertical + + if show_horizontal_scrollbar and show_vertical_scrollbar: + ( + _, + vertical_scrollbar_region, + horizontal_scrollbar_region, + scrollbar_corner_gap, + ) = region.split( + -scrollbar_size_vertical, + -scrollbar_size_horizontal, + ) + if scrollbar_corner_gap: + yield self.scrollbar_corner, scrollbar_corner_gap + if vertical_scrollbar_region: + yield self.vertical_scrollbar, vertical_scrollbar_region + if horizontal_scrollbar_region: + yield self.horizontal_scrollbar, horizontal_scrollbar_region + + elif show_vertical_scrollbar: + _, scrollbar_region = region.split_vertical(-scrollbar_size_vertical) + if scrollbar_region: + yield self.vertical_scrollbar, scrollbar_region + elif show_horizontal_scrollbar: + _, scrollbar_region = region.split_horizontal(-scrollbar_size_horizontal) + if scrollbar_region: + yield self.horizontal_scrollbar, scrollbar_region + + def get_pseudo_classes(self) -> Iterable[str]: + """Pseudo classes for a widget. + + Returns: + Iterable[str]: Names of the pseudo classes. + + """ + if self.mouse_over: + yield "hover" + if self.has_focus: + yield "focus" + if self.descendant_has_focus: + yield "focus-within" + + def post_render(self, renderable: RenderableType) -> ConsoleRenderable: + """Applies style attributes to the default renderable. + + Returns: + RenderableType: A new renderable. + """ + text_justify: JustifyMethod | None = None + if self.styles.has_rule("text_align"): + text_align: JustifyMethod = cast(JustifyMethod, self.styles.text_align) + text_justify = _JUSTIFY_MAP.get(text_align, text_align) + + if isinstance(renderable, str): + renderable = Text.from_markup(renderable, justify=text_justify) + + if ( + isinstance(renderable, Text) + and text_justify is not None + and renderable.justify is None + ): + renderable.justify = text_justify + + renderable = _Styled( + renderable, self.rich_style, self.link_style if self.auto_links else None + ) + + return renderable + + def watch_mouse_over(self, value: bool) -> None: + """Update from CSS if mouse over state changes.""" + if self._has_hover_style: + self.app.update_styles(self) + + def watch_has_focus(self, value: bool) -> None: + """Update from CSS if has focus state changes.""" + self.app.update_styles(self) + + def _size_updated( + self, size: Size, virtual_size: Size, container_size: Size + ) -> None: + """Called when the widget's size is updated. + + Args: + size (Size): Screen size. + virtual_size (Size): Virtual (scrollable) size. + container_size (Size): Container size (size of parent). + """ + if ( + self._size != size + or self.virtual_size != virtual_size + or self._container_size != container_size + ): + self._size = size + self.virtual_size = virtual_size + self._container_size = container_size + if self.is_scrollable: + self._scroll_update(virtual_size) + self.refresh() + + def _scroll_update(self, virtual_size: Size) -> None: + """Update scrollbars visibility and dimensions. + + Args: + virtual_size (Size): Virtual size. + """ + self._refresh_scrollbars() + width, height = self.container_size + + if self.show_vertical_scrollbar: + self.vertical_scrollbar.window_virtual_size = virtual_size.height + self.vertical_scrollbar.window_size = ( + height - self.scrollbar_size_horizontal + ) + if self.show_horizontal_scrollbar: + self.horizontal_scrollbar.window_virtual_size = virtual_size.width + self.horizontal_scrollbar.window_size = width - self.scrollbar_size_vertical + + self.scroll_x = self.validate_scroll_x(self.scroll_x) + self.scroll_y = self.validate_scroll_y(self.scroll_y) + + def _render_content(self) -> None: + """Render all lines.""" + width, height = self.size + renderable = self.render() + renderable = self.post_render(renderable) + options = self._console.options.update_dimensions(width, height).update( + highlight=False + ) + + segments = self._console.render(renderable, options) + lines = list( + islice( + Segment.split_and_crop_lines( + segments, width, include_new_lines=False, pad=False + ), + None, + height, + ) + ) + + styles = self.styles + align_horizontal, align_vertical = styles.content_align + lines = list( + align_lines( + lines, + Style(), + self.size, + align_horizontal, + align_vertical, + ) + ) + + self._render_cache = RenderCache(self.size, lines) + self._dirty_regions.clear() + + def render_line(self, y: int) -> list[Segment]: + """Render a line of content. + + Args: + y (int): Y Coordinate of line. + + Returns: + list[Segment]: A rendered line. + """ + if self._dirty_regions: + self._render_content() + try: + line = self._render_cache.lines[y] + except IndexError: + line = [Segment(" " * self.size.width, self.rich_style)] + return line + + def render_lines(self, crop: Region) -> Lines: + """Render the widget in to lines. + + Args: + crop (Region): Region within visible area to render. + + Returns: + Lines: A list of list of segments. + """ + lines = self._styles_cache.render_widget(self, crop) + return lines + + def get_style_at(self, x: int, y: int) -> Style: + """Get the Rich style in a widget at a given relative offset. + + Args: + x (int): X coordinate relative to the widget. + y (int): Y coordinate relative to the widget. + + Returns: + Style: A rich Style object. + """ + offset = Offset(x, y) + screen_offset = offset + self.region.offset + + widget, _ = self.screen.get_widget_at(*screen_offset) + if widget is not self: + return Style() + return self.screen.get_style_at(*screen_offset) + + async def _forward_event(self, event: events.Event) -> None: + event._set_forwarded() + await self.post_message(event) + + def refresh( + self, *regions: Region, repaint: bool = True, layout: bool = False + ) -> None: + """Initiate a refresh of the widget. + + This method sets an internal flag to perform a refresh, which will be done on the + next idle event. Only one refresh will be done even if this method is called multiple times. + + By default this method will cause the content of the widget to refresh, but not change its size. You can also + set `layout=True` to perform a layout. + + !!! warning + + It is rarely necessary to call this method explicitly. Updating styles or reactive attributes will + do this automatically. + + Args: + *regions (Region, optional): Additional screen regions to mark as dirty. + repaint (bool, optional): Repaint the widget (will call render() again). Defaults to True. + layout (bool, optional): Also layout widgets in the view. Defaults to False. + """ + + if layout: + self._layout_required = True + if isinstance(self._parent, Widget): + self._parent._clear_arrangement_cache() + + if repaint: + self._set_dirty(*regions) + self._content_width_cache = (None, 0) + self._content_height_cache = (None, 0) + self._rich_style_cache.clear() + self._repaint_required = True + + self.check_idle() + + def remove(self) -> None: + """Remove the Widget from the DOM (effectively deleting it)""" + self.app.post_message_no_wait(events.Remove(self, widget=self)) + + def render(self) -> RenderableType: + """Get renderable for widget. + + Returns: + RenderableType: Any renderable + """ + render = "" if self.is_container else self.css_identifier_styled + return render + + def _render(self) -> ConsoleRenderable | RichCast: + """Get renderable, promoting str to text as required. + + Returns: + ConsoleRenderable | RichCast: A renderable + """ + renderable = self.render() + if isinstance(renderable, str): + return Text(renderable) + return renderable + + async def action(self, action: str) -> None: + """Perform a given action, with this widget as the default namespace. + + Args: + action (str): Action encoded as a string. + """ + await self.app.action(action, self) + + async def post_message(self, message: Message) -> bool: + """Post a message to this widget. + + Args: + message (Message): Message to post. + + Returns: + bool: True if the message was posted, False if this widget was closed / closing. + """ + if not self.check_message_enabled(message): + return True + if not self.is_running: + self.log.warning(self, f"IS NOT RUNNING, {message!r} not sent") + return await super().post_message(message) + + async def _on_idle(self, event: events.Idle) -> None: + """Called when there are no more events on the queue. + + Args: + event (events.Idle): Idle event. + """ + if self._parent is not None and not self._closing: + try: + screen = self.screen + except NoScreen: + pass + else: + if self._repaint_required: + self._repaint_required = False + screen.post_message_no_wait(messages.Update(self, self)) + if self._layout_required: + self._layout_required = False + screen.post_message_no_wait(messages.Layout(self)) + + def focus(self, scroll_visible: bool = True) -> None: + """Give focus to this widget. + + Args: + scroll_visible (bool, optional): Scroll parent to make this widget + visible. Defaults to True. + """ + self.app.set_focus(self, scroll_visible=scroll_visible) + + def capture_mouse(self, capture: bool = True) -> None: + """Capture (or release) the mouse. + + When captured, mouse events will go to this widget even when the pointer is not directly over the widget. + + Args: + capture (bool, optional): True to capture or False to release. Defaults to True. + """ + self.app.capture_mouse(self if capture else None) + + def release_mouse(self) -> None: + """Release the mouse. + + Mouse events will only be sent when the mouse is over the widget. + """ + self.app.capture_mouse(None) + + async def broker_event(self, event_name: str, event: events.Event) -> bool: + return await self.app._broker_event(event_name, event, default_namespace=self) + + def _on_styles_updated(self) -> None: + self._rich_style_cache.clear() + + async def _on_mouse_down(self, event: events.MouseUp) -> None: + await self.broker_event("mouse.down", event) + + async def _on_mouse_up(self, event: events.MouseUp) -> None: + await self.broker_event("mouse.up", event) + + async def _on_click(self, event: events.Click) -> None: + await self.broker_event("click", event) + + async def _on_key(self, event: events.Key) -> None: + await self.handle_key(event) + + async def handle_key(self, event: events.Key) -> bool: + try: + binding = self._bindings.get_key(event.key) + except NoBinding: + return await self.dispatch_key(event) + await self.action(binding.action) + return True + + def _on_compose(self, event: events.Compose) -> None: + widgets = self.compose() + self.app.mount_all(widgets) + + def _on_mount(self, event: events.Mount) -> None: + widgets = self.compose() + self.mount(*widgets) + # Preset scrollbars if not automatic + if self.styles.overflow_y == "scroll": + self.show_vertical_scrollbar = True + if self.styles.overflow_x == "scroll": + self.show_horizontal_scrollbar = True + + def _on_leave(self, event: events.Leave) -> None: + self.mouse_over = False + self.hover_style = Style() + + def _on_enter(self, event: events.Enter) -> None: + self.mouse_over = True + + def _on_focus(self, event: events.Focus) -> None: + self.emit_no_wait(events.DescendantFocus(self)) + self.has_focus = True + self.refresh() + + def _on_blur(self, event: events.Blur) -> None: + self.emit_no_wait(events.DescendantBlur(self)) + self.has_focus = False + self.refresh() + + def _on_descendant_focus(self, event: events.DescendantFocus) -> None: + self.descendant_has_focus = True + if "focus-within" in self.pseudo_classes: + sender = event.sender + for child in self.walk_children(False): + child.refresh() + if child is sender: + break + + def _on_descendant_blur(self, event: events.DescendantBlur) -> None: + self.descendant_has_focus = False + if "focus-within" in self.pseudo_classes: + sender = event.sender + for child in self.walk_children(False): + child.refresh() + if child is sender: + break + + def _on_mouse_scroll_down(self, event) -> None: + if self.allow_vertical_scroll: + if self.scroll_down(animate=False): + event.stop() + + def _on_mouse_scroll_up(self, event) -> None: + if self.allow_vertical_scroll: + if self.scroll_up(animate=False): + event.stop() + + def _on_scroll_to(self, message: ScrollTo) -> None: + if self._allow_scroll: + self.scroll_to(message.x, message.y, animate=message.animate, duration=0.1) + message.stop() + + def _on_scroll_up(self, event: ScrollUp) -> None: + if self.allow_vertical_scroll: + self.scroll_page_up() + event.stop() + + def _on_scroll_down(self, event: ScrollDown) -> None: + if self.allow_vertical_scroll: + self.scroll_page_down() + event.stop() + + def _on_scroll_left(self, event: ScrollLeft) -> None: + if self.allow_horizontal_scroll: + self.scroll_page_left() + event.stop() + + def _on_scroll_right(self, event: ScrollRight) -> None: + if self.allow_horizontal_scroll: + self.scroll_page_right() + event.stop() + + def _on_hide(self, event: events.Hide) -> None: + if self.has_focus: + self.app._reset_focus(self) + + def _on_scroll_to_region(self, message: messages.ScrollToRegion) -> None: + self.scroll_to_region(message.region, animate=True) + + def _key_home(self) -> bool: + if self._allow_scroll: + self.scroll_home() + return True + return False + + def _key_end(self) -> bool: + if self._allow_scroll: + self.scroll_end() + return True + return False + + def _key_left(self) -> bool: + if self.allow_horizontal_scroll: + self.scroll_left() + return True + return False + + def _key_right(self) -> bool: + if self.allow_horizontal_scroll: + self.scroll_right() + return True + return False + + def _key_down(self) -> bool: + if self.allow_vertical_scroll: + self.scroll_down() + return True + return False + + def _key_up(self) -> bool: + if self.allow_vertical_scroll: + self.scroll_up() + return True + return False + + def _key_pagedown(self) -> bool: + if self.allow_vertical_scroll: + self.scroll_page_down() + return True + return False + + def _key_pageup(self) -> bool: + if self.allow_vertical_scroll: + self.scroll_page_up() + return True + return False diff --git a/testbed/Textualize__textual/src/textual/widgets/_footer.py b/testbed/Textualize__textual/src/textual/widgets/_footer.py new file mode 100644 index 0000000000000000000000000000000000000000..e012b96faa1f9dfdccb3106d659d52d4e7e1c08e --- /dev/null +++ b/testbed/Textualize__textual/src/textual/widgets/_footer.py @@ -0,0 +1,112 @@ +from __future__ import annotations + +from rich.console import RenderableType + +from rich.text import Text +import rich.repr + +from .. import events +from ..reactive import Reactive, watch +from ..widget import Widget + + +@rich.repr.auto +class Footer(Widget): + """A simple header widget which docks itself to the top of the parent container.""" + + DEFAULT_CSS = """ + Footer { + background: $accent; + color: $text; + dock: bottom; + height: 1; + } + Footer > .footer--highlight { + background: $accent-darken-1; + } + + Footer > .footer--highlight-key { + background: $secondary; + text-style: bold; + } + + Footer > .footer--key { + text-style: bold; + background: $accent-darken-2; + } + """ + + COMPONENT_CLASSES = { + "footer--description", + "footer--key", + "footer--highlight", + "footer--highlight-key", + } + + def __init__(self) -> None: + super().__init__() + self._key_text: Text | None = None + self.auto_links = False + + highlight_key: Reactive[str | None] = Reactive(None) + + async def watch_highlight_key(self, value) -> None: + """If highlight key changes we need to regenerate the text.""" + self._key_text = None + + def on_mount(self) -> None: + watch(self.app, "focused", self._focus_changed) + + def _focus_changed(self, focused: Widget | None) -> None: + self._key_text = None + self.refresh() + + async def on_mouse_move(self, event: events.MouseMove) -> None: + """Store any key we are moving over.""" + self.highlight_key = event.style.meta.get("key") + + async def on_leave(self, event: events.Leave) -> None: + """Clear any highlight when the mouse leaves the widget""" + self.highlight_key = None + + def __rich_repr__(self) -> rich.repr.Result: + yield from super().__rich_repr__() + + def make_key_text(self) -> Text: + """Create text containing all the keys.""" + base_style = self.rich_style + text = Text( + style=self.rich_style, + no_wrap=True, + overflow="ellipsis", + justify="left", + end="", + ) + highlight_style = self.get_component_rich_style("footer--highlight") + highlight_key_style = self.get_component_rich_style("footer--highlight-key") + key_style = self.get_component_rich_style("footer--key") + for binding in self.app.bindings.shown_keys: + key_display = ( + binding.key.upper() + if binding.key_display is None + else binding.key_display + ) + hovered = self.highlight_key == binding.key + key_text = Text.assemble( + (f" {key_display} ", highlight_key_style if hovered else key_style), + ( + f" {binding.description} ", + highlight_style if hovered else base_style, + ), + meta={"@click": f"app.press('{binding.key}')", "key": binding.key}, + ) + text.append_text(key_text) + return text + + def post_render(self, renderable): + return renderable + + def render(self) -> RenderableType: + if self._key_text is None: + self._key_text = self.make_key_text() + return self._key_text diff --git a/testbed/Textualize__textual/src/textual/widgets/_header.py b/testbed/Textualize__textual/src/textual/widgets/_header.py new file mode 100644 index 0000000000000000000000000000000000000000..b75418a1ab8dac122b7ae0c4a1c5e278b41cb5d6 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/widgets/_header.py @@ -0,0 +1,127 @@ +from __future__ import annotations + +from datetime import datetime + +from rich.text import Text + +from ..widget import Widget +from ..reactive import Reactive, watch + + +class HeaderIcon(Widget): + """Display an 'icon' on the left of the header.""" + + DEFAULT_CSS = """ + HeaderIcon { + dock: left; + padding: 0 1; + width: 8; + content-align: left middle; + } + """ + icon = Reactive("⭘") + + def render(self): + return self.icon + + +class HeaderClock(Widget): + """Display a clock on the right of the header.""" + + DEFAULT_CSS = """ + HeaderClock { + dock: right; + width: 10; + padding: 0 1; + background: $secondary-background-lighten-1; + color: $text; + text-opacity: 85%; + content-align: center middle; + } + """ + + def on_mount(self) -> None: + self.set_interval(1, callback=self.refresh, name=f"update header clock") + + def render(self): + return Text(datetime.now().time().strftime("%X")) + + +class HeaderTitle(Widget): + """Display the title / subtitle in the header.""" + + DEFAULT_CSS = """ + HeaderTitle { + content-align: center middle; + width: 100%; + margin-right: 10; + } + """ + + text: Reactive[str] = Reactive("Hello World") + sub_text = Reactive("Test") + + def render(self) -> Text: + text = Text(self.text, no_wrap=True, overflow="ellipsis") + if self.sub_text: + text.append(" — ") + text.append(self.sub_text, "dim") + return text + + +class Header(Widget): + """A header widget with icon and clock. + + Args: + show_clock (bool, optional): True if the clock should be shown on the right of the header. + """ + + DEFAULT_CSS = """ + Header { + dock: top; + width: 100%; + background: $secondary-background; + color: $text; + height: 1; + } + Header.-tall { + height: 3; + } + """ + + tall = Reactive(True) + + DEFAULT_CLASSES = "-tall" + + def __init__( + self, + show_clock: bool = False, + *, + name: str | None = None, + id: str | None = None, + classes: str | None = None, + ): + super().__init__(name=name, id=id, classes=classes) + self.show_clock = show_clock + + def compose(self): + yield HeaderIcon() + yield HeaderTitle() + if self.show_clock: + yield HeaderClock() + + def watch_tall(self, tall: bool) -> None: + self.set_class(tall, "-tall") + + def on_click(self): + self.toggle_class("-tall") + + def on_mount(self) -> None: + def set_title(title: str) -> None: + self.query_one(HeaderTitle).text = title + + def set_sub_title(sub_title: str) -> None: + self.query_one(HeaderTitle).sub_text = sub_title + + watch(self.app, "title", set_title) + watch(self.app, "sub_title", set_sub_title) diff --git a/testbed/Textualize__textual/src/textual/widgets/_input.py b/testbed/Textualize__textual/src/textual/widgets/_input.py new file mode 100644 index 0000000000000000000000000000000000000000..616844bf2474f330098a23b0ab35aa9adcf7bc26 --- /dev/null +++ b/testbed/Textualize__textual/src/textual/widgets/_input.py @@ -0,0 +1,318 @@ +from __future__ import annotations + +from rich.cells import cell_len, get_character_cell_size +from rich.console import Console, ConsoleOptions, RenderableType, RenderResult +from rich.highlighter import Highlighter +from rich.segment import Segment +from rich.text import Text + +from .. import events +from .._segment_tools import line_crop +from ..binding import Binding +from ..geometry import Size +from ..message import Message +from ..reactive import reactive +from ..widget import Widget + + +class _InputRenderable: + """Render the input content.""" + + def __init__(self, input: Input, cursor_visible: bool) -> None: + self.input = input + self.cursor_visible = cursor_visible + + def __rich_console__( + self, console: "Console", options: "ConsoleOptions" + ) -> "RenderResult": + + input = self.input + result = input._value + if input._cursor_at_end: + result.pad_right(1) + cursor_style = input.get_component_rich_style("input--cursor") + if self.cursor_visible and input.has_focus: + cursor = input.cursor_position + result.stylize(cursor_style, cursor, cursor + 1) + width = input.content_size.width + segments = list(result.render(console)) + line_length = Segment.get_line_length(segments) + if line_length < width: + segments = Segment.adjust_line_length(segments, width) + line_length = width + + line = line_crop( + list(segments), + input.view_position, + input.view_position + width, + line_length, + ) + yield from line + + +class Input(Widget, can_focus=True): + """A text input widget.""" + + DEFAULT_CSS = """ + Input { + background: $boost; + color: $text; + padding: 0 2; + border: tall $background; + width: 100%; + height: 1; + } + Input.-disabled { + opacity: 0.6; + } + Input:focus { + border: tall $accent; + } + Input>.input--cursor { + background: $surface; + color: $text; + text-style: reverse; + } + Input>.input--placeholder { + color: $text-disabled; + } + """ + + BINDINGS = [ + Binding("left", "cursor_left", "cursor left", show=False), + Binding("right", "cursor_right", "cursor right", show=False), + Binding("backspace", "delete_left", "delete left", show=False), + Binding("home", "home", "home", show=False), + Binding("end", "end", "end", show=False), + Binding("ctrl+d", "delete_right", "delete right", show=False), + Binding("enter", "submit", "Submit", show=False), + ] + + COMPONENT_CLASSES = {"input--cursor", "input--placeholder"} + + cursor_blink = reactive(True) + value = reactive("", layout=True) + input_scroll_offset = reactive(0) + cursor_position = reactive(0) + view_position = reactive(0) + placeholder = reactive("") + complete = reactive("") + width = reactive(1) + _cursor_visible = reactive(True) + password = reactive(False) + max_size: reactive[int | None] = reactive(None) + + def __init__( + self, + value: str = "", + placeholder: str = "", + highlighter: Highlighter | None = None, + name: str | None = None, + id: str | None = None, + classes: str | None = None, + ) -> None: + super().__init__(name=name, id=id, classes=classes) + self.value = value + self.placeholder = placeholder + self.highlighter = highlighter + + def _position_to_cell(self, position: int) -> int: + """Convert an index within the value to cell position.""" + cell_offset = cell_len(self.value[:position]) + return cell_offset + + @property + def _cursor_offset(self) -> int: + """Get the cell offset of the cursor.""" + offset = self._position_to_cell(self.cursor_position) + if self._cursor_at_end: + offset += 1 + return offset + + @property + def _cursor_at_end(self) -> bool: + """Check if the cursor is at the end""" + return self.cursor_position >= len(self.value) + + def validate_cursor_position(self, cursor_position: int) -> int: + return min(max(0, cursor_position), len(self.value)) + + def validate_view_position(self, view_position: int) -> int: + width = self.content_size.width + new_view_position = max(0, min(view_position, self.cursor_width - width)) + return new_view_position + + def watch_cursor_position(self, cursor_position: int) -> None: + width = self.content_size.width + view_start = self.view_position + view_end = view_start + width + cursor_offset = self._cursor_offset + + if cursor_offset >= view_end or cursor_offset < view_start: + view_position = cursor_offset - width // 2 + self.view_position = view_position + else: + self.view_position = self.view_position + + async def watch_value(self, value: str) -> None: + if self.styles.auto_dimensions: + self.refresh(layout=True) + await self.emit(self.Changed(self, value)) + + @property + def cursor_width(self) -> int: + """Get the width of the input (with extra space for cursor at the end).""" + if self.placeholder and not self.value: + return cell_len(self.placeholder) + return self._position_to_cell(len(self.value)) + 1 + + def render(self) -> RenderableType: + self.view_position = self.view_position + if not self.value: + placeholder = Text(self.placeholder) + placeholder.stylize(self.get_component_rich_style("input--placeholder")) + if self.has_focus: + cursor_style = self.get_component_rich_style("input--cursor") + if self._cursor_visible: + placeholder.stylize(cursor_style, 0, 1) + return placeholder + return _InputRenderable(self, self._cursor_visible) + + class Changed(Message, bubble=True): + """Value was changed.""" + + def __init__(self, sender: Input, value: str) -> None: + super().__init__(sender) + self.value = value + self.input = sender + + class Submitted(Message, bubble=True): + """Value was updated via enter key or blur.""" + + def __init__(self, sender: Input, value: str) -> None: + super().__init__(sender) + self.value = value + self.input = sender + + @property + def _value(self) -> Text: + """Value rendered as text.""" + if self.password: + return Text("•" * len(self.value), no_wrap=True, overflow="ignore") + else: + text = Text(self.value, no_wrap=True, overflow="ignore") + if self.highlighter is not None: + text = self.highlighter(text) + return text + + def get_content_width(self, container: Size, viewport: Size) -> int: + return self.cursor_width + + def get_content_height(self, container: Size, viewport: Size, width: int) -> int: + return 1 + + def _toggle_cursor(self) -> None: + """Toggle visibility of cursor.""" + self._cursor_visible = not self._cursor_visible + + def on_mount(self) -> None: + self.blink_timer = self.set_interval( + 0.5, + self._toggle_cursor, + pause=not (self.cursor_blink and self.has_focus), + ) + + def on_blur(self) -> None: + self.blink_timer.pause() + + def on_focus(self) -> None: + self.cursor_position = len(self.value) + if self.cursor_blink: + self.blink_timer.resume() + + async def on_key(self, event: events.Key) -> None: + self._cursor_visible = True + if self.cursor_blink: + self.blink_timer.reset() + + # Do key bindings first + if await self.handle_key(event): + event.prevent_default() + event.stop() + return + elif event.is_printable: + event.stop() + assert event.char is not None + self.insert_text_at_cursor(event.char) + event.prevent_default() + + def on_paste(self, event: events.Paste) -> None: + line = event.text.splitlines()[0] + self.insert_text_at_cursor(line) + + def on_click(self, event: events.Click) -> None: + offset = event.get_content_offset(self) + if offset is None: + return + event.stop() + click_x = offset.x + self.view_position + cell_offset = 0 + _cell_size = get_character_cell_size + for index, char in enumerate(self.value): + if cell_offset >= click_x: + self.cursor_position = index + break + cell_offset += _cell_size(char) + else: + self.cursor_position = len(self.value) + + def insert_text_at_cursor(self, text: str) -> None: + """Insert new text at the cursor, move the cursor to the end of the new text. + + Args: + text (str): new text to insert. + """ + if self.cursor_position > len(self.value): + self.value += text + self.cursor_position = len(self.value) + else: + value = self.value + before = value[: self.cursor_position] + after = value[self.cursor_position :] + self.value = f"{before}{text}{after}" + self.cursor_position += len(text) + + def action_cursor_left(self) -> None: + self.cursor_position -= 1 + + def action_cursor_right(self) -> None: + self.cursor_position += 1 + + def action_home(self) -> None: + self.cursor_position = 0 + + def action_end(self) -> None: + self.cursor_position = len(self.value) + + def action_delete_right(self) -> None: + value = self.value + delete_position = self.cursor_position + before = value[:delete_position] + after = value[delete_position + 1 :] + self.value = f"{before}{after}" + self.cursor_position = delete_position + + def action_delete_left(self) -> None: + if self.cursor_position == len(self.value): + self.value = self.value[:-1] + self.cursor_position = len(self.value) + else: + value = self.value + delete_position = self.cursor_position - 1 + before = value[:delete_position] + after = value[delete_position + 1 :] + self.value = f"{before}{after}" + self.cursor_position = delete_position + + async def action_submit(self) -> None: + await self.emit(self.Submitted(self, self.value)) diff --git a/testbed/Textualize__textual/src/textual/widgets/_welcome.py b/testbed/Textualize__textual/src/textual/widgets/_welcome.py new file mode 100644 index 0000000000000000000000000000000000000000..3c8a6d1be911919263f97ad8d4157d72326966bd --- /dev/null +++ b/testbed/Textualize__textual/src/textual/widgets/_welcome.py @@ -0,0 +1,53 @@ +from ..app import ComposeResult +from ._static import Static +from ._button import Button +from ..containers import Container + +from rich.markdown import Markdown + +WELCOME_MD = """\ +# Welcome! + +Textual is a TUI, or *Text User Interface*, framework for Python inspired by modern web development. **We hope you enjoy using Textual!** + +## Dune quote + +> "I must not fear. +Fear is the mind-killer. +Fear is the little-death that brings total obliteration. +I will face my fear. +I will permit it to pass over me and through me. +And when it has gone past, I will turn the inner eye to see its path. +Where the fear has gone there will be nothing. Only I will remain." + +""" + + +class Welcome(Static): + + DEFAULT_CSS = """ + Welcome { + width: 100%; + height: 100%; + background: $surface; + } + + Welcome Container { + padding: 1; + background: $panel; + color: $text; + } + + Welcome #text { + margin: 0 1; + } + + Welcome #close { + dock: bottom; + width: 100%; + } + """ + + def compose(self) -> ComposeResult: + yield Container(Static(Markdown(WELCOME_MD), id="text"), id="md") + yield Button("OK", id="close", variant="success") diff --git a/testbed/Textualize__textual/tests/css/__init__.py b/testbed/Textualize__textual/tests/css/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/testbed/Textualize__textual/tests/css/test_help_text.py b/testbed/Textualize__textual/tests/css/test_help_text.py new file mode 100644 index 0000000000000000000000000000000000000000..928ca2d62412e88a486b52d78bad264455b8b6b4 --- /dev/null +++ b/testbed/Textualize__textual/tests/css/test_help_text.py @@ -0,0 +1,127 @@ +import pytest + +from tests.utilities.render import render +from textual.css._help_text import ( + spacing_wrong_number_of_values_help_text, + spacing_invalid_value_help_text, + scalar_help_text, + string_enum_help_text, + color_property_help_text, + border_property_help_text, + layout_property_help_text, + fractional_property_help_text, + offset_property_help_text, + align_help_text, + offset_single_axis_help_text, + style_flags_property_help_text, +) + + +@pytest.fixture(params=["css", "inline"]) +def styling_context(request): + return request.param + + +def test_help_text_examples_are_contextualized(): + """Ensure that if the user is using CSS, they see CSS-specific examples + and if they're using inline styles they see inline-specific examples.""" + rendered_inline = render(spacing_invalid_value_help_text("padding", "inline")) + assert "widget.styles.padding" in rendered_inline + + rendered_css = render(spacing_invalid_value_help_text("padding", "css")) + assert "padding:" in rendered_css + + +def test_spacing_wrong_number_of_values(styling_context): + rendered = render( + spacing_wrong_number_of_values_help_text("margin", 3, styling_context) + ) + assert "Invalid number of values" in rendered + assert "margin" in rendered + assert "3" in rendered + + +def test_spacing_invalid_value(styling_context): + rendered = render(spacing_invalid_value_help_text("padding", styling_context)) + assert "Invalid value for" in rendered + assert "padding" in rendered + + +def test_scalar_help_text(styling_context): + rendered = render(scalar_help_text("max-width", styling_context)) + assert "Invalid value for" in rendered + + # Ensure property name is contextualised to inline/css styling + if styling_context == "css": + assert "max-width" in rendered + elif styling_context == "inline": + assert "max_width" in rendered + + +def test_string_enum_help_text(styling_context): + rendered = render( + string_enum_help_text("display", ["none", "hidden"], styling_context) + ) + assert "Invalid value for" in rendered + + # Ensure property name is mentioned + assert "display" in rendered + + # Ensure each valid value is mentioned + assert "hidden" in rendered + assert "none" in rendered + + +def test_color_property_help_text(styling_context): + rendered = render(color_property_help_text("background", styling_context)) + assert "Invalid value for" in rendered + assert "background" in rendered + + +def test_border_property_help_text(styling_context): + rendered = render(border_property_help_text("border", styling_context)) + assert "Invalid value for" in rendered + assert "border" in rendered + + +def test_layout_property_help_text(styling_context): + rendered = render(layout_property_help_text("layout", styling_context)) + assert "Invalid value for" in rendered + assert "layout" in rendered + + +def test_fractional_property_help_text(styling_context): + rendered = render(fractional_property_help_text("opacity", styling_context)) + assert "Invalid value for" in rendered + assert "opacity" in rendered + + +def test_offset_property_help_text(styling_context): + rendered = render(offset_property_help_text(styling_context)) + assert "Invalid value for" in rendered + assert "offset" in rendered + + +def test_align_help_text(): + rendered = render(align_help_text()) + assert "Invalid value for" in rendered + assert "align" in rendered + + +def test_offset_single_axis_help_text(): + rendered = render(offset_single_axis_help_text("offset-x")) + assert "Invalid value for" in rendered + assert "offset-x" in rendered + + +def test_style_flags_property_help_text(styling_context): + rendered = render( + style_flags_property_help_text("text-style", "notavalue b", styling_context) + ) + assert "Invalid value" in rendered + assert "notavalue" in rendered + + if styling_context == "css": + assert "text-style" in rendered + else: + assert "text_style" in rendered diff --git a/testbed/Textualize__textual/tests/css/test_parse.py b/testbed/Textualize__textual/tests/css/test_parse.py new file mode 100644 index 0000000000000000000000000000000000000000..fed5db4309a27f424625adb81f0d36b2b0f34f2d --- /dev/null +++ b/testbed/Textualize__textual/tests/css/test_parse.py @@ -0,0 +1,1191 @@ +from __future__ import annotations + +import pytest + +from textual.color import Color +from textual.css.errors import UnresolvedVariableError +from textual.css.parse import substitute_references +from textual.css.scalar import Scalar, Unit +from textual.css.stylesheet import Stylesheet, StylesheetParseError +from textual.css.tokenize import tokenize +from textual.css.tokenizer import Token, ReferencedBy +from textual.css.transition import Transition +from textual.geometry import Spacing +from textual.layouts.vertical import VerticalLayout + + +class TestVariableReferenceSubstitution: + def test_simple_reference(self): + css = "$x: 1; #some-widget{border: $x;}" + variables = substitute_references(tokenize(css, "")) + assert list(variables) == [ + Token( + name="variable_name", + value="$x:", + path="", + code=css, + location=(0, 0), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(0, 3), + referenced_by=None, + ), + Token( + name="number", + value="1", + path="", + code=css, + location=(0, 4), + referenced_by=None, + ), + Token( + name="variable_value_end", + value=";", + path="", + code=css, + location=(0, 5), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(0, 6), + referenced_by=None, + ), + Token( + name="selector_start_id", + value="#some-widget", + path="", + code=css, + location=(0, 7), + referenced_by=None, + ), + Token( + name="declaration_set_start", + value="{", + path="", + code=css, + location=(0, 19), + referenced_by=None, + ), + Token( + name="declaration_name", + value="border:", + path="", + code=css, + location=(0, 20), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(0, 27), + referenced_by=None, + ), + Token( + name="number", + value="1", + path="", + code=css, + location=(0, 4), + referenced_by=ReferencedBy( + name="x", location=(0, 28), length=2, code=css + ), + ), + Token( + name="declaration_end", + value=";", + path="", + code=css, + location=(0, 30), + referenced_by=None, + ), + Token( + name="declaration_set_end", + value="}", + path="", + code=css, + location=(0, 31), + referenced_by=None, + ), + ] + + def test_simple_reference_no_whitespace(self): + css = "$x:1; #some-widget{border: $x;}" + variables = substitute_references(tokenize(css, "")) + assert list(variables) == [ + Token( + name="variable_name", + value="$x:", + path="", + code=css, + location=(0, 0), + referenced_by=None, + ), + Token( + name="number", + value="1", + path="", + code=css, + location=(0, 3), + referenced_by=None, + ), + Token( + name="variable_value_end", + value=";", + path="", + code=css, + location=(0, 4), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(0, 5), + referenced_by=None, + ), + Token( + name="selector_start_id", + value="#some-widget", + path="", + code=css, + location=(0, 6), + referenced_by=None, + ), + Token( + name="declaration_set_start", + value="{", + path="", + code=css, + location=(0, 18), + referenced_by=None, + ), + Token( + name="declaration_name", + value="border:", + path="", + code=css, + location=(0, 19), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(0, 26), + referenced_by=None, + ), + Token( + name="number", + value="1", + path="", + code=css, + location=(0, 3), + referenced_by=ReferencedBy( + name="x", location=(0, 27), length=2, code=css + ), + ), + Token( + name="declaration_end", + value=";", + path="", + code=css, + location=(0, 29), + referenced_by=None, + ), + Token( + name="declaration_set_end", + value="}", + path="", + code=css, + location=(0, 30), + referenced_by=None, + ), + ] + + def test_undefined_variable(self): + css = ".thing { border: $not-defined; }" + with pytest.raises(UnresolvedVariableError): + list(substitute_references(tokenize(css, ""))) + + def test_transitive_reference(self): + css = "$x: 1\n$y: $x\n.thing { border: $y }" + assert list(substitute_references(tokenize(css, ""))) == [ + Token( + name="variable_name", + value="$x:", + path="", + code=css, + location=(0, 0), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(0, 3), + referenced_by=None, + ), + Token( + name="number", + value="1", + path="", + code=css, + location=(0, 4), + referenced_by=None, + ), + Token( + name="variable_value_end", + value="\n", + path="", + code=css, + location=(0, 5), + referenced_by=None, + ), + Token( + name="variable_name", + value="$y:", + path="", + code=css, + location=(1, 0), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(1, 3), + referenced_by=None, + ), + Token( + name="number", + value="1", + path="", + code=css, + location=(0, 4), + referenced_by=ReferencedBy( + name="x", location=(1, 4), length=2, code=css + ), + ), + Token( + name="variable_value_end", + value="\n", + path="", + code=css, + location=(1, 6), + referenced_by=None, + ), + Token( + name="selector_start_class", + value=".thing", + path="", + code=css, + location=(2, 0), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(2, 6), + referenced_by=None, + ), + Token( + name="declaration_set_start", + value="{", + path="", + code=css, + location=(2, 7), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(2, 8), + referenced_by=None, + ), + Token( + name="declaration_name", + value="border:", + path="", + code=css, + location=(2, 9), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(2, 16), + referenced_by=None, + ), + Token( + name="number", + value="1", + path="", + code=css, + location=(0, 4), + referenced_by=ReferencedBy( + name="y", location=(2, 17), length=2, code=css + ), + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(2, 19), + referenced_by=None, + ), + Token( + name="declaration_set_end", + value="}", + path="", + code=css, + location=(2, 20), + referenced_by=None, + ), + ] + + def test_multi_value_variable(self): + css = "$x: 2 4\n$y: 6 $x 2\n.thing { border: $y }" + assert list(substitute_references(tokenize(css, ""))) == [ + Token( + name="variable_name", + value="$x:", + path="", + code=css, + location=(0, 0), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(0, 3), + referenced_by=None, + ), + Token( + name="number", + value="2", + path="", + code=css, + location=(0, 4), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(0, 5), + referenced_by=None, + ), + Token( + name="number", + value="4", + path="", + code=css, + location=(0, 6), + referenced_by=None, + ), + Token( + name="variable_value_end", + value="\n", + path="", + code=css, + location=(0, 7), + referenced_by=None, + ), + Token( + name="variable_name", + value="$y:", + path="", + code=css, + location=(1, 0), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(1, 3), + referenced_by=None, + ), + Token( + name="number", + value="6", + path="", + code=css, + location=(1, 4), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(1, 5), + referenced_by=None, + ), + Token( + name="number", + value="2", + path="", + code=css, + location=(0, 4), + referenced_by=ReferencedBy( + name="x", location=(1, 6), length=2, code=css + ), + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(0, 5), + referenced_by=ReferencedBy( + name="x", location=(1, 6), length=2, code=css + ), + ), + Token( + name="number", + value="4", + path="", + code=css, + location=(0, 6), + referenced_by=ReferencedBy( + name="x", location=(1, 6), length=2, code=css + ), + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(1, 8), + referenced_by=None, + ), + Token( + name="number", + value="2", + path="", + code=css, + location=(1, 9), + referenced_by=None, + ), + Token( + name="variable_value_end", + value="\n", + path="", + code=css, + location=(1, 10), + referenced_by=None, + ), + Token( + name="selector_start_class", + value=".thing", + path="", + code=css, + location=(2, 0), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(2, 6), + referenced_by=None, + ), + Token( + name="declaration_set_start", + value="{", + path="", + code=css, + location=(2, 7), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(2, 8), + referenced_by=None, + ), + Token( + name="declaration_name", + value="border:", + path="", + code=css, + location=(2, 9), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(2, 16), + referenced_by=None, + ), + Token( + name="number", + value="6", + path="", + code=css, + location=(1, 4), + referenced_by=ReferencedBy( + name="y", location=(2, 17), length=2, code=css + ), + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(1, 5), + referenced_by=ReferencedBy( + name="y", location=(2, 17), length=2, code=css + ), + ), + Token( + name="number", + value="2", + path="", + code=css, + location=(0, 4), + referenced_by=ReferencedBy( + name="y", location=(2, 17), length=2, code=css + ), + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(0, 5), + referenced_by=ReferencedBy( + name="y", location=(2, 17), length=2, code=css + ), + ), + Token( + name="number", + value="4", + path="", + code=css, + location=(0, 6), + referenced_by=ReferencedBy( + name="y", location=(2, 17), length=2, code=css + ), + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(1, 8), + referenced_by=ReferencedBy( + name="y", location=(2, 17), length=2, code=css + ), + ), + Token( + name="number", + value="2", + path="", + code=css, + location=(1, 9), + referenced_by=ReferencedBy( + name="y", location=(2, 17), length=2, code=css + ), + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(2, 19), + referenced_by=None, + ), + Token( + name="declaration_set_end", + value="}", + path="", + code=css, + location=(2, 20), + referenced_by=None, + ), + ] + + def test_variable_used_inside_property_value(self): + css = "$x: red\n.thing { border: on $x; }" + assert list(substitute_references(tokenize(css, ""))) == [ + Token( + name="variable_name", + value="$x:", + path="", + code=css, + location=(0, 0), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(0, 3), + referenced_by=None, + ), + Token( + name="token", + value="red", + path="", + code=css, + location=(0, 4), + referenced_by=None, + ), + Token( + name="variable_value_end", + value="\n", + path="", + code=css, + location=(0, 7), + referenced_by=None, + ), + Token( + name="selector_start_class", + value=".thing", + path="", + code=css, + location=(1, 0), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(1, 6), + referenced_by=None, + ), + Token( + name="declaration_set_start", + value="{", + path="", + code=css, + location=(1, 7), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(1, 8), + referenced_by=None, + ), + Token( + name="declaration_name", + value="border:", + path="", + code=css, + location=(1, 9), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(1, 16), + referenced_by=None, + ), + Token( + name="token", + value="on", + path="", + code=css, + location=(1, 17), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(1, 19), + referenced_by=None, + ), + Token( + name="token", + value="red", + path="", + code=css, + location=(0, 4), + referenced_by=ReferencedBy( + name="x", location=(1, 20), length=2, code=css + ), + ), + Token( + name="declaration_end", + value=";", + path="", + code=css, + location=(1, 22), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(1, 23), + referenced_by=None, + ), + Token( + name="declaration_set_end", + value="}", + path="", + code=css, + location=(1, 24), + referenced_by=None, + ), + ] + + def test_variable_definition_eof(self): + css = "$x: 1" + assert list(substitute_references(tokenize(css, ""))) == [ + Token( + name="variable_name", + value="$x:", + path="", + code=css, + location=(0, 0), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(0, 3), + referenced_by=None, + ), + Token( + name="number", + value="1", + path="", + code=css, + location=(0, 4), + referenced_by=None, + ), + ] + + def test_variable_reference_whitespace_trimming(self): + css = "$x: 123;.thing{border: $x}" + assert list(substitute_references(tokenize(css, ""))) == [ + Token( + name="variable_name", + value="$x:", + path="", + code=css, + location=(0, 0), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(0, 3), + referenced_by=None, + ), + Token( + name="number", + value="123", + path="", + code=css, + location=(0, 7), + referenced_by=None, + ), + Token( + name="variable_value_end", + value=";", + path="", + code=css, + location=(0, 10), + referenced_by=None, + ), + Token( + name="selector_start_class", + value=".thing", + path="", + code=css, + location=(0, 11), + referenced_by=None, + ), + Token( + name="declaration_set_start", + value="{", + path="", + code=css, + location=(0, 17), + referenced_by=None, + ), + Token( + name="declaration_name", + value="border:", + path="", + code=css, + location=(0, 18), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(0, 25), + referenced_by=None, + ), + Token( + name="number", + value="123", + path="", + code=css, + location=(0, 7), + referenced_by=ReferencedBy( + name="x", location=(0, 26), length=2, code=css + ), + ), + Token( + name="declaration_set_end", + value="}", + path="", + code=css, + location=(0, 28), + referenced_by=None, + ), + ] + + +class TestParseLayout: + def test_valid_layout_name(self): + css = "#some-widget { layout: vertical; }" + + stylesheet = Stylesheet() + stylesheet.add_source(css) + + styles = stylesheet.rules[0].styles + assert isinstance(styles.layout, VerticalLayout) + + def test_invalid_layout_name(self): + css = "#some-widget { layout: invalidlayout; }" + + stylesheet = Stylesheet() + with pytest.raises(StylesheetParseError) as ex: + stylesheet.add_source(css) + stylesheet.parse() + + assert ex.value.errors is not None + + +class TestParseText: + def test_foreground(self): + css = """#some-widget { + color: green; + } + """ + stylesheet = Stylesheet() + stylesheet.add_source(css) + + styles = stylesheet.rules[0].styles + assert styles.color == Color.parse("green") + + def test_background(self): + css = """#some-widget { + background: red; + } + """ + stylesheet = Stylesheet() + stylesheet.add_source(css) + + styles = stylesheet.rules[0].styles + assert styles.background == Color.parse("red") + + +class TestParseColor: + """More in-depth tests around parsing of CSS colors""" + + @pytest.mark.parametrize( + "value,result", + [ + ("rgb(1,255,50)", Color(1, 255, 50)), + ("rgb( 1, 255,50 )", Color(1, 255, 50)), + ("rgba( 1, 255,50,0.3 )", Color(1, 255, 50, 0.3)), + ("rgba( 1, 255,50, 1.3 )", Color(1, 255, 50, 1.0)), + ("hsl( 180, 50%, 50% )", Color(64, 191, 191)), + ("hsl(180,50%,50%)", Color(64, 191, 191)), + ("hsla(180,50%,50%,0.25)", Color(64, 191, 191, 0.25)), + ("hsla( 180, 50% ,50%,0.25 )", Color(64, 191, 191, 0.25)), + ("hsla( 180, 50% , 50% , 1.5 )", Color(64, 191, 191)), + ], + ) + def test_rgb_and_hsl(self, value, result): + css = f""".box {{ + color: {value}; + }} + """ + stylesheet = Stylesheet() + stylesheet.add_source(css) + + styles = stylesheet.rules[0].styles + assert styles.color == result + + +class TestParseOffset: + @pytest.mark.parametrize( + "offset_x, parsed_x, offset_y, parsed_y", + [ + [ + "-5.5%", + Scalar(-5.5, Unit.PERCENT, Unit.WIDTH), + "-30%", + Scalar(-30, Unit.PERCENT, Unit.HEIGHT), + ], + [ + "5%", + Scalar(5, Unit.PERCENT, Unit.WIDTH), + "40%", + Scalar(40, Unit.PERCENT, Unit.HEIGHT), + ], + [ + "10", + Scalar(10, Unit.CELLS, Unit.WIDTH), + "40", + Scalar(40, Unit.CELLS, Unit.HEIGHT), + ], + ], + ) + def test_composite_rule(self, offset_x, parsed_x, offset_y, parsed_y): + css = f"""#some-widget {{ + offset: {offset_x} {offset_y}; + }} + """ + stylesheet = Stylesheet() + stylesheet.add_source(css) + + styles = stylesheet.rules[0].styles + + assert len(stylesheet.rules) == 1 + assert stylesheet.rules[0].errors == [] + assert styles.offset.x == parsed_x + assert styles.offset.y == parsed_y + + @pytest.mark.parametrize( + "offset_x, parsed_x, offset_y, parsed_y", + [ + [ + "-5.5%", + Scalar(-5.5, Unit.PERCENT, Unit.WIDTH), + "-30%", + Scalar(-30, Unit.PERCENT, Unit.HEIGHT), + ], + [ + "5%", + Scalar(5, Unit.PERCENT, Unit.WIDTH), + "40%", + Scalar(40, Unit.PERCENT, Unit.HEIGHT), + ], + [ + "-10", + Scalar(-10, Unit.CELLS, Unit.WIDTH), + "40", + Scalar(40, Unit.CELLS, Unit.HEIGHT), + ], + ], + ) + def test_separate_rules(self, offset_x, parsed_x, offset_y, parsed_y): + css = f"""#some-widget {{ + offset-x: {offset_x}; + offset-y: {offset_y}; + }} + """ + stylesheet = Stylesheet() + stylesheet.add_source(css) + + styles = stylesheet.rules[0].styles + + assert len(stylesheet.rules) == 1 + assert stylesheet.rules[0].errors == [] + assert styles.offset.x == parsed_x + assert styles.offset.y == parsed_y + + +class TestParseOverflow: + def test_multiple_enum(self): + css = "#some-widget { overflow: hidden auto; }" + stylesheet = Stylesheet() + stylesheet.add_source(css) + + styles = stylesheet.rules[0].styles + + assert len(stylesheet.rules) == 1 + assert styles.overflow_x == "hidden" + assert styles.overflow_y == "auto" + + +class TestParseTransition: + @pytest.mark.parametrize( + "duration, parsed_duration", + [ + ["5.57s", 5.57], + ["0.5s", 0.5], + ["1200ms", 1.2], + ["0.5ms", 0.0005], + ["20", 20.0], + ["0.1", 0.1], + ], + ) + def test_various_duration_formats(self, duration, parsed_duration): + easing = "in_out_cubic" + transition_property = "offset" + delay = duration + css = f"""#some-widget {{ + transition: {transition_property} {duration} {easing} {delay}; + }} + """ + stylesheet = Stylesheet() + stylesheet.add_source(css) + + styles = stylesheet.rules[0].styles + + assert len(stylesheet.rules) == 1 + assert stylesheet.rules[0].errors == [] + assert styles.transitions == { + "offset": Transition( + duration=parsed_duration, easing=easing, delay=parsed_duration + ) + } + + def test_no_delay_specified(self): + css = f"#some-widget {{ transition: offset-x 1 in_out_cubic; }}" + stylesheet = Stylesheet() + stylesheet.add_source(css) + + styles = stylesheet.rules[0].styles + + assert stylesheet.rules[0].errors == [] + assert styles.transitions == { + "offset-x": Transition(duration=1, easing="in_out_cubic", delay=0) + } + + def test_unknown_easing_function(self): + invalid_func_name = "invalid_easing_function" + css = f"#some-widget {{ transition: offset 1 {invalid_func_name} 1; }}" + + stylesheet = Stylesheet() + with pytest.raises(StylesheetParseError) as ex: + stylesheet.add_source(css) + stylesheet.parse() + + rules = stylesheet._parse_rules(css, "foo") + stylesheet_errors = rules[0].errors + + assert len(stylesheet_errors) == 1 + assert stylesheet_errors[0][0].value == invalid_func_name + assert ex.value.errors is not None + + +class TestParseOpacity: + @pytest.mark.parametrize( + "css_value, styles_value", + [ + ["-0.2", 0.0], + ["0.4", 0.4], + ["1.3", 1.0], + ["-20%", 0.0], + ["25%", 0.25], + ["128%", 1.0], + ], + ) + def test_opacity_to_styles(self, css_value, styles_value): + css = f"#some-widget {{ text-opacity: {css_value} }}" + stylesheet = Stylesheet() + stylesheet.add_source(css) + + assert stylesheet.rules[0].styles.text_opacity == styles_value + assert not stylesheet.rules[0].errors + + def test_opacity_invalid_value(self): + css = "#some-widget { text-opacity: 123x }" + stylesheet = Stylesheet() + + with pytest.raises(StylesheetParseError): + stylesheet.add_source(css) + stylesheet.parse() + rules = stylesheet._parse_rules(css, "foo") + assert rules[0].errors + + +class TestParseMargin: + def test_margin_partial(self): + css = "#foo {margin: 1; margin-top: 2; margin-right: 3; margin-bottom: -1;}" + stylesheet = Stylesheet() + stylesheet.add_source(css) + assert stylesheet.rules[0].styles.margin == Spacing(2, 3, -1, 1) + + +class TestParsePadding: + def test_padding_partial(self): + css = "#foo {padding: 1; padding-top: 2; padding-right: 3; padding-bottom: -1;}" + stylesheet = Stylesheet() + stylesheet.add_source(css) + assert stylesheet.rules[0].styles.padding == Spacing(2, 3, -1, 1) + + +class TestParseTextAlign: + @pytest.mark.parametrize( + "valid_align", ["left", "start", "center", "right", "end", "justify"] + ) + def test_text_align(self, valid_align): + css = f"#foo {{ text-align: {valid_align} }}" + stylesheet = Stylesheet() + stylesheet.add_source(css) + assert stylesheet.rules[0].styles.text_align == valid_align + + def test_text_align_invalid(self): + css = "#foo { text-align: invalid-value; }" + stylesheet = Stylesheet() + with pytest.raises(StylesheetParseError): + stylesheet.add_source(css) + stylesheet.parse() + rules = stylesheet._parse_rules(css, "foo") + assert rules[0].errors + + def test_text_align_empty_uses_default(self): + css = "#foo { text-align: ; }" + stylesheet = Stylesheet() + stylesheet.add_source(css) + assert stylesheet.rules[0].styles.text_align == "start" diff --git a/testbed/Textualize__textual/tests/css/test_tokenize.py b/testbed/Textualize__textual/tests/css/test_tokenize.py new file mode 100644 index 0000000000000000000000000000000000000000..1e8593c2cf4453a58ef0bc9c52e9e28f6fb74678 --- /dev/null +++ b/testbed/Textualize__textual/tests/css/test_tokenize.py @@ -0,0 +1,779 @@ +from __future__ import annotations + +import pytest + +from textual.css.tokenize import tokenize +from textual.css.tokenizer import Token, TokenError + +VALID_VARIABLE_NAMES = [ + "warning-text", + "warning_text", + "warningtext1", + "1warningtext", + "WarningText1", + "warningtext_", + "warningtext-", + "_warningtext", + "-warningtext", +] + + +@pytest.mark.parametrize("name", VALID_VARIABLE_NAMES) +def test_variable_declaration_valid_names(name): + css = f"${name}: black on red;" + assert list(tokenize(css, "")) == [ + Token( + name="variable_name", + value=f"${name}:", + path="", + code=css, + location=(0, 0), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(0, 14), + referenced_by=None, + ), + Token( + name="token", + value="black", + path="", + code=css, + location=(0, 15), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(0, 20), + referenced_by=None, + ), + Token( + name="token", + value="on", + path="", + code=css, + location=(0, 21), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(0, 23), + referenced_by=None, + ), + Token( + name="token", + value="red", + path="", + code=css, + location=(0, 24), + referenced_by=None, + ), + Token( + name="variable_value_end", + value=";", + path="", + code=css, + location=(0, 27), + referenced_by=None, + ), + ] + + +def test_variable_declaration_multiple_values(): + css = "$x: 2vw\t4% 6s red;" + assert list(tokenize(css, "")) == [ + Token( + name="variable_name", + value="$x:", + path="", + code=css, + location=(0, 0), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(0, 3), + referenced_by=None, + ), + Token( + name="scalar", + value="2vw", + path="", + code=css, + location=(0, 4), + referenced_by=None, + ), + Token( + name="whitespace", + value="\t", + path="", + code=css, + location=(0, 7), + referenced_by=None, + ), + Token( + name="scalar", + value="4%", + path="", + code=css, + location=(0, 8), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(0, 10), + referenced_by=None, + ), + Token( + name="duration", + value="6s", + path="", + code=css, + location=(0, 11), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(0, 13), + referenced_by=None, + ), + Token( + name="token", + value="red", + path="", + code=css, + location=(0, 15), + referenced_by=None, + ), + Token( + name="variable_value_end", + value=";", + path="", + code=css, + location=(0, 18), + referenced_by=None, + ), + ] + + +def test_variable_declaration_comment_ignored(): + css = "$x: red; /* comment */" + assert list(tokenize(css, "")) == [ + Token( + name="variable_name", + value="$x:", + path="", + code=css, + location=(0, 0), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(0, 3), + referenced_by=None, + ), + Token( + name="token", + value="red", + path="", + code=css, + location=(0, 4), + referenced_by=None, + ), + Token( + name="variable_value_end", + value=";", + path="", + code=css, + location=(0, 7), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(0, 8), + referenced_by=None, + ), + ] + + +def test_variable_declaration_comment_interspersed_ignored(): + css = "$x: re/* comment */d;" + assert list(tokenize(css, "")) == [ + Token( + name="variable_name", + value="$x:", + path="", + code=css, + location=(0, 0), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(0, 3), + referenced_by=None, + ), + Token( + name="token", + value="re", + path="", + code=css, + location=(0, 4), + referenced_by=None, + ), + Token( + name="token", + value="d", + path="", + code=css, + location=(0, 19), + referenced_by=None, + ), + Token( + name="variable_value_end", + value=";", + path="", + code=css, + location=(0, 20), + referenced_by=None, + ), + ] + + +def test_variable_declaration_no_semicolon(): + css = "$x: 1\n$y: 2" + assert list(tokenize(css, "")) == [ + Token( + name="variable_name", + value="$x:", + path="", + code=css, + location=(0, 0), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(0, 3), + referenced_by=None, + ), + Token( + name="number", + value="1", + path="", + code=css, + location=(0, 4), + referenced_by=None, + ), + Token( + name="variable_value_end", + value="\n", + path="", + code=css, + location=(0, 5), + referenced_by=None, + ), + Token( + name="variable_name", + value="$y:", + path="", + code=css, + location=(1, 0), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(1, 3), + referenced_by=None, + ), + Token( + name="number", + value="2", + path="", + code=css, + location=(1, 4), + referenced_by=None, + ), + ] + + +def test_variable_declaration_invalid_value(): + css = "$x:(@$12x)" + with pytest.raises(TokenError): + list(tokenize(css, "")) + + +def test_variables_declarations_amongst_rulesets(): + css = "$x:1; .thing{text:red;} $y:2;" + tokens = list(tokenize(css, "")) + assert tokens == [ + Token( + name="variable_name", + value="$x:", + path="", + code=css, + location=(0, 0), + referenced_by=None, + ), + Token( + name="number", + value="1", + path="", + code=css, + location=(0, 3), + referenced_by=None, + ), + Token( + name="variable_value_end", + value=";", + path="", + code=css, + location=(0, 4), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(0, 5), + referenced_by=None, + ), + Token( + name="selector_start_class", + value=".thing", + path="", + code=css, + location=(0, 6), + referenced_by=None, + ), + Token( + name="declaration_set_start", + value="{", + path="", + code=css, + location=(0, 12), + referenced_by=None, + ), + Token( + name="declaration_name", + value="text:", + path="", + code=css, + location=(0, 13), + referenced_by=None, + ), + Token( + name="token", + value="red", + path="", + code=css, + location=(0, 18), + referenced_by=None, + ), + Token( + name="declaration_end", + value=";", + path="", + code=css, + location=(0, 21), + referenced_by=None, + ), + Token( + name="declaration_set_end", + value="}", + path="", + code=css, + location=(0, 22), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(0, 23), + referenced_by=None, + ), + Token( + name="variable_name", + value="$y:", + path="", + code=css, + location=(0, 24), + referenced_by=None, + ), + Token( + name="number", + value="2", + path="", + code=css, + location=(0, 27), + referenced_by=None, + ), + Token( + name="variable_value_end", + value=";", + path="", + code=css, + location=(0, 28), + referenced_by=None, + ), + ] + + +def test_variables_reference_in_rule_declaration_value(): + css = ".warn{text: $warning;}" + assert list(tokenize(css, "")) == [ + Token( + name="selector_start_class", + value=".warn", + path="", + code=css, + location=(0, 0), + referenced_by=None, + ), + Token( + name="declaration_set_start", + value="{", + path="", + code=css, + location=(0, 5), + referenced_by=None, + ), + Token( + name="declaration_name", + value="text:", + path="", + code=css, + location=(0, 6), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(0, 11), + referenced_by=None, + ), + Token( + name="variable_ref", + value="$warning", + path="", + code=css, + location=(0, 12), + referenced_by=None, + ), + Token( + name="declaration_end", + value=";", + path="", + code=css, + location=(0, 20), + referenced_by=None, + ), + Token( + name="declaration_set_end", + value="}", + path="", + code=css, + location=(0, 21), + referenced_by=None, + ), + ] + + +def test_variables_reference_in_rule_declaration_value_multiple(): + css = ".card{padding: $pad-y $pad-x;}" + assert list(tokenize(css, "")) == [ + Token( + name="selector_start_class", + value=".card", + path="", + code=css, + location=(0, 0), + referenced_by=None, + ), + Token( + name="declaration_set_start", + value="{", + path="", + code=css, + location=(0, 5), + referenced_by=None, + ), + Token( + name="declaration_name", + value="padding:", + path="", + code=css, + location=(0, 6), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(0, 14), + referenced_by=None, + ), + Token( + name="variable_ref", + value="$pad-y", + path="", + code=css, + location=(0, 15), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(0, 21), + referenced_by=None, + ), + Token( + name="variable_ref", + value="$pad-x", + path="", + code=css, + location=(0, 22), + referenced_by=None, + ), + Token( + name="declaration_end", + value=";", + path="", + code=css, + location=(0, 28), + referenced_by=None, + ), + Token( + name="declaration_set_end", + value="}", + path="", + code=css, + location=(0, 29), + referenced_by=None, + ), + ] + + +def test_variables_reference_in_variable_declaration(): + css = "$x: $y;" + assert list(tokenize(css, "")) == [ + Token( + name="variable_name", + value="$x:", + path="", + code=css, + location=(0, 0), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(0, 3), + referenced_by=None, + ), + Token( + name="variable_ref", + value="$y", + path="", + code=css, + location=(0, 4), + referenced_by=None, + ), + Token( + name="variable_value_end", + value=";", + path="", + code=css, + location=(0, 6), + referenced_by=None, + ), + ] + + +def test_variable_references_in_variable_declaration_multiple(): + css = "$x: $y $z\n" + assert list(tokenize(css, "")) == [ + Token( + name="variable_name", + value="$x:", + path="", + code=css, + location=(0, 0), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(0, 3), + referenced_by=None, + ), + Token( + name="variable_ref", + value="$y", + path="", + code=css, + location=(0, 4), + referenced_by=None, + ), + Token( + name="whitespace", + value=" ", + path="", + code=css, + location=(0, 6), + referenced_by=None, + ), + Token( + name="variable_ref", + value="$z", + path="", + code=css, + location=(0, 8), + referenced_by=None, + ), + Token( + name="variable_value_end", + value="\n", + path="", + code=css, + location=(0, 10), + referenced_by=None, + ), + ] + + +def test_allow_new_lines(): + css = ".foo{margin: 1\n1 0 0}" + tokens = list(tokenize(css, "")) + print(repr(tokens)) + expected = [ + Token( + name="selector_start_class", + value=".foo", + path="", + code=".foo{margin: 1\n1 0 0}", + location=(0, 0), + ), + Token( + name="declaration_set_start", + value="{", + path="", + code=".foo{margin: 1\n1 0 0}", + location=(0, 4), + ), + Token( + name="declaration_name", + value="margin:", + path="", + code=".foo{margin: 1\n1 0 0}", + location=(0, 5), + ), + Token( + name="whitespace", + value=" ", + path="", + code=".foo{margin: 1\n1 0 0}", + location=(0, 12), + ), + Token( + name="number", + value="1", + path="", + code=".foo{margin: 1\n1 0 0}", + location=(0, 13), + ), + Token( + name="whitespace", + value="\n", + path="", + code=".foo{margin: 1\n1 0 0}", + location=(0, 14), + ), + Token( + name="number", + value="1", + path="", + code=".foo{margin: 1\n1 0 0}", + location=(1, 0), + ), + Token( + name="whitespace", + value=" ", + path="", + code=".foo{margin: 1\n1 0 0}", + location=(1, 1), + ), + Token( + name="number", + value="0", + path="", + code=".foo{margin: 1\n1 0 0}", + location=(1, 2), + ), + Token( + name="whitespace", + value=" ", + path="", + code=".foo{margin: 1\n1 0 0}", + location=(1, 3), + ), + Token( + name="number", + value="0", + path="", + code=".foo{margin: 1\n1 0 0}", + location=(1, 4), + ), + Token( + name="declaration_set_end", + value="}", + path="", + code=".foo{margin: 1\n1 0 0}", + location=(1, 5), + ), + ] + assert list(tokenize(css, "")) == expected diff --git a/testbed/Textualize__textual/tests/devtools/test_redirect_output.py b/testbed/Textualize__textual/tests/devtools/test_redirect_output.py new file mode 100644 index 0000000000000000000000000000000000000000..fd46599402d54722eddc365f5825b7198407cafd --- /dev/null +++ b/testbed/Textualize__textual/tests/devtools/test_redirect_output.py @@ -0,0 +1,109 @@ +import json +from contextlib import redirect_stdout +from datetime import datetime + +import time_machine + +import msgpack +from textual.devtools.redirect_output import StdoutRedirector + +TIMESTAMP = 1649166819 + + +@time_machine.travel(datetime.utcfromtimestamp(TIMESTAMP)) +async def test_print_redirect_to_devtools_only(devtools): + await devtools._stop_log_queue_processing() + + with redirect_stdout(StdoutRedirector(devtools)): # type: ignore + print("Hello, world!") + + assert devtools.log_queue.qsize() == 1 + + queued_log = await devtools.log_queue.get() + queued_log_data = msgpack.unpackb(queued_log) + print(repr(queued_log_data)) + payload = queued_log_data["payload"] + + assert queued_log_data["type"] == "client_log" + assert payload["timestamp"] == TIMESTAMP + assert ( + payload["segments"] + == b"\x80\x04\x95B\x00\x00\x00\x00\x00\x00\x00]\x94(\x8c\x0crich.segment\x94\x8c\x07Segment\x94\x93\x94\x8c\rHello, world!\x94NN\x87\x94\x81\x94h\x03\x8c\x01\n\x94NN\x87\x94\x81\x94e." + ) + + +async def test_print_redirect_to_logfile_only(devtools): + await devtools.disconnect() + with redirect_stdout(StdoutRedirector(devtools)): # type: ignore + print("Hello, world!") + + +async def test_print_redirect_to_devtools_and_logfile(devtools): + await devtools._stop_log_queue_processing() + + with redirect_stdout(StdoutRedirector(devtools)): # type: ignore + print("Hello, world!") + + assert devtools.log_queue.qsize() == 1 + + +@time_machine.travel(datetime.fromtimestamp(TIMESTAMP)) +async def test_print_without_flush_not_sent_to_devtools(devtools): + await devtools._stop_log_queue_processing() + + with redirect_stdout(StdoutRedirector(devtools)): # type: ignore + # End is no longer newline character, so print will no longer + # flush the output buffer by default. + print("Hello, world!", end="") + + assert devtools.log_queue.qsize() == 0 + + +@time_machine.travel(datetime.fromtimestamp(TIMESTAMP)) +async def test_print_forced_flush_sent_to_devtools(devtools): + await devtools._stop_log_queue_processing() + + with redirect_stdout(StdoutRedirector(devtools)): # type: ignore + print("Hello, world!", end="", flush=True) + + assert devtools.log_queue.qsize() == 1 + + +@time_machine.travel(datetime.fromtimestamp(TIMESTAMP)) +async def test_print_multiple_args_batched_as_one_log(devtools): + await devtools._stop_log_queue_processing() + redirector = StdoutRedirector(devtools) + with redirect_stdout(redirector): # type: ignore + # This print adds 3 messages to the buffer that can be batched + print("The first", "batch", "of logs", end="") + # This message cannot be batched with the previous message, + # and so it will be the 2nd item added to the log queue. + print("I'm in the second batch") + + assert devtools.log_queue.qsize() == 2 + + +@time_machine.travel(datetime.fromtimestamp(TIMESTAMP)) +async def test_print_strings_containing_newline_flushed(devtools): + await devtools._stop_log_queue_processing() + + with redirect_stdout(StdoutRedirector(devtools)): # type: ignore + # Flushing is disabled since end="", but the first + # string will be flushed since it contains a newline + print("Hel\nlo", end="") + print("world", end="") + + assert devtools.log_queue.qsize() == 1 + + +@time_machine.travel(datetime.fromtimestamp(TIMESTAMP)) +async def test_flush_flushes_buffered_logs(devtools): + await devtools._stop_log_queue_processing() + + redirector = StdoutRedirector(devtools) + with redirect_stdout(redirector): # type: ignore + print("x", end="") + + assert devtools.log_queue.qsize() == 0 + redirector.flush() + assert devtools.log_queue.qsize() == 1 diff --git a/testbed/Textualize__textual/tests/layouts/test_common_layout_features.py b/testbed/Textualize__textual/tests/layouts/test_common_layout_features.py new file mode 100644 index 0000000000000000000000000000000000000000..a660c15e89e46ebcce0c4489e24227338b6a19cf --- /dev/null +++ b/testbed/Textualize__textual/tests/layouts/test_common_layout_features.py @@ -0,0 +1,28 @@ +import pytest + +from textual.screen import Screen +from textual.widget import Widget + + +@pytest.mark.parametrize( + "layout,display,expected_in_displayed_children", + [ + ("horizontal", "block", True), + ("vertical", "block", True), + ("horizontal", "none", False), + ("vertical", "none", False), + ], +) +def test_nodes_take_display_property_into_account_when_they_display_their_children( + layout: str, display: str, expected_in_displayed_children: bool +): + widget = Widget(name="widget that might not be visible 🥷 ") + widget.styles.display = display + + screen = Screen() + screen.styles.layout = layout + screen._add_child(widget) + + displayed_children = screen.displayed_children + assert isinstance(displayed_children, list) + assert (widget in screen.displayed_children) is expected_in_displayed_children diff --git a/testbed/Textualize__textual/tests/layouts/test_factory.py b/testbed/Textualize__textual/tests/layouts/test_factory.py new file mode 100644 index 0000000000000000000000000000000000000000..97feb1f5c4bd9c2d78438a13d915dd48d7de819c --- /dev/null +++ b/testbed/Textualize__textual/tests/layouts/test_factory.py @@ -0,0 +1,14 @@ +import pytest + +from textual.layouts.vertical import VerticalLayout +from textual.layouts.factory import get_layout, MissingLayout + + +def test_get_layout_valid_layout(): + layout = get_layout("vertical") + assert type(layout) is VerticalLayout + + +def test_get_layout_invalid_layout(): + with pytest.raises(MissingLayout): + get_layout("invalid") diff --git a/testbed/Textualize__textual/tests/renderables/test_text_opacity.py b/testbed/Textualize__textual/tests/renderables/test_text_opacity.py new file mode 100644 index 0000000000000000000000000000000000000000..b543667ba0be1977ab1bef641518b69c54c6bf9e --- /dev/null +++ b/testbed/Textualize__textual/tests/renderables/test_text_opacity.py @@ -0,0 +1,49 @@ +import pytest +from rich.text import Text + +from tests.utilities.render import render +from textual.renderables.text_opacity import TextOpacity + +STOP = "\x1b[0m" + + +@pytest.fixture +def text(): + return Text("Hello, world!", style="#ff0000 on #00ff00", end="") + + +def test_simple_text_opacity(text): + blended_red_on_green = "\x1b[38;2;127;127;0;48;2;0;255;0m" + assert render(TextOpacity(text, opacity=.5)) == ( + f"{blended_red_on_green}Hello, world!{STOP}" + ) + + +def test_value_zero_doesnt_render_the_text(text): + assert render(TextOpacity(text, opacity=0)) == ( + f"\x1b[48;2;0;255;0m {STOP}" + ) + + +def test_text_opacity_value_of_one_noop(text): + assert render(TextOpacity(text, opacity=1)) == render(text) + + +def test_ansi_colors_noop(): + ansi_colored_text = Text("Hello, world!", style="red on green", end="") + assert render(TextOpacity(ansi_colored_text, opacity=.5)) == render(ansi_colored_text) + + +def test_text_opacity_no_style_noop(): + text_no_style = Text("Hello, world!", end="") + assert render(TextOpacity(text_no_style, opacity=.2)) == render(text_no_style) + + +def test_text_opacity_only_fg_noop(): + text_only_fg = Text("Hello, world!", style="#ff0000", end="") + assert render(TextOpacity(text_only_fg, opacity=.5)) == render(text_only_fg) + + +def test_text_opacity_only_bg_noop(): + text_only_bg = Text("Hello, world!", style="on #ff0000", end="") + assert render(TextOpacity(text_only_bg, opacity=.5)) == render(text_only_bg) diff --git a/testbed/Textualize__textual/tests/snapshot_tests/conftest.py b/testbed/Textualize__textual/tests/snapshot_tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..79b5584b1365cb54101c467591e7f9feca95753e --- /dev/null +++ b/testbed/Textualize__textual/tests/snapshot_tests/conftest.py @@ -0,0 +1,181 @@ +from __future__ import annotations + +import difflib +import os +from dataclasses import dataclass +from datetime import datetime +from operator import attrgetter +from os import PathLike +from pathlib import Path +from typing import Union, List, Optional, Callable, Iterable + +import pytest +from _pytest.config import ExitCode +from _pytest.fixtures import FixtureRequest +from _pytest.main import Session +from _pytest.terminal import TerminalReporter +from jinja2 import Template +from rich.console import Console +from syrupy import SnapshotAssertion + +from textual._doc import take_svg_screenshot +from textual._import_app import import_app +from textual.app import App + +TEXTUAL_SNAPSHOT_SVG_KEY = pytest.StashKey[str]() +TEXTUAL_ACTUAL_SVG_KEY = pytest.StashKey[str]() +TEXTUAL_SNAPSHOT_PASS = pytest.StashKey[bool]() +TEXTUAL_APP_KEY = pytest.StashKey[App]() + + +@pytest.fixture +def snap_compare( + snapshot: SnapshotAssertion, request: FixtureRequest +) -> Callable[[str], bool]: + """ + This fixture returns a function which can be used to compare the output of a Textual + app with the output of the same app in the past. This is snapshot testing, and it + used to catch regressions in output. + """ + + def compare( + app_path: str, + press: Iterable[str] = ("_",), + terminal_size: tuple[int, int] = (24, 80), + ) -> bool: + """ + Compare a current screenshot of the app running at app_path, with + a previously accepted (validated by human) snapshot stored on disk. + When the `--snapshot-update` flag is supplied (provided by syrupy), + the snapshot on disk will be updated to match the current screenshot. + + Args: + app_path (str): The path of the app. + press (Iterable[str]): Key presses to run before taking screenshot. "_" is a short pause. + terminal_size (tuple[int, int]): A pair of integers (rows, columns), representing terminal size. + + Returns: + bool: True if the screenshot matches the snapshot. + """ + node = request.node + app = import_app(app_path) + actual_screenshot = take_svg_screenshot( + app=app, + press=press, + terminal_size=terminal_size, + ) + result = snapshot == actual_screenshot + + if result is False: + # The split and join below is a mad hack, sorry... + node.stash[TEXTUAL_SNAPSHOT_SVG_KEY] = "\n".join(str(snapshot).splitlines()[1:-1]) + node.stash[TEXTUAL_ACTUAL_SVG_KEY] = actual_screenshot + node.stash[TEXTUAL_APP_KEY] = app + else: + node.stash[TEXTUAL_SNAPSHOT_PASS] = True + + return result + + return compare + + +@dataclass +class SvgSnapshotDiff: + """Model representing a diff between current screenshot of an app, + and the snapshot on disk. This is ultimately intended to be used in + a Jinja2 template.""" + snapshot: Optional[str] + actual: Optional[str] + test_name: str + file_similarity: float + path: PathLike + line_number: int + app: App + environment: dict + + +def pytest_sessionfinish( + session: Session, + exitstatus: Union[int, ExitCode], +) -> None: + """Called after whole test run finished, right before returning the exit status to the system. + Generates the snapshot report and writes it to disk. + """ + diffs: List[SvgSnapshotDiff] = [] + num_snapshots_passing = 0 + for item in session.items: + + # Grab the data our fixture attached to the pytest node + num_snapshots_passing += int(item.stash.get(TEXTUAL_SNAPSHOT_PASS, False)) + snapshot_svg = item.stash.get(TEXTUAL_SNAPSHOT_SVG_KEY, None) + actual_svg = item.stash.get(TEXTUAL_ACTUAL_SVG_KEY, None) + app = item.stash.get(TEXTUAL_APP_KEY, None) + + if snapshot_svg and actual_svg and app: + path, line_index, name = item.reportinfo() + diffs.append( + SvgSnapshotDiff( + snapshot=str(snapshot_svg), + actual=str(actual_svg), + file_similarity=100 + * difflib.SequenceMatcher( + a=str(snapshot_svg), b=str(actual_svg) + ).ratio(), + test_name=name, + path=path, + line_number=line_index + 1, + app=app, + environment=dict(os.environ), + ) + ) + + if diffs: + diff_sort_key = attrgetter("file_similarity") + diffs = sorted(diffs, key=diff_sort_key) + + conftest_path = Path(__file__) + snapshot_template_path = ( + conftest_path.parent / "snapshot_report_template.jinja2" + ) + snapshot_report_path_dir = conftest_path.parent / "output" + snapshot_report_path_dir.mkdir(parents=True, exist_ok=True) + snapshot_report_path = snapshot_report_path_dir / "snapshot_report.html" + + template = Template(snapshot_template_path.read_text()) + + num_fails = len(diffs) + num_snapshot_tests = len(diffs) + num_snapshots_passing + + rendered_report = template.render( + diffs=diffs, + passes=num_snapshots_passing, + fails=num_fails, + pass_percentage=100 * (num_snapshots_passing / max(num_snapshot_tests, 1)), + fail_percentage=100 * (num_fails / max(num_snapshot_tests, 1)), + num_snapshot_tests=num_snapshot_tests, + now=datetime.utcnow(), + ) + with open(snapshot_report_path, "w+", encoding="utf-8") as snapshot_file: + snapshot_file.write(rendered_report) + + session.config._textual_snapshots = diffs + session.config._textual_snapshot_html_report = snapshot_report_path + + +def pytest_terminal_summary( + terminalreporter: TerminalReporter, + exitstatus: ExitCode, + config: pytest.Config, +) -> None: + """Add a section to terminal summary reporting. + Displays the link to the snapshot report that was generated in a prior hook. + """ + diffs = getattr(config, "_textual_snapshots", None) + console = Console() + if diffs: + snapshot_report_location = config._textual_snapshot_html_report + console.rule("[b red]Textual Snapshot Report", style="red") + console.print(f"\n[black on red]{len(diffs)} mismatched snapshots[/]\n" + f"\n[b]View the [link=file://{snapshot_report_location}]failure report[/].\n") + console.print(f"[dim]{snapshot_report_location}\n") + console.rule(style="red") diff --git a/testbed/Textualize__textual/tests/utilities/test_app.py b/testbed/Textualize__textual/tests/utilities/test_app.py new file mode 100644 index 0000000000000000000000000000000000000000..545a0210f466efe96b6812c0215170d2b2701231 --- /dev/null +++ b/testbed/Textualize__textual/tests/utilities/test_app.py @@ -0,0 +1,352 @@ +from __future__ import annotations + +import asyncio +import contextlib +import io +from math import ceil +from pathlib import Path +from time import monotonic +from typing import AsyncContextManager, cast, ContextManager +from unittest import mock + +from rich.console import Console + +from textual import events, errors +from textual._ansi_sequences import SYNC_START +from textual._clock import _Clock +from textual.app import WINDOWS +from textual._context import active_app +from textual.app import App, ComposeResult +from textual.driver import Driver +from textual.geometry import Size, Region + +# N.B. These classes would better be named TestApp/TestConsole/TestDriver/etc, +# but it makes pytest emit warning as it will try to collect them as classes containing test cases :-/ + + +class AppTest(App): + def __init__(self, *, test_name: str, size: Size): + # Tests will log in "/tests/test.[test name].log": + log_path = Path(__file__).parent.parent / f"test.{test_name}.log" + super().__init__( + driver_class=DriverTest, + ) + + # Let's disable all features by default + self.features = frozenset() + + # We need this so the "start buffeting"` is always sent for a screen refresh, + # whatever the environment: + # (we use it to slice the output into distinct full screens displays) + self._sync_available = True + + self._size = size + self._console = ConsoleTest(width=size.width, height=size.height) + self._error_console = ConsoleTest(width=size.width, height=size.height) + + def log_tree(self) -> None: + """Handy shortcut when testing stuff""" + self.log(self.tree) + + def compose(self) -> ComposeResult: + raise NotImplementedError( + "Create a subclass of TestApp and override its `compose()` method, rather than using TestApp directly" + ) + + def in_running_state( + self, + *, + time_mocking_ticks_granularity_fps: int = 60, # i.e. when moving forward by 1 second we'll do it though 60 ticks + waiting_duration_after_initialisation: float = 1, + waiting_duration_after_yield: float = 0, + ) -> AsyncContextManager[ClockMock]: + async def run_app() -> None: + await self._process_messages() + + @contextlib.asynccontextmanager + async def get_running_state_context_manager(): + with mock_textual_timers( + ticks_granularity_fps=time_mocking_ticks_granularity_fps + ) as clock_mock: + run_task = asyncio.create_task(run_app()) + + # We have to do this because `run_app()` is running in its own async task, and our test is going to + # run in this one - so the app must also be the active App in our current context: + self._set_active() + + await clock_mock.advance_clock(waiting_duration_after_initialisation) + # make sure the App has entered its main loop at this stage: + assert self._driver is not None + + await self.force_full_screen_update() + + # And now it's time to pass the torch on to the test function! + # We provide the `move_clock_forward` function to it, + # so it can also do some time-based Textual stuff if it needs to: + yield clock_mock + + await clock_mock.advance_clock(waiting_duration_after_yield) + + # Make sure our screen is up-to-date before exiting the context manager, + # so tests using our `last_display_capture` for example can assert things on a fully refreshed screen: + await self.force_full_screen_update() + + # End of simulated time: we just shut down ourselves: + assert not run_task.done() + await self.shutdown() + await run_task + + return get_running_state_context_manager() + + async def boot_and_shutdown( + self, + *, + waiting_duration_after_initialisation: float = 0.001, + waiting_duration_before_shutdown: float = 0, + ): + """Just a commodity shortcut for `async with app.in_running_state(): pass`, for simple cases""" + async with self.in_running_state( + waiting_duration_after_initialisation=waiting_duration_after_initialisation, + waiting_duration_after_yield=waiting_duration_before_shutdown, + ): + pass + + def get_char_at(self, x: int, y: int) -> str: + """Get the character at the given cell or empty string + + Args: + x (int): X position within the Layout + y (int): Y position within the Layout + + Returns: + str: The character at the cell (x, y) within the Layout + """ + # N.B. Basically a copy-paste-and-slightly-adapt of `Compositor.get_style_at()` + try: + widget, region = self.get_widget_at(x, y) + except errors.NoWidget: + return "" + if widget not in self.screen._compositor.visible_widgets: + return "" + + x -= region.x + y -= region.y + lines = widget.render_lines(Region(0, y, region.width, 1)) + if not lines: + return "" + end = 0 + for segment in lines[0]: + end += segment.cell_length + if x < end: + return segment.text[0] + return "" + + async def force_full_screen_update( + self, *, repaint: bool = True, layout: bool = True + ) -> None: + try: + screen = self.screen + except IndexError: + return # the app may not have a screen yet + + # We artificially tell the Compositor that the whole area should be refreshed + screen._compositor._dirty_regions = { + Region(0, 0, screen.outer_size.width, screen.outer_size.height), + } + screen.refresh(repaint=repaint, layout=layout) + # We also have to make sure we have at least one dirty widget, or `screen._on_update()` will early return: + screen._dirty_widgets.add(screen) + screen._on_timer_update() + + await let_asyncio_process_some_events() + + def _handle_exception(self, error: Exception) -> None: + # In tests we want the errors to be raised, rather than printed to a Console + raise error + + def run(self): + raise NotImplementedError( + "Use `async with my_test_app.in_running_state()` rather than `my_test_app.run()`" + ) + + @property + def active_app(self) -> App | None: + return active_app.get() + + @property + def total_capture(self) -> str | None: + return self.console.file.getvalue() + + @property + def last_display_capture(self) -> str | None: + total_capture = self.total_capture + if not total_capture: + return None + screen_captures = total_capture.split(SYNC_START) + for single_screen_capture in reversed(screen_captures): + if len(single_screen_capture) > 30: + # let's return the last occurrence of a screen that seem to be properly "fully-paint" + return single_screen_capture + return None + + @property + def console(self) -> ConsoleTest: + return self._console + + @console.setter + def console(self, console: Console) -> None: + """This is a no-op, the console is always a TestConsole""" + return + + @property + def error_console(self) -> ConsoleTest: + return self._error_console + + @error_console.setter + def error_console(self, console: Console) -> None: + """This is a no-op, the error console is always a TestConsole""" + return + + +class ConsoleTest(Console): + def __init__(self, *, width: int, height: int): + file = io.StringIO() + super().__init__( + color_system="256", + file=file, + width=width, + height=height, + force_terminal=False, + legacy_windows=False, + ) + + @property + def file(self) -> io.StringIO: + return cast(io.StringIO, self._file) + + @property + def is_dumb_terminal(self) -> bool: + return False + + +class DriverTest(Driver): + def start_application_mode(self) -> None: + size = Size(self.console.size.width, self.console.size.height) + event = events.Resize(self._target, size, size) + asyncio.run_coroutine_threadsafe( + self._target.post_message(event), + loop=asyncio.get_running_loop(), + ) + + def disable_input(self) -> None: + pass + + def stop_application_mode(self) -> None: + pass + + +# It seems that we have to give _way more_ time to `asyncio` on Windows in order to see our different awaiters +# properly triggered when we pause our own "move clock forward" loop. +# It could be caused by the fact that the time resolution for `asyncio` on this platform seems rather low: +# > The resolution of the monotonic clock on Windows is usually around 15.6 msec. +# > The best resolution is 0.5 msec. +# @link https://docs.python.org/3/library/asyncio-platforms.html: +ASYNCIO_EVENTS_PROCESSING_REQUIRED_PERIOD = 0.025 if WINDOWS else 0.005 + + +async def let_asyncio_process_some_events() -> None: + await asyncio.sleep(ASYNCIO_EVENTS_PROCESSING_REQUIRED_PERIOD) + + +class ClockMock(_Clock): + # To avoid issues with floats we will store the current time as an integer internally. + # Tenths of microseconds should be a good enough granularity: + TIME_RESOLUTION = 10_000_000 + + def __init__( + self, + *, + ticks_granularity_fps: int = 60, + ): + self._ticks_granularity_fps = ticks_granularity_fps + self._single_tick_duration = int(self.TIME_RESOLUTION / ticks_granularity_fps) + self._start_time: int = -1 + self._current_time: int = -1 + # For each call to our `sleep` method we will store an asyncio.Event + # and the time at which we should trigger it: + self._pending_sleep_events: dict[int, list[asyncio.Event]] = {} + + def get_time_no_wait(self) -> float: + if self._current_time == -1: + self._start_clock() + + return self._current_time / self.TIME_RESOLUTION + + async def sleep(self, seconds: float) -> None: + event = asyncio.Event() + internal_waiting_duration = int(seconds * self.TIME_RESOLUTION) + target_event_monotonic_time = self._current_time + internal_waiting_duration + self._pending_sleep_events.setdefault(target_event_monotonic_time, []).append( + event + ) + # Ok, let's wait for this Event + # (which can only be "unlocked" by calls to `advance_clock()`) + await event.wait() + + async def advance_clock(self, seconds: float) -> None: + """ + Artificially advance the Textual clock forward. + + Args: + seconds: for each second we will artificially tick `ticks_granularity_fps` times + """ + if self._current_time == -1: + self._start_clock() + + ticks_count = ceil(seconds * self._ticks_granularity_fps) + activated_timers_count_total = 0 # useful when debugging this code :-) + for tick_counter in range(ticks_count): + self._current_time += self._single_tick_duration + activated_timers_count = self._check_sleep_timers_to_activate() + activated_timers_count_total += activated_timers_count + # Now that we likely unlocked some occurrences of `await sleep(duration)`, + # let's give an opportunity to asyncio-related stuff to happen: + if activated_timers_count: + await let_asyncio_process_some_events() + + await let_asyncio_process_some_events() + + def _start_clock(self) -> None: + # N.B. `start_time` is not actually used, but it is useful to have when we set breakpoints there :-) + self._start_time = self._current_time = int(monotonic() * self.TIME_RESOLUTION) + + def _check_sleep_timers_to_activate(self) -> int: + activated_timers_count = 0 + activated_events_times_to_clear: list[int] = [] + for (monotonic_time, target_events) in self._pending_sleep_events.items(): + if self._current_time < monotonic_time: + continue # not time for you yet, dear awaiter... + # Right, let's release these waiting events! + for event in target_events: + event.set() + activated_timers_count += len(target_events) + # ...and let's mark it for removal: + activated_events_times_to_clear.append(monotonic_time) + + for event_time_to_clear in activated_events_times_to_clear: + del self._pending_sleep_events[event_time_to_clear] + + return activated_timers_count + + +def mock_textual_timers( + *, + ticks_granularity_fps: int = 60, +) -> ContextManager[ClockMock]: + @contextlib.contextmanager + def mock_textual_timers_context_manager(): + clock_mock = ClockMock(ticks_granularity_fps=ticks_granularity_fps) + with mock.patch("textual._clock._clock", new=clock_mock): + yield clock_mock + + return mock_textual_timers_context_manager()