Commit 9e8cbbdc authored by Taddeüs Kroes's avatar Taddeüs Kroes

Added 'spaces' option.

parent ba892a25
...@@ -296,6 +296,8 @@ if __name__ == '__main__': # pragma: nocover ...@@ -296,6 +296,8 @@ if __name__ == '__main__': # pragma: nocover
parser.add_argument('-a', '--create-all', action='store_true', parser.add_argument('-a', '--create-all', action='store_true',
help='create all available options and variables') help='create all available options and variables')
parser.add_argument('-d', '--dir', help='directory to save model files in') parser.add_argument('-d', '--dir', help='directory to save model files in')
parser.add_argument('-s', '--spaces', nargs='?', const=4, type=int,
help='use spaces instead of tabs (4 by default)')
args = parser.parse_args() args = parser.parse_args()
options = {} options = {}
...@@ -306,6 +308,9 @@ if __name__ == '__main__': # pragma: nocover ...@@ -306,6 +308,9 @@ if __name__ == '__main__': # pragma: nocover
if args.create_all: if args.create_all:
options['create_select'] = options['create_accessible'] = True options['create_select'] = options['create_accessible'] = True
if args.spaces:
TAB = args.spaces * ' '
conn = mysql.connect(args.host, args.user, args.password, args.dbname) conn = mysql.connect(args.host, args.user, args.password, args.dbname)
models = create_models(conn, options) models = create_models(conn, options)
conn.close() conn.close()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment