Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 32595 Details for
Bug 52889
Updates to dohtml
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
dohtml 0.1.2
dohtml (text/plain), 4.52 KB, created by
Karl Trygve Kalleberg (RETIRED)
on 2004-06-03 09:24:07 UTC
(
hide
)
Description:
dohtml 0.1.2
Filename:
MIME Type:
Creator:
Karl Trygve Kalleberg (RETIRED)
Created:
2004-06-03 09:24:07 UTC
Size:
4.52 KB
patch
obsolete
>#!/usr/bin/python > ># Copyright 1999-2004 Gentoo Technologies, Inc. ># Distributed under the terms of the GNU General Public License v2 ># Author Karl Trygve Kalleberg <karltk@gentoo.org> ># $Header: /home/cvsroot/gentoo-src/portage/bin/dohtml,v 1.10 2003/10/13 07:43:38 carpaski Exp $ ># ># Typical usage: ># dohtml -r docs/* ># - put all files and directories in docs into /usr/share/doc/${PF}/html ># dohtml foo.html ># - put foo.html into /usr/share/doc/${PF}/html ># ># ># Detailed usage: ># dohtml <list-of-files> ># - will install the files in the list of files (space-separated list) into ># /usr/share/doc/${PF}/html, provided the file ends in .html, .png, .jpg ># or .css ># dohtml -r <list-of-files-and-directories> ># - will do as 'dohtml', but recurse into all directories, as long as the ># directory name is not CVS ># dohtml -A jpe,java [-r] <list-of-files[-and-directories]> ># - will do as 'dohtml' but add .jpe,.java (default filter list is ># added to your list) ># dohtml -a png,gif,html,htm [-r] <list-of-files[-and-directories]> ># - will do as 'dohtml' but filter on .png,.gif,.html,.htm (default filter ># list is ignored) ># dohtml -x CVS,SCCS,RCS -r <list-of-files-and-directories> ># - will do as 'dohtml -r', but ignore directories named CVS, SCCS, RCS ># > >import os >import sys >import types >import optparse > >__version__ = "0.1.2" >__author__ = "Karl Trygve Kalleberg <karltk@gentoo.org>" > >def dodir(path): > os.system("install -d " + path) > >def dofile(src,dst): > > os.system("install -m0644 " + src + " " + dst) > >def install(basename, dirname, options, prefix=""): > > fullpath = basename > if prefix: fullpath = prefix + "/" + fullpath > if dirname: fullpath = dirname + "/" + fullpath > > if options.DOCDESTTREE: > destdir = options.D + "usr/share/doc/" + options.PF + "/" + options.DOCDESTTREE + "/" + options.doc_prefix + "/" + prefix > else: > destdir = options.D + "usr/share/doc/" + options.PF + "/html/" + options.doc_prefix + "/" + prefix > > if os.path.isfile(fullpath): > ext = os.path.splitext(basename)[1] > if len(ext) and ext[1:] in options.allowed_exts: > dodir(destdir) > dofile(fullpath, destdir + "/" + basename) > elif options.recurse and os.path.isdir(fullpath) and \ > basename not in options.disallowed_dirs: > for i in os.listdir(fullpath): > pfx = basename > if prefix: pfx = prefix + "/" + pfx > install(i, dirname, options, pfx) > >def parse_args(): > > default_allowed_exts = [ 'png', 'gif', 'html', 'htm', 'jpg', 'css', 'js' ] > default_disallowed_dirs = [ 'CVS' ] > > parser = optparse.OptionParser(version="%prog " + __version__ + "\nAuthor: " + __author__) > > parser.add_option("-A", "--append-allowed-exts", > dest = "append_allowed_exts", > action = "append", > metavar = "ALLOWED", > default = [], > help = "append to allowed file extensions") > parser.add_option("-a", "--set-allowed-exts", > dest = "allowed_exts", > metavar = "ALLOWED", > default = default_allowed_exts, > help = "set allowed file extensions") > parser.add_option("-f", "--allowed-files", > dest = "allowed_files", > action = "append", > metavar = "ALLOWED", > default = [], > help = "allowed extenionless files") > parser.add_option("-x", "--set-disallowed-dirs", > dest = "disallowed_dirs", > metavar = "DISALLOWED", > default = default_disallowed_dirs, > help = "set disallowed directories") > parser.add_option("-r", "--recurse", > dest = "recurse", default = False, > action = "store_true", > help = "recurse into subdirectories") > parser.add_option("-V", "--verbose", > action="count", dest="verbose", default=0, > help="print status messages to stdout") > parser.add_option("-p", "--doc-prefix", > dest = "doc_prefix", > metavar = "DOCPREFIX", > default = "", > help = "prefix inside the /usr/share/doc/${PF}/html/ directory") > > return parser.parse_args() > >def main(): > > (options, args) = parse_args() > > options.ensure_value("D", os.environ["D"]) > options.ensure_value("PF", os.environ["PF"]) > options.ensure_value("DOCDESTTREE", os.environ["DOCDESTTREE"]) > > if type(options.allowed_exts) == types.StringType: > options.allowed_exts = options.allowed_exts.split(",") > > exts = [] > for x in options.allowed_exts + options.append_allowed_exts: > exts += x.split(",") > options.allowed_exts = exts > > if options.verbose >= 3: > print "Allowed extensions:", options.allowed_exts > print "Document prefix : '" + options.doc_prefix + "'" > print "Allowed files :", options.allowed_files > > for x in args: > basename = os.path.basename(x) > dirname = os.path.dirname(x) > install(basename, dirname, options) > >if __name__ == "__main__": > main()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 52889
: 32595