Skip to content

Commit

Permalink
Run library migrator on import.
Browse files Browse the repository at this point in the history
  • Loading branch information
blakejohnson committed Feb 17, 2016
1 parent 52392e7 commit 432ba74
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion JSONLibraryUtils
9 changes: 7 additions & 2 deletions QGL/ChannelLibrary.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

from . import Channels
from . import PulseShapes
from JSONLibraryUtils import LibraryCoders, FileWatcher
from JSONLibraryUtils import LibraryCoders, FileWatcher, JSONMigrators
from . import config

class ChannelLibrary(Atom):
Expand All @@ -38,7 +38,7 @@ class ChannelLibrary(Atom):
connectivityG = Typed(nx.DiGraph)
libFile = Str()
fileWatcher = Typed(FileWatcher.LibraryFileWatcher)
version = Int(3)
version = Int(4)

def __init__(self, channelDict={}, **kwargs):
super(ChannelLibrary, self).__init__(channelDict=channelDict, **kwargs)
Expand Down Expand Up @@ -253,4 +253,9 @@ def EdgeFactory(source, target):
raise ValueError('Edge {0} not found in connectivity graph'.format((source, target)))

# global channel library
migrator = JSONMigrators.ChannelMigrator(config.channelLibFile);
migrationMsg = migrator.migrate()
for msg in migrationMsg:
print(msg)

channelLib = ChannelLibrary(libFile=config.channelLibFile)

0 comments on commit 432ba74

Please sign in to comment.