Statistics
| Branch: | Tag: | Revision:

root / ncclient / content / common.py @ 8b4b9936

History | View | Annotate | Download (818 Bytes)

1 1dd43130 Shikhar Bhushan
# Copyright 2009 Shikhar Bhushan
2 1dd43130 Shikhar Bhushan
#
3 1dd43130 Shikhar Bhushan
# Licensed under the Apache License, Version 2.0 (the "License");
4 1dd43130 Shikhar Bhushan
# you may not use this file except in compliance with the License.
5 1dd43130 Shikhar Bhushan
# You may obtain a copy of the License at
6 1dd43130 Shikhar Bhushan
#
7 1dd43130 Shikhar Bhushan
#    http://www.apache.org/licenses/LICENSE-2.0
8 1dd43130 Shikhar Bhushan
#
9 1dd43130 Shikhar Bhushan
# Unless required by applicable law or agreed to in writing, software
10 1dd43130 Shikhar Bhushan
# distributed under the License is distributed on an "AS IS" BASIS,
11 1dd43130 Shikhar Bhushan
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 1dd43130 Shikhar Bhushan
# See the License for the specific language governing permissions and
13 1dd43130 Shikhar Bhushan
# limitations under the License.
14 1dd43130 Shikhar Bhushan
15 8b4b9936 Shikhar Bhushan
BASE_NS = 'urn:ietf:params:xml:ns:netconf:base:1.0'
16 8b4b9936 Shikhar Bhushan
17 1dd43130 Shikhar Bhushan
def qualify(tag, namespace=None):
18 1dd43130 Shikhar Bhushan
    'Returns qualified name of form `{namespace}tag`'
19 1dd43130 Shikhar Bhushan
    if namespace is None:
20 1dd43130 Shikhar Bhushan
        return tag
21 1dd43130 Shikhar Bhushan
    else:
22 1dd43130 Shikhar Bhushan
        return '{%s}%s' % (namespace, tag)