def do_dftp_connect(self, s): """ Usage: dftp_connect Connect to device for dftp session. What version of DFTP it attempts to connect with depends on the device profile that has been loaded. Will attempt to configure IPs or mount points as needed. This could take a minute or so, if you just booted the device. """ try: if not self._lm.is_client(self._dftp_client): try: if self._profile.get['firmware']['dftp_version'] == 1: ci = conn_iface(net_connection(self.host_id, self.device_id, self.debug)) print 'Connecting with DFTP v1 Networking.' elif self._profile.get['firmware']['dftp_version'] == 2: ci = conn_iface(mount_connection(self.device_id, 'NULL', self.debug)) print 'Connecting with DFTP v2 Mass Storage.' self._dftp_client = dftp_client(ci, self._profile, self.debug) self._lm.remote_connection_init(ci, fs_iface(self._dftp_client), self._dftp_client) self._dftp_client.create_client() self._lm.remote_path_init() #self.dftp_device_info() except Exception, e: self._dftp_client = None self._lm.remote_destroy() self.error(e) else:
def do_didj_mount(self, s): """ Usage: didj_mount Unlock Didj to allow it to mount on host system. """ try: if not self._lm.is_client(self._didj_client): try: mc = conn_iface(mount_connection(self.device_id, self.host_id, self.debug)) self._didj_client = didj_client(mc, self.debug) self._lm.remote_connection_init(mc, fs_iface(local_client(self.debug)), self._didj_client) self._didj_client.mount() self._lm.remote_path_init() self.didj_device_info() except Exception, e: self._didj_client = None self._lm.remote_destroy() self.error(e) else:
def __init__(self, init_path, cmd=None): if cmd is not None: self._cmd = cmd self._prompt_suffix = '> ' self._cmd.prompt = 'local%s' % self._prompt_suffix self.local_client = local_client(False) self.remote_client = None self.remote_conn = None self._remote_set = False self._last_location = self._remote_set self.local_fs = fs_iface(self.local_client) self.remote_fs = None self.fs = self.local_fs self._local_path_init = init_path self.local_path = self._local_path_init self._remote_path_init = '/' self.remote_path = self._remote_path_init self.path = ''