Skip to content

Commit

Permalink
Switching to {{VARIABLE}} naming for folders and files
Browse files Browse the repository at this point in the history
  • Loading branch information
krak3n committed May 19, 2013
1 parent 73a5793 commit 8d5c2fa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/facio/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,14 @@ def copy_template(self):
def rename(self, root, name):
'''Rename a file or directory.'''

e = re.compile(r'__(.*?)__')
e = re.compile(r'\{\{(.*?)\}\}')
try:
plain = e.findall(name)[0]
if plain in self.place_holders:
place_holder_val = self.place_holders[plain]
origin = os.path.join(root, name)
new_name = name.replace('__%s__' % plain, place_holder_val)
new_name = name.replace('{{{{{0}}}}}'.format(plain),
place_holder_val)
new = os.path.join(root, new_name)
move(origin, new)
return True
Expand Down

0 comments on commit 8d5c2fa

Please sign in to comment.