* Refactor type checks defined in APIs
* Remove dead/deprecated kwargs usages
* Added appropriate hints to APIs and consecutive utils defined in the following modules:
- frappe.realtime
- frappe.translate
- frappe.utils.global_search
- frappe.www.third_party_apps
- frappe.www.search
- frappe.www.printview
refactor: clean up code to py39+ supported syntax
- f-strings instead of format
- latest typing support instead of pre 3.9 TitleCase
- remove UTF-8 declarations.
- many more changes
Powered by https://github.com/asottile/pyupgrade/ + manual cleanups
The license.txt file has been replaced with LICENSE for quite a while
now. INAL but it didn't seem accurate to say "hey, checkout license.txt
although there's no such file". Apart from this, there were
inconsistencies in the headers altogether...this change brings
consistency.
* Remove six for PY2 compatability since our dependencies are not, PY2
is legacy.
* Removed usages of utils from future/past libraries since they are
deprecated. This includes 'from __future__ ...' and 'from past...'
statements.
* Removed compatibility imports for PY2, switched from six imports to
standard library imports.
* Removed utils code blocks that handle operations depending on PY2/3
versions.
* Removed 'from __future__ ...' lines from templates/code generators
* Used PY3 syntaxes in place of PY2 compatible blocks. eg: metaclass
On mobile view, window.close would block rendering the print view.
Increasing the timeout to 10s from 1s helps
(cherry picked from commit b341167ffc37b1b93bdf1d712406c1d730746fd6)
Python 3 interprets string literals as Unicode strings, and therefore \( is treated as an escaped Unicode character.
Declare RegEx pattern as a raw string instead by prepending r
* Added Pashto language to the rtl list.
Pashto (ps) writing is based on Arabic script, so it is a right to left language. Therefore, added the "ps" to the rtl languages list in the following line of code.
is_rtl(lang=null) {
return ["ar", "he", "fa", "ps"].includes(lang || frappe.boot.lang);
}
* fix: ps to rtl languages list in printview.py