tobimensch / cli2man

Converts the help message of a program into a manpage
25 stars 8 forks source link

python3 support #8

Closed JOJ0 closed 4 years ago

JOJ0 commented 4 years ago

Hi again, cli2man runs perfectly with Python2.7.x but I get a syntax error when invoking with Python3.7.x. Eg. you are using a syntax for the print statement that is not supported anymore:

print "foo" instead of print("foo")

just sayin because I didn't find a statement in your README which Python version is required :-) HTH Jojo

tobimensch commented 4 years ago

Hmm, I thought I had fixed the code for python3 support. Apparently not fully.

Could you make a pull request for the change you made?

tobimensch commented 4 years ago

Where exactly in the code did you find a print statement that was not python3 compatible?

I have fixed that a few years ago and I don't see any! Please when you make bug reports always post full error messages and if you change a line to fix something, post the line number for it!

You are making me lose time.

JOJ0 commented 4 years ago

Sorry mister, I didn't want to "make you loose time"......there you go:

It seems like you fixed this in the master but didn't release it on PyPI.

I installed this version using pip:

$ pip show cli2man | grep -i version
Metadata-Version: 1.0
Version: 0.2.4
$ cli2man --version
0.2.4
which cli2man
/usr/local/bin/cli2man

this is the lines

$ grep -in 'print "' /usr/local/bin/cli2man
481:        #    print "['"+p+"']"
492:    print "--------------------"
494:    print "____________________"
553:        print "begin section stub"
555:        print "begin list stub"
557:        print "end list stub"
559:        print "date stub"
561:        print "document stub"
563:        print "os stub"
565:        print "name stub"
567:        print "description stub"
569:        print "synopsis stub"
574:        print "paragraph stub"
812:        #print "tree:___"
1015:            #    print "['"+p+"']"
1035:            #    print "['"+p+"']"
1241:    print "Section Order:"
1242:    print "____________________"
1246:        print "  "+section
1247:    print "____________________"
1249:    print "  --set-order \""+(','.join(manual.section_order[1:])+"\"")
1250:    print "____________________"
1252:    print "NOTE: You can use this string as basis for modifying the section order."
1254:    print "Copy it and keep the quotation marks, so that whitespace won't cause trouble."
1256:    print "Sections added with --info-section and --option-section are automatically appended"
1257:    print "to the end of the manpage, if they aren't otherwise defined in your order settings."
1259:    print "Sections defined in an --include mdoc file that aren't defined in the section order,"
1260:    print "will NOT appear in the manpage AT ALL."
1348:            print "Usage error: when --output=auto is set you have to specify the <command>"

HTH Jojo

JOJ0 commented 4 years ago

Hmm, I thought I had fixed the code for python3 support. Apparently not fully.

Could you make a pull request for the change you made?

I didn't make a change, I just wanted to report. I did my homework and read somewhere that you fixed python3 support quite some time ago already. That's why i was curious why my version is not fixed.

I worked around the problem and just used your tool with python2 to get going with my manpage project, which now is finished already.

JOJ0 commented 4 years ago

Hi apologies for not getting back to you earlier. I did some testing with the version you have on git master branch. It is working with Python 3. As stated already: The version you released on PyPI is broken and should be fixed. Thanks for your time! Appreciated.

tobimensch commented 4 years ago

@JOJ0 True. I should update it on PyPI.