Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 08-25-2006
toadi toadi is offline
Registered User
 
 
Join Date: Aug 2006
Posts: 3
Python including slices

Hello,

I'm new to ice and python so probably I'm just overlooking something trivial.

But I include our own slice files into my python program:

Ice.loadSlice('Session.ice')
Ice.loadSlice('SecurityItmes.ice')

But one of our own slice files has a include:

#include <Ice/Plugin.ice>

So I added:

Ice.loadSlice('-I c:/Ice-3.0.1/slice/Ice Plugin.ice')

But now following error occurs:

icecpp: can't open `Plugin.ice' for reading
Traceback (most recent call last):
File "Client.py", line 13, in ?
Ice.loadSlice('-I c:/Ice-3.0.1/slice/Ice Plugin.ice')
RuntimeError: Slice preprocessing failed for `-I c:/Ice-3.0.1/slice/Ice Plugin.i
ce'

I also tried with:

Ice.loadSlice('-I c:/Ice-3.0.1/slice Plugin.ice')

Like I told I'm new to ice and new to python so probably I'm missing something trivial...
__________________
Geert Theys
Project Manager
PearlDoc
Reply With Quote
  #2 (permalink)  
Old 08-25-2006
dwayne's Avatar
dwayne dwayne is offline
ZeroC Staff
 
Name: Dwayne Boone
Organization: ZeroC, Inc.
Project: Internet Communications Engine
 
Join Date: Jan 2005
Location: St. John's, Newfoundland
Posts: 215
Hi,

If one of your slice files includes a slice file from another directory you need to add the include directive when you load your slice file. ie

Ice.loadSlice('-I c:/Ice-3.0.1/slice SecurityItmes.ice')

or whichever slice file has the include. What you doing above is trying to load a file named Plugin.ice in your current directory, which does not exist.

Regards,
Dwayne
Reply With Quote
  #3 (permalink)  
Old 08-25-2006
toadi toadi is offline
Registered User
 
 
Join Date: Aug 2006
Posts: 3
Hello,

So I have:

in my local slice dir:

someslice1.ice
someslice2.ice
someslice3.ice


someslice1.ice has as includes:

#include <someslice2.ice>
#include <someslice3.ice>

someslice2.ice has as includes:

#include <Ice/Plugin.ice>
#include <someslice3.ice>

My python script contains:

Ice.loadSlice('-I c:/Ice-3.0.1/slice -I C:/localslicepath someslice1.ice')
Ice.loadSlice('-I c:/Ice-3.0.1/slice -I C:/localslicepath someslice2.ice')
Ice.loadSlice('-I c:/Ice-3.0.1/slice -I C:/localslicepath someslice3.ice')

Following error occurs:

Traceback (most recent call last):
File "Client.py", line 13, in ?
Ice.loadSlice('-I c:/Ice-3.0.1/slice -I C:/localslicepath someslice1.ice')
File "someslice1.ice'", line 3, in ?

ImportError: No module named someslice2_ice

Why is there a importerror?
__________________
Geert Theys
Project Manager
PearlDoc
Reply With Quote
  #4 (permalink)  
Old 08-25-2006
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,781
Add -I., so that the current directory is searched.

You can also simply add --all, so that all dependencies are included. Then you only need one line:

Ice.loadSlice('--all -I. -Ic:/Ice-3.0.1/slice -IC:/localslicepath someslice1.ice')
Reply With Quote
  #5 (permalink)  
Old 08-25-2006
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,781
Quote:
Originally Posted by marc
Add -I., so that the current directory is searched.

You can also simply add --all, so that all dependencies are included. Then you only need one line:

Ice.loadSlice('--all -I. -Ic:/Ice-3.0.1/slice -IC:/localslicepath someslice1.ice')
Sorry, what I wrote is not correct, you don't need "-I.". You get the error because at the time you try to load someslice1.ice, someslice2.ice has not yet been loaded. So you must either reverse your load order, or instead load someslice1.ice including all it's dependencies with the --all option (which is simpler IMO).
Reply With Quote
  #6 (permalink)  
Old 08-25-2006
toadi toadi is offline
Registered User
 
 
Join Date: Aug 2006
Posts: 3
This seems to work. Thanks for the quick response.
__________________
Geert Theys
Project Manager
PearlDoc
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Python BiT Help Center 1 09-19-2006 06:21 PM
pb with python example arnaud Help Center 13 03-06-2006 03:36 AM
Pb with installation directories including space in name vermorel Bug Reports 2 12-08-2005 01:18 PM
Including slice files mcrystal Help Center 1 08-05-2005 01:00 AM
Ice for Python davidcr1983 Help Center 3 07-27-2005 01:01 PM


All times are GMT -4. The time now is 11:06 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.