Skip to content

Commit

Permalink
Cosmetic change.
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermechapiewski committed Jul 27, 2009
1 parent 233b4c2 commit 3a7f0a7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core.py
Expand Up @@ -3,21 +3,21 @@
import os
import shutil
import re

class Migration(object):

MIGRATION_FILES_EXTENSION = ".migration"
MIGRATION_FILES_MASK = r"[0-9]{14}\w+%s$" % MIGRATION_FILES_EXTENSION
TEMPLATE = 'SQL_UP = u"""\n\n"""\n\nSQL_DOWN = u"""\n\n"""'

def __init__(self, file):
if not os.path.exists(file):
raise Exception('migration file does not exist (%s)' % file)

file_name = os.path.split(file)[1]
if not Migration.is_file_name_valid(file_name):
raise Exception('invalid migration file name (%s)' % file_name)

if not os.path.exists(file):
raise Exception('migration file does not exist (%s)' % file)

self.abspath = os.path.abspath(file)
self.file_name = file_name
self.version = file_name[0:file_name.find("_")]
Expand Down

0 comments on commit 3a7f0a7

Please sign in to comment.