[issue514627] pydoc fails to generate html doc

2022-04-10 Thread admin


Change by admin :


--
github: None -> 36046

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46736] Generate HTML 5 with SimpleHTTPRequestHandler.list_directory

2022-02-23 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset 0bb40a42d71873ea267aace8c92a02d66fe36dc2 by Dong-hee Na in branch 
'main':
closes bpo-46736: SimpleHTTPRequestHandler now uses HTML5. (GH-31533)
https://github.com/python/cpython/commit/0bb40a42d71873ea267aace8c92a02d66fe36dc2


--
nosy: +benjamin.peterson
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46736] Generate HTML 5 with SimpleHTTPRequestHandler.list_directory

2022-02-23 Thread Dong-hee Na


Change by Dong-hee Na :


--
keywords: +patch
pull_requests: +29657
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/31533

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46736] Generate HTML 5 with SimpleHTTPRequestHandler.list_directory

2022-02-23 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46736] Generate HTML 5 with SimpleHTTPRequestHandler.list_directory

2022-02-18 Thread Éric Araujo

Éric Araujo  added the comment:

Would you like to make a pull request?

--
nosy: +eric.araujo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46736] Generate HTML 5 with SimpleHTTPRequestHandler.list_directory

2022-02-13 Thread Dominic Davis-Foster


New submission from Dominic Davis-Foster :

Currently SimpleHTTPRequestHandler.list_directory (which is used with `python3 
-m http.server` amongst other things) generates HTML with the doctype:

http://www.w3.org/TR/html4/strict.dtd;>

i.e. HTML 4.01.


I propose making the generated page HTML 5 instead. The only necessary change 
is in the doctype; the rest of the page is valid already. HTML 5 has been 
supported by Chrome, Firefox, Safari and Opera since 2013, and Edge since 2015 
so there shouldn't be any issues with browser compatibility.

The generated page has been HTML 4.01 since https://bugs.python.org/issue13295 
in 2011, where it was originally proposed to switch to HTML 5.


Switching to HTML 5 would also allow http.server to be used to serve a simple 
index for pip that's compliant with PEP 503.

There's some discussion in https://github.com/pypa/pip/issues/10825

--
components: Library (Lib)
messages: 413173
nosy: dom1310df
priority: normal
severity: normal
status: open
title: Generate HTML 5 with SimpleHTTPRequestHandler.list_directory
type: enhancement
versions: Python 3.11

___
Python tracker 
<https://bugs.python.org/issue46736>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



utilities - make icons, generate HTML, repeat

2017-06-21 Thread Mark Lutz
Two utility programs have just been upgraded:

iconify 

The iconify program can now produce both Mac ".icns" 
and Windows "ico" icon files from presized images - and
on either platform (plus Linux).  For details, see
http://learning-python.com/iconify.html.

genhtml

The genhtml static-webpage-inserts program now handles 
".*" Mac/Unix cruft files properly (e.g., ".DS_Store" 
and "._*" AppleDouble nonsense).  For specs, visit
http://learning-python.com/genhtml.html.
   
You'll also find these and other utility programs at:

http://learning-python.com/programs.html

Happy hacking,
--M. Lutz, http://learning-python.com
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


Re: how to generate html table from table data?

2007-12-28 Thread Bruno Desthuilliers
Ricardo Aráoz a écrit :
 Bruno Desthuilliers wrote:
(snip)
 FWIW, I just wrote a function generating an html table from a list 
 of header and a list of rows. I wrote the most QD, straightforward, 
 braindead way, it's 17 lines long, doesn't even need an import 
 statement, and took me less than 2 minutes to write - that is, far less 
 work than reading your post and answering it.
 
 Hi.
 Bruno, could you please post those 17 lines?   I'm not actually doing HTML
 work but I would find it interesting going through your code.
 
I'm afraid I throw that code away - as I said, this was braindead QD 
code, and certainly not even worth the time you'd spend reading it. But 
I can rewrite it if you want:

def generate_html_table(headers, rows):
 html = []

 if headers:
 html.append(tr)
 for header in headers:
 html.append(th%s/th % header)
 html.append(/tr)

 if rows:
 for row in rows:
 html.append(tr)
 for cell in row:
 html.append(td%s/td % cell)
 html.append(/tr)

 if html:
 html  = [table] + html + [/table]

 return \n.join(html)


Nothing interesting here, as you can see. And if you're going to do 
anything serious in web development, you'll be better using a templating 
system anyway.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: how to generate html table from table data?

2007-12-27 Thread Ricardo Aráoz
Bruno Desthuilliers wrote:
 [EMAIL PROTECTED] a écrit :
   Vasudev Ram wrote:
 Why not try writing your own code for this first?
 If nothing else, it'll help you learn more, and may also help you
 understand better, the other options.

 Thanks for your reply even it was not really helpful.
 
 The answers boil down to:
 - use the templating engine that comes with your web framework
 or
 - use whatever templating engine you like
 or
 - just do it by hand
 
 The remaining work is obviously such a no-brainer that there's no need 
 for a specific package, and so application specific that there's 
 probably nothing like a one-size-fits-all answer. IOW : you're not 
 likely to find more helpful answer - and your above comment won't 
 help. FWIW, I just wrote a function generating an html table from a list 
 of header and a list of rows. I wrote the most QD, straightforward, 
 braindead way, it's 17 lines long, doesn't even need an import 
 statement, and took me less than 2 minutes to write - that is, far less 
 work than reading your post and answering it.

Hi.
Bruno, could you please post those 17 lines? I'm not actually doing HTML
work but I would find it interesting going through your code.

TIA



-- 
http://mail.python.org/mailman/listinfo/python-list


Re: how to generate html table from table data?

2007-12-26 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit :
 Hi group,
 I would like to convert the output of the SQL query, or more generally
 I would like to convert any table data to the html table.

There's MoreThanOneWayToDoIt... from simple string formatting to a 
full-blown template engine.

 I would like to set some rules to format cells, columns or rows (font,
 colour etc.) of the html table, according to the values in the
 specific cells.

ot
Markup should only convey semantic informations - presentation is best 
done using css. IOW : presentation-related stuff in the html should be 
restricted to css class declarations.
/ot

 Googling for a while I have found only this tool:
 http://pasko.net/PyHtmlTable/
 
 Your tips to some other tools or/and your suggestion how to solve
 above mentioned will be very helpful.

As I said, wrt/ html generation, there are quite a lot of possible 
solutions - FWIW, generating an html table from a set of tabular data is 
nothing difficult. So without more information on the context, it's hard 
to give any valuable advice. Are you doing a web application ? If yes, 
you should already use a template engine, so just use it. Else, why is 
your application generating html at all ?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: how to generate html table from table data?

2007-12-26 Thread vasudevram
 [EMAIL PROTECTED] a écrit :

  Hi group,
  I would like to convert the output of the SQL query, or more generally
  I would like to convert any table data to the html table.

  I would like to set some rules to format cells, columns or rows (font,
  colour etc.) of the html table, according to the values in the
  specific cells.

Why not try writing your own code for this first?
If nothing else, it'll help you learn more, and may also help you
understand better, the other options.

Vasudev Ram
---
Dancing Bison Enterprises
Software consulting and training
Biz site: http://www.dancingbison.com
Blog (on software innovation): http://jugad.livejournal.com
Quick and easy PDF creation toolkit: http://www.dancingbison.com/products.html

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: how to generate html table from table data?

2007-12-26 Thread petr . jakes . tpc

 Why not try writing your own code for this first?
 If nothing else, it'll help you learn more, and may also help you
 understand better, the other options.

 Vasudev Ram

Thanks for your reply even it was not really helpful.
Of course some attempts to generate html from tabular data are behind
me. I am trying to find help here, because I think I am not the first
one, who is trying to generate html tables.

The purpose of my effort is to automatically and repeatedly read ŚQL
table and save the output of the SQL SELECT to the file in the html
format. Such a reports can be read by user using web browser later
on.

I was just trying to find if somebody here can point me to the
existing tool, which is suitable for such a task.

Anyway thank you for trying me help.

Petr Jakes
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: how to generate html table from table data?

2007-12-26 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit :
  Vasudev Ram wrote:
Why not try writing your own code for this first?
If nothing else, it'll help you learn more, and may also help you
understand better, the other options.
 
 
 Thanks for your reply even it was not really helpful.

The answers boil down to:
- use the templating engine that comes with your web framework
or
- use whatever templating engine you like
or
- just do it by hand

The remaining work is obviously such a no-brainer that there's no need 
for a specific package, and so application specific that there's 
probably nothing like a one-size-fits-all answer. IOW : you're not 
likely to find more helpful answer - and your above comment won't 
help. FWIW, I just wrote a function generating an html table from a list 
of header and a list of rows. I wrote the most QD, straightforward, 
braindead way, it's 17 lines long, doesn't even need an import 
statement, and took me less than 2 minutes to write - that is, far less 
work than reading your post and answering it.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: how to generate html table from table data?

2007-12-26 Thread petr . jakes . tpc
Dennis,
Thank you very much for your code snippet.
I will try to install CherryTemplate and use it.

I did not work with any template tool before and I am not the *
class programmer as other people here, so my questions maybe look
strange or stup...

I didn't mean to offend somebody here and I am really grateful for all
replies.

Thank you

Petr Jakes
-- 
http://mail.python.org/mailman/listinfo/python-list


how to generate html table from table data?

2007-12-25 Thread petr . jakes . tpc

Hi group,
I would like to convert the output of the SQL query, or more generally
I would like to convert any table data to the html table.

I would like to set some rules to format cells, columns or rows (font,
colour etc.) of the html table, according to the values in the
specific cells.

Googling for a while I have found only this tool:
http://pasko.net/PyHtmlTable/

Your tips to some other tools or/and your suggestion how to solve
above mentioned will be very helpful.

Thanks and regards

Petr Jakes
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: generate HTML

2005-11-15 Thread s99999999s2003
hi thanks for all the help
actually i am doing it the hard way

alist = [ 'div align=rightfont size=-1TESTbr',
'p align=centerstrongbr',
'blah' ]

f = open('test.html,'w')
f.writelines(alist)
f.close()

but everytime i hit
...
alist = [ 'div align=rightfont size=-1
ValueError: unsupported format character '' (0x22) at index 14

what does it mean?

i tried alist = [ 'div align=rightfont size=-1TESTbr'] on the
IDE and it works

thanks.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: generate HTML

2005-11-15 Thread Jim
Perhaps you are trying to do this:
  'text to go here: %s' % ('text',)
?  For that you need a double-quoted string:
  text to go here: %s % ('text',)
(or triple-doubles:  ..  as you noted).

Jim

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: generate HTML

2005-11-15 Thread Kent Johnson
Jim wrote:
 Perhaps you are trying to do this:
   'text to go here: %s' % ('text',)
 ?  For that you need a double-quoted string:
   text to go here: %s % ('text',)

Uh, no, not in Python:
  'text to go here: %s' % ('text',)
'text to go here: text'
  text to go here: %s % ('text',)
'text to go here: text'

Kent
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: generate HTML

2005-11-15 Thread Thomas Guettler
Am Tue, 15 Nov 2005 02:52:54 -0800 schrieb ss2003:

 alist = [ 'div align=rightfont size=-1
 ValueError: unsupported format character '' (0x22) at index 14

Look at this:

=== python
Python 2.3.4 (#1, Feb  7 2005, 15:50:45) 
[GCC 3.3.4 (pre 3.3.5 20040809)] on linux2
Type help, copyright, credits or license for more information.
 a%qb%sc
'a%qb%sc'
 a%qb%sc % (1)
Traceback (most recent call last):
  File stdin, line 1, in ?
ValueError: unsupported format character 'q' (0x71) at index 2

If you don't have a '% (...)' behind the string, all percent signs are
ignored. But if you use it, %q will bring you an error because only %s, %d, ...
is supported.

If you create html, here the way I do it:

rows=[]
for i in range(...).
rows.append()
rows=''.join(rows)

date=time.strftime()
html=
 Today: %(date)s
 table
 %(rows)s
 /table
  % locals()

outfile=out.html
fd=open(outfile, wt)
fd.write(html)
fd.close()
print Created %s % outfile

HTH,
 Thomas

-- 
Thomas Güttler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de
Spam Catcher: [EMAIL PROTECTED]

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: generate HTML

2005-11-15 Thread s99999999s2003
thanks
i will check out the example you have given.actually my html output is
a bit dynamic in the sense that i may have different number of rows
depending on some inputs.
so i am putting everything into a list and using 'extend' to append to
that list for every dynamically generated rows using for/while loops.
then at the end of the code, i use writelines() to output to the file.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: generate HTML

2005-11-14 Thread Richie Hindle

[ss2003]
 I am stuck at above after doing a lot of f.write for every line of HTML
 . Any betterways to do this in python?

See the Templating Engines section of
http://wiki.python.org/moin/WebProgramming - I hope you have a few hours to
spare!  8-)

-- 
Richie Hindle
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


generate HTML

2005-11-14 Thread s99999999s2003
hi
i have fucntion that generates a HTML page

def genpage(arg1,arg2):
   print ''' div align=rightfont size=-1BLAH BLAH.%s %s
  ''' % (arg1, arg2)

   print ''' table blah blah... %s %s

  /table''' % (arg1,arg2)'

The func is something like that, alot of open''' and closing ''' triple
quotes. anyway, i wish to print all these into a HTML output file so
that when i click on it, it shows me the html page. How can i do that?

i tried
f = open(output.html,w)
f.write ( 'print '''div align 

I am stuck at above after doing a lot of f.write for every line of HTML
. Any betterways to do this in python?

something like here documents in a shell script where it can also be
directed to a file.
thanks

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: generate HTML

2005-11-14 Thread Jeffrey Schwab
[EMAIL PROTECTED] wrote:
 hi
 i have fucntion that generates a HTML page
 
 def genpage(arg1,arg2):
print ''' div align=rightfont size=-1BLAH BLAH.%s %s
   ''' % (arg1, arg2)
 
print ''' table blah blah... %s %s
 
   /table''' % (arg1,arg2)'
 
 The func is something like that, alot of open''' and closing ''' triple
 quotes. anyway, i wish to print all these into a HTML output file so
 that when i click on it, it shows me the html page. How can i do that?
 
 i tried
 f = open(output.html,w)
 f.write ( 'print '''div align 
 
 I am stuck at above after doing a lot of f.write for every line of HTML
 . Any betterways to do this in python?
 
 something like here documents in a shell script where it can also be
 directed to a file.
 thanks
 

Why not just redirect the output of your Python script from the shell? 
E.g.:

python generate_html.py  output.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: generate HTML

2005-11-14 Thread Scott David Daniels
Jeffrey Schwab wrote:
 [EMAIL PROTECTED] wrote:
...
 def genpage(arg1,arg2):
print ''' div align=rightfont size=-1BLAH BLAH.%s %s
   ''' % (arg1, arg2)
...
  i wish to print all these into a HTML output file so that
 when i click on it, it shows me the html page. How can i do that?
 ...
 Why not just redirect the output of your Python script from the shell? 
 E.g.:
 
 python generate_html.py  output.html

Or you can even do the following Python dance:

 def gen_to_file(filename, arg1, arg2):
 import sys
 former, sys.stdout = sys.stdout, open(output.html, w)
 try:
 genpage(arg1, arg2)
 finally:
 htmlfile, sys.stdout = sys.stdout, former
 htmlfile.close()
 print 'file %r written' % filename

--Scott David Daniels
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


How can I use PyDoc to generate html file (modul in directory d)

2005-01-31 Thread [EMAIL PROTECTED]
Hello

How can I use PyDoc to generate html file when my file.py is in other
directory. 

Sincerely Yours,
Pujo

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How can I use PyDoc to generate html file (modul in directory d)

2005-01-31 Thread [EMAIL PROTECTED]
Hello all,

I finaly find the solution, but please share yours if you have
different way to do it.

Theories:
PyDoc  menu can only search the module in directory when it was
first called and in python directory for example c:\python24. So I have
to call PyDoc in my module directory. It would be necessary to put in
your path (environment in windows Xp) something like :
path C:\python24\Lib

After that you can create a bat file containing:
pydoc.py -g

that's it. everytime you need to see your doc, just click your bat
file.


Sincerely Yours,
Pujo Aji

-- 
http://mail.python.org/mailman/listinfo/python-list