Change parsing format to use AST via RedBaron
Moved away from using manual parsing. Source is parsed using RedBaron to make the FST. Some import formats not yet implemented, and still some bugs to work out. However, the current script works well for the two cases in the file comments.
This commit is contained in:
parent
0b2556f3ec
commit
8488a3afa9
3 changed files with 51 additions and 27 deletions
|
|
@ -1,6 +1,18 @@
|
|||
from flask.ext.foo import bam
|
||||
from flask.ext.foo import \
|
||||
bam, \
|
||||
crackle
|
||||
|
||||
from flask.ext import foo
|
||||
|
||||
from flask.ext.foo import (bam,
|
||||
a,
|
||||
b
|
||||
)
|
||||
|
||||
|
||||
from flask.ext import foo
|
||||
|
||||
import sys
|
||||
|
||||
def migrate(old_file):
|
||||
new_file = open("temp.py", "w")
|
||||
|
|
@ -16,5 +28,6 @@ def migrate(old_file):
|
|||
|
||||
new_file.write(line)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
old_file = open(sys.arv[1])
|
||||
old_file = open(sys.arv[1])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue