File: customization.py

package info (click to toggle)
dotty-dict 1.3.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 352 kB
  • sloc: python: 1,166; makefile: 192; sh: 5
file content (23 lines) | stat: -rw-r--r-- 589 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env python
# -*- coding: utf-8 -*-

__author__ = 'Pawel Zadrozny'
__copyright__ = 'Copyright (c) 2018, Pawel Zadrozny'


def custom_separator():
    from dotty_dict import Dotty

    dot = Dotty({'deep': {'deeper': {'harder': 'faster'}}}, separator='$', esc_char='\\')

    assert dot['deep$deeper$harder'] == 'faster'
    # end of custom_separator


def custom_escape_char():
    from dotty_dict import Dotty

    dot = Dotty({'deep.deeper': {'harder': 'faster'}}, separator='.', esc_char='#')

    assert dot['deep#.deeper.harder'] == 'faster'
    # end of custom_escape_char