view release on metacpan or search on metacpan
src/subversion/build/generator/ezt.py view on Meta::CPAN
#
# This software is maintained by Greg and is available at:
# http://code.google.com/p/ezt/
#
import os, re, sys
if sys.version_info[0] >= 3:
# Python >=3.0
long = int
unicode = str
from io import StringIO
from urllib.parse import quote_plus as urllib_parse_quote_plus
else:
# Python <3.0
from urllib import quote_plus as urllib_parse_quote_plus
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
src/subversion/build/generator/ezt.py view on Meta::CPAN
for orig, repl in replace_map:
s = s.replace(orig, repl)
return s
REPLACE_JS_MAP = (
('\\', r'\\'), ('\t', r'\t'), ('\n', r'\n'), ('\r', r'\r'),
('"', r'\x22'), ('\'', r'\x27'), ('&', r'\x26'),
('<', r'\x3c'), ('>', r'\x3e'), ('=', r'\x3d'),
)
# Various unicode whitespace
if sys.version_info[0] >= 3:
# Python >=3.0
REPLACE_JS_UNICODE_MAP = (
('\u0085', r'\u0085'), ('\u2028', r'\u2028'), ('\u2029', r'\u2029')
)
else:
# Python <3.0
REPLACE_JS_UNICODE_MAP = eval("((u'\u0085', r'\u0085'), (u'\u2028', r'\u2028'), (u'\u2029', r'\u2029'))")
# Why not cgi.escape? It doesn't do single quotes which are occasionally
# used to contain HTML attributes and event handler definitions (unfortunately)
REPLACE_HTML_MAP = (
('&', '&'), ('<', '<'), ('>', '>'),
('"', '"'), ('\'', '''),
)
def _js_escape(s):
s = _replace(s, REPLACE_JS_MAP)
### perhaps attempt to coerce the string to unicode and then replace?
if isinstance(s, unicode):
s = _replace(s, REPLACE_JS_UNICODE_MAP)
return s
def _html_escape(s):
return _replace(s, REPLACE_HTML_MAP)
def _url_escape(s):
### quote_plus barfs on non-ASCII characters. According to
### http://www.w3.org/International/O-URL-code.html URIs should be
### UTF-8 encoded first.
if isinstance(s, unicode):
s = s.encode('utf8')
return urllib_parse_quote_plus(s)
FORMATTERS = {
FORMAT_RAW: None,
FORMAT_HTML: _html_escape,
FORMAT_XML: _html_escape, ### use the same quoting as HTML for now
FORMAT_JS: _js_escape,
FORMAT_URL: _url_escape,
}
src/subversion/doc/doxygen.conf view on Meta::CPAN
# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
# available from the path. This tool is part of Graphviz, a graph visualization
# toolkit from AT&T and Lucent Bell Labs. The other options in this section
# have no effect if this option is set to NO (the default)
HAVE_DOT = NO
# By default doxygen will write a font called FreeSans.ttf to the output
# directory and reference it in all dot files that doxygen generates. This
# font does not include all possible unicode characters however, so when you need
# these (or just want a differently looking font) you can specify the font name
# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
# which can be done by putting it in a standard location or by setting the
# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
# containing the font.
DOT_FONTNAME = FreeSans
# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
# The default size is 10pt.
src/subversion/subversion/libsvn_subr/io.c view on Meta::CPAN
}
return svn_error_wrap_apr(status,
_("Can't change perms of file '%s'"),
svn_dirent_local_style(path, pool));
}
#endif /* !WIN32 && !__OS2__ */
#ifdef WIN32
#if APR_HAS_UNICODE_FS
/* copy of the apr function utf8_to_unicode_path since apr doesn't export this one */
static apr_status_t io_utf8_to_unicode_path(apr_wchar_t* retstr, apr_size_t retlen,
const char* srcstr)
{
/* TODO: The computations could preconvert the string to determine
* the true size of the retstr, but that's a memory over speed
* tradeoff that isn't appropriate this early in development.
*
* Allocate the maximum string length based on leading 4
* characters of \\?\ (allowing nearly unlimited path lengths)
* plus the trailing null, then transform /'s into \\'s since
* the \\?\ form doesn't allow '/' path separators.
src/subversion/subversion/libsvn_subr/io.c view on Meta::CPAN
folder attributes even if apr doesn't implement them */
DWORD flags;
apr_status_t rv;
#if APR_HAS_UNICODE_FS
apr_wchar_t wfname[APR_PATH_MAX];
#endif
#if APR_HAS_UNICODE_FS
IF_WIN_OS_IS_UNICODE
{
if (rv = io_utf8_to_unicode_path(wfname,
sizeof(wfname) / sizeof(wfname[0]),
fname))
return rv;
flags = GetFileAttributesW(wfname);
}
#endif
#if APR_HAS_ANSI_FS
ELSE_WIN_OS_IS_ANSI
{
flags = GetFileAttributesA(fname);
src/subversion/subversion/libsvn_subr/utf_validate.c view on Meta::CPAN
/* Validate a UTF-8 string according to the rules in
*
* Table 3-6. Well-Formed UTF-8 Bytes Sequences
*
* in
*
* The Unicode Standard, Version 4.0
*
* which is available at
*
* http://www.unicode.org/
*
* UTF-8 was originally defined in RFC-2279, Unicode's "well-formed UTF-8"
* is a subset of that enconding. The Unicode enconding prohibits things
* like non-shortest encodings (some characters can be represented by more
* than one multi-byte encoding) and the encodings for the surrogate code
* points. RFC-3629 superceeds RFC-2279 and adopts the same well-formed
* rules as Unicode. This is the ABNF in RFC-3629 that describes
* well-formed UTF-8 rules:
*
* UTF8-octets = *( UTF8-char )
src/subversion/subversion/libsvn_subr/utf_width.c view on Meta::CPAN
* entirely satisfactory and should be reconsidered before
* establishing a formal standard in this area. At the moment, the
* decision which Not East Asian (Neutral) characters should be
* represented by double-width glyphs cannot yet be answered by
* applying a simple rule from the Unicode database content. Setting
* up a proper standard for the behavior of UTF-8 character terminals
* will require a careful analysis not only of each Unicode character,
* but also of each presentation form, something the author of these
* routines has avoided to do so far.
*
* http://www.unicode.org/unicode/reports/tr11/
*
* Markus Kuhn -- 2007-05-26 (Unicode 5.0)
*
* Permission to use, copy, modify, and distribute this software
* for any purpose and without fee is hereby granted. The author
* disclaims all warranties with regard to this software.
*
* Latest version: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c
*/
src/subversion/tools/dist/_gnupg.py view on Meta::CPAN
import sys
import threading
try:
import logging.NullHandler as NullHandler
except ImportError:
class NullHandler(logging.Handler):
def handle(self, record):
pass
try:
unicode
_py3k = False
except NameError:
_py3k = True
logger = logging.getLogger(__name__)
if not logger.handlers:
logger.addHandler(NullHandler())
def _copy_data(instream, outstream):
# Copy one stream to another
src/subversion/tools/server-side/svnpubsub/svnpubsub/server.py view on Meta::CPAN
reactor.callLater(HEARTBEAT_TIME, self.heartbeat, None)
def heartbeat(self, args):
if self.alive:
self.write_heartbeat()
reactor.callLater(HEARTBEAT_TIME, self.heartbeat, None)
def write_data(self, data):
self.write(data + "\n\0")
""" "Data must not be unicode" is what the interfaces.ITransport says... grr. """
def write(self, input):
self.r.write(str(input))
def write_start(self):
self.r.setHeader('X-SVNPubSub-Version', '1')
self.r.setHeader('content-type', 'application/vnd.apache.vc-notify+json')
self.write('{"svnpubsub": {"version": 1}}\n\0')
def write_heartbeat(self):
self.write(json.dumps({"stillalive": time.time()}) + "\n\0")