grumpyhome / grumpy

Grumpy is a Python to Go source code transcompiler and runtime.
Apache License 2.0
420 stars 18 forks source link

add c variant for old str formatting #130

Closed andgrew closed 5 years ago

andgrew commented 5 years ago

Its important for example for: print(datetime.now()) And may be checked in this way: "%c" % 107 # gives letter 'k' and this: "%c" % "k" # gives letter 'k' too

andgrew commented 5 years ago

I see, that it fails. Thinking its due to a different text editor settings. But cant check it locally now. Command 'python setup.py develop' fails with message 'unsupported Go version , Grumpy requires at least 1.9...'. But my go version is go1.10.3 linux/amd64.

alanjds commented 5 years ago

I see, that it fails.

Yeah, but is about formating: gofmt is a bit picky, but can fix the code for you: https://travis-ci.org/grumpyhome/grumpy/jobs/463174672#L847

gofmt found errors, run: gofmt -w /home/travis/gopath/src/github.com/grumpyhome/grumpy/grumpy-runtime-src/runtime/*.go

Just run the provided line gofmt -w grumpy-runtime-src/runtime/*.go and it should fix.

Command 'python setup.py develop' fails with message 'unsupported Go version , Grumpy requires at least 1.9...'. But my go version is go1.10.3 linux/amd64.

Strange. What linux are you using? How you installed Go? Can you please share the output of $ which go; go version; env | grep GO ?

andgrew commented 5 years ago

Yes, I wanted to add a test. I got it how the tests work. I'm running on another system now. Further I will understand, why I had problem in windows linux subsystem (Debian).

alanjds commented 5 years ago

Thanks for the test.

I wanted to explore the Windows Linux Subsystem too. Good to know that it messed with your Go versions.

In theory it should work and no Windows port would be needed at all, but lets see...