Alien-SVN
view release on metacpan or search on metacpan
src/subversion/subversion/bindings/swig/python/svn/core.py view on Meta::CPAN
#
# core.py: public Python interface for core components
#
# Subversion is a tool for revision control.
# See http://subversion.apache.org for more information.
#
######################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
######################################################################
from libsvn.core import *
import libsvn.core as _libsvncore
import atexit as _atexit
import sys
__all__ = [
# Symbols that 'import *' used to pull (in 1.7)
'Pool',
'SVNSYNC_PROP_CURRENTLY_COPYING',
'SVNSYNC_PROP_FROM_URL',
'SVNSYNC_PROP_FROM_UUID',
'SVNSYNC_PROP_LAST_MERGED_REV',
'SVNSYNC_PROP_LOCK',
'SVNSYNC_PROP_PREFIX',
'SubversionException',
# 'apr_array_header_t',
# 'apr_file_open_stderr',
# 'apr_file_open_stdout',
# 'apr_file_t',
# 'apr_hash_t',
# 'apr_initialize',
# 'apr_pool_clear',
# 'apr_pool_destroy',
# 'apr_pool_t',
# 'apr_terminate',
# 'apr_time_ansi_put',
# 'run_app',
# Symbols defined explicitly below.
'SVN_IGNORED_REVNUM',
'SVN_INVALID_REVNUM',
'svn_path_compare_paths',
'svn_mergeinfo_merge',
'svn_mergeinfo_sort',
'svn_rangelist_merge',
'svn_rangelist_reverse',
# 'Stream',
# 'apr_initialize',
# 'apr_terminate',
'svn_pool_create',
'svn_pool_destroy',
'svn_pool_clear',
]
class SubversionException(Exception):
# Python 2.6 deprecated BaseException.message, which we inadvertently use.
# We override it here, so the users of this class are spared from
# DeprecationWarnings.
# Note that BaseException.message is not deprecated in Python 2.5, and
# isn't present in all other versions.
if sys.version_info[0:2] == (2, 6):
message = None
def __init__(self, message=None, apr_err=None, child=None,
file=None, line=None):
"""Initialize a new Subversion exception object.
Arguments:
message -- optional user-visible error message
apr_err -- optional integer error code (apr_status_t)
child -- optional SubversionException to wrap
file -- optional source file name where the error originated
line -- optional line number of the source file
file and line are for C, not Python; they are redundant to the
traceback information for exceptions raised in Python.
"""
# Be compatible with Subversion <1.5 .args behavior:
args = []
if message is not None or apr_err is not None:
args.append(message)
if apr_err is not None:
args.append(apr_err)
Exception.__init__(self, *args)
self.apr_err = apr_err
( run in 1.806 second using v1.01-cache-2.11-cpan-5b529ec07f3 )