Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Session initialization calls client.connect(). Closes #13
- Loading branch information
Showing
9 changed files
with
37 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,29 @@ | ||
"""Local XAL sessions.""" | ||
from xal.client.local import LocalClient | ||
from xal.dir.local import LocalDirProvider | ||
from xal.path.local import LocalPathProvider | ||
from xal.session import Session | ||
from xal.sh.local import LocalShProvider | ||
from xal.sys.local import LocalSysProvider | ||
|
||
|
||
class LocalSession(Session): | ||
"""A session on local machine.""" | ||
#: LocalSession is related to local machine. | ||
is_local = True | ||
|
||
def __init__(self, **kwargs): | ||
def __init__(self, *args, **kwargs): | ||
"""Local session factory.""" | ||
# Initialize registry. | ||
from xal.registry import Registry | ||
registry = kwargs.setdefault('registry', Registry()) | ||
super(LocalSession, self).__init__(registry) | ||
super(LocalSession, self).__init__() | ||
|
||
# Let's import providers then register them to interfaces. | ||
from xal.client.local import LocalClient | ||
from xal.dir.local import LocalDirProvider | ||
from xal.path.local import LocalPathProvider | ||
from xal.sh.local import LocalShProvider | ||
from xal.sys.local import LocalSysProvider | ||
|
||
self.registry.register( | ||
client=LocalClient(), | ||
dir=LocalDirProvider(), | ||
path=LocalPathProvider(), | ||
sh=LocalShProvider(), | ||
sys=LocalSysProvider(), | ||
) | ||
|
||
# Connect client. | ||
self.client.connect(*args, **kwargs) |