Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

third_party/spiro looks to be not compatible with python3 #501

Open
pacho2 opened this issue Dec 15, 2019 · 10 comments
Open

third_party/spiro looks to be not compatible with python3 #501

pacho2 opened this issue Dec 15, 2019 · 10 comments

Comments

@pacho2
Copy link

pacho2 commented Dec 15, 2019

I am trying latest git with python3 support, but, at install time, I see lots of errors like this that look to show that third_party/spiro is not yet ready for python3

Installing notodiff script to /var/tmp/portage/dev-python/nototools-20191107/image/_python3.7/usr/lib/python-exec/python3.7
  File "/usr/lib/python3.7/site-packages/third_party/spiro/x3/pyrex/main.py", line 4
    print cmd, what, arg
            ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(cmd, what, arg)?

  File "/usr/lib/python3.7/site-packages/third_party/spiro/x3/pyrex/beztest.py", line 5
    print cmd, what, arg
            ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(cmd, what, arg)?

  File "/usr/lib/python3.7/site-packages/third_party/spiro/font/replace_class.py", line 14
    print fn, table[clas]
           ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(fn, table[clas])?

  File "/usr/lib/python3.7/site-packages/third_party/spiro/font/mkblends.py", line 14
    print cmd
            ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(cmd)?

Sorry: TabError: inconsistent use of tabs and spaces in indentation (tocubic.py, line 63)
  File "/usr/lib/python3.7/site-packages/third_party/spiro/curves/polymat.py", line 57
    print '%6.1f' % m[j][i],
                ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('%6.1f' % m[j][i], end=" ")?

  File "/usr/lib/python3.7/site-packages/third_party/spiro/curves/polymat-bad.py", line 53
    print '%6.1f' % m[j][i],
                ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('%6.1f' % m[j][i], end=" ")?

  File "/usr/lib/python3.7/site-packages/third_party/spiro/curves/poly3.py", line 85
    print 306 + 300 * x, 400 + 300 * y, cmd
            ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(306 + 300 * x, 400 + 300 * y, cmd)?

  File "/usr/lib/python3.7/site-packages/third_party/spiro/curves/plot_solve_clothoid.py", line 4
    print '%!PS-Adobe'
                     ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('%!PS-Adobe')?

  File "/usr/lib/python3.7/site-packages/third_party/spiro/curves/pcorn.py", line 16
    return '[' + `self.z0` + `self.z1` + ' ' + `self.th0` + ' ' + `self.th1` + ']'
                 ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.7/site-packages/third_party/spiro/curves/numintsynth.py", line 40
    print str, '\\\\'
            ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(str, '\\\\')?

  File "/usr/lib/python3.7/site-packages/third_party/spiro/curves/mvc.py", line 27
    if do_print: print 400 + 400 * x, 500 + 400 * y, cmd
                         ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(400 + 400 * x, 500 + 400 * y, cmd)?

  File "/usr/lib/python3.7/site-packages/third_party/spiro/curves/mecsolve.py", line 10
    print '%!PS-Adobe-3.0 EPSF'
                              ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('%!PS-Adobe-3.0 EPSF')?

  File "/usr/lib/python3.7/site-packages/third_party/spiro/curves/fromcubic.py", line 40
    print 'stroke'
                 ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('stroke')?

  File "/usr/lib/python3.7/site-packages/third_party/spiro/curves/euler-elastica.py", line 15
    print 6 + s * x, 200 + s * y, cmd
          ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(6 + s * x, 200 + s * y, cmd)?

  File "/usr/lib/python3.7/site-packages/third_party/spiro/curves/clothoid.py", line 46
    print k0, k1, error
           ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(k0, k1, error)?

  File "/usr/lib/python3.7/site-packages/third_party/spiro/curves/bigmat.py", line 135
    print a
          ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(a)?

  File "/usr/lib/python3.7/site-packages/third_party/spiro/curves/bezfigs.py", line 10
    print '%!PS-Adobe-3.0 EPSF'
                              ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('%!PS-Adobe-3.0 EPSF')?

  File "/usr/lib/python3.7/site-packages/third_party/spiro/curves/band.py", line 77
    print a
          ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(a)?

  File "/usr/lib/python3.7/site-packages/third_party/fontcrunch/fontcrunch.py", line 77
    print '/ss 1.5 def'
                      ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('/ss 1.5 def')?

Thanks

@devurandom
Copy link

Please add ``` quotes to make the backtrace more readable.

@ghost
Copy link

ghost commented Dec 29, 2019

I'm working on this and will start a PR soon...

@ghost
Copy link

ghost commented Jan 9, 2020

#502

@penguinolog
Copy link
Contributor

Pure python code: fixed
PYX: need validation with compilation

@anthrotype
Copy link
Contributor

this code is very old, and it should probably live somewhere else. Is it used anywhere?

@anthrotype
Copy link
Contributor

Ah yes, it's used in fontcrunch. We should think about whether it's better to split those up to a separate repository. /cc @davelab6 @marekjez86

@penguinolog
Copy link
Contributor

Fontcrunch uses only spiro.curves, so IMHO, if nothing else is used from spiro - it's cheaper to drop (code is extremely old and without usage it became in unknown, probably broken, state)

@anthrotype
Copy link
Contributor

my next question would be, where is fontcrunch used? what does it have to do with noto?

@penguinolog
Copy link
Contributor

Search points, that only

clothoid.py  cornu.py  fromcubic.py  pcorn.py  tocubic.py

is used from spiro.curves

@penguinolog
Copy link
Contributor

penguinolog commented Jan 23, 2020

fontcrunch is not used directly in nototools (grep show zero usages) and it is available as separate package with separate repo (and 2 years newer, but still old code)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants