Skip to content

Commit c1e101e

Browse files
author
Jordan Mance
committed
Adding support for :uri suffix
1 parent 8bf7d8f commit c1e101e

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
Python Figgy Lib Changelog
22

3+
## 0.0.4
4+
- Adding support for :uri suffix in merge parameters.
5+
36
## 0.0.3
47
- Removing unnecessary print statements
58
- Cleaning up the code, adding comments.

src/figgy/figs.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ def value(self, value):
8989
def __str__(self):
9090
return self.value
9191

92+
def __eq__(self, o):
93+
return self.name == o.name
9294

9395
class AppFig(Fig):
9496
"""
@@ -130,16 +132,21 @@ class MergeFig(Fig):
130132
"""
131133
pattern: List[Union[str, Fig]]
132134

133-
def __init__(self, name: str, pattern: List[Union[str, Fig]]):
135+
def __init__(self, name: str, pattern: List[Union[str, Fig]], uri_encode: List[Fig] = None):
134136
super().__init__(name=name)
135137
self.pattern = pattern
138+
self.uri_encode = uri_encode if uri_encode else []
136139

137140
@property
138141
def pattern(self):
139142
translated_pattern = []
140143
for p in self._pattern:
141144
if hasattr(p, 'name'):
142-
translated_pattern.append(f'${{{p.name}}}')
145+
suffix = ''
146+
if p in self.uri_encode:
147+
suffix = ':uri'
148+
149+
translated_pattern.append(f'${{{p.name}{suffix}}}')
143150
else:
144151
translated_pattern.append(p)
145152

src/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from setuptools import setup, find_packages
33

44
FIGGY_WEBSITE = "https://www.figgy.dev"
5-
VERSION = '0.0.3'
5+
VERSION = '0.0.4'
66
SHORT_DESCRIPTION = "Python library that supports Python development while using the Figgy config management " \
77
f"framework: {FIGGY_WEBSITE}"
88

0 commit comments

Comments
 (0)