Discussion:
icon help
joseph schlesinger
2006-05-18 03:05:09 UTC
Permalink
having sat out a couple of rounds of updates, i find i have several
schemas with old-school icon support, ie:
from schevo.icon.schema import SchevoIcon
changing that line to
_import('Schevo', 'icon', 1)
raises exceptions on evo evolve and on evo create
i don't have the specific tracebacks available at my current location,
but i bet our developers know exactly what they would be ;-)
as usual, any and all pointers would be greatly appreciated.
Patrick K. O'Brien
2006-05-18 11:55:57 UTC
Permalink
Post by joseph schlesinger
having sat out a couple of rounds of updates, i find i have several
from schevo.icon.schema import SchevoIcon
changing that line to
_import('Schevo', 'icon', 1)
raises exceptions on evo evolve and on evo create
i don't have the specific tracebacks available at my current location,
but i bet our developers know exactly what they would be ;-)
as usual, any and all pointers would be greatly appreciated.
The simplest way to add icon support is to define the SchevoIcon entity
in your schema, like this:

from schevo.schema import *
schevo.schema.prep(locals())


class SchevoIcon(E.Entity):

_hidden = True

name = f.unicode()
data = f.image()

_key(name)
--
Patrick K. O'Brien
Orbtech http://www.orbtech.com
Schevo http://www.schevo.org
Louie http://www.pylouie.org
joseph schlesinger
2006-05-18 16:14:57 UTC
Permalink
The simplest way to add icon support is to define the SchevoIcon entity
Post by Patrick K. O'Brien
from schevo.schema import *
schevo.schema.prep(locals())
_hidden = True
name = f.unicode()
data = f.image()
_key(name)
Thanks for the tip; no problem creating a new db with it. But as to
updating existing databases, maybe it is traceback time after all.
When I make the change suggested above to a existing schema (that
governs a pre-existing db with data in it) on executing "evo db evolve"
I get:



Schevo tracing is ON. See schevo.trace.__doc__ for more information.
Schevo 3.0-beta2 :: Database Activities :: Evolve Database

Opening the existing database...
Traceback (most recent call last):
File "C:\python24\scripts\evo-script.py", line 7, in ?
sys.exit(
File
"c:\python24\lib\site-packages\schevo-3.0b2dev_r2053-py2.4-win32.egg\sche
vo\script\command.py", line 32, in __call__
return self.main(arg0, args)
File
"c:\python24\lib\site-packages\schevo-3.0b2dev_r2053-py2.4-win32.egg\sche
vo\script\command.py", line 74, in main
return command()(*args)
File
"c:\python24\lib\site-packages\schevo-3.0b2dev_r2053-py2.4-win32.egg\sche
vo\script\command.py", line 32, in __call__
return self.main(arg0, args)
File
"c:\python24\lib\site-packages\schevo-3.0b2dev_r2053-py2.4-win32.egg\sche
vo\script\command.py", line 74, in main
return command()(*args)
File
"c:\python24\lib\site-packages\schevo-3.0b2dev_r2053-py2.4-win32.egg\sche
vo\script\command.py", line 32, in __call__
return self.main(arg0, args)
File
"c:\python24\lib\site-packages\schevo-3.0b2dev_r2053-py2.4-win32.egg\sche
vo\script\db_evolve.py", line 129, in main
db = schevo.database.open(db_filename, schema_source)
File
"c:\python24\lib\site-packages\schevo-3.0b2dev_r2053-py2.4-win32.egg\sche
vo\database.py", line 59, in open
db._sync(schema_source, initialize)
File
"c:\python24\lib\site-packages\schevo-3.0b2dev_r2053-py2.4-win32.egg\sche
vo\database.py", line 1180, in _sync
old_schema_module = self._import_from_source(
File
"c:\python24\lib\site-packages\schevo-3.0b2dev_r2053-py2.4-win32.egg\sche
vo\database.py", line 1094, in _import_from_source
schema_module = module.from_string(source, module_name)
File
"c:\python24\lib\site-packages\schevo-3.0b2dev_r2053-py2.4-win32.egg\sche
vo\lib\module.py", line 37, in from_string
exec code in module.__dict__
File
"schevo-db-schema-0<C:\code\rebel\dependency\py\py-dist\py\code\source.py
:213>", line 11, in ?
ImportError: cannot import name SchevoIcon


On "evo db create", I get:

Schevo 3.0-beta2 :: Database Activities :: Create Database

Traceback (most recent call last):

File "C:\python24\scripts\evo-script.py", line 7, in ?
sys.exit(
File
"c:\python24\lib\site-packages\schevo-3.0b2dev_r2053-py2.4-win32.egg\sche
vo\script\command.py", line 32, in __call__
return self.main(arg0, args)
File
"c:\python24\lib\site-packages\schevo-3.0b2dev_r2053-py2.4-win32.egg\sche
vo\script\command.py", line 74, in main
return command()(*args)
File
"c:\python24\lib\site-packages\schevo-3.0b2dev_r2053-py2.4-win32.egg\sche
vo\script\command.py", line 32, in __call__
return self.main(arg0, args)
File
"c:\python24\lib\site-packages\schevo-3.0b2dev_r2053-py2.4-win32.egg\sche
vo\script\command.py", line 74, in main
return command()(*args)
File
"c:\python24\lib\site-packages\schevo-3.0b2dev_r2053-py2.4-win32.egg\sche
vo\script\command.py", line 32, in __call__
return self.main(arg0, args)
File
"c:\python24\lib\site-packages\schevo-3.0b2dev_r2053-py2.4-win32.egg\sche
vo\script\db_create.py", line 102, in main
schema_filename = os.path.join(schema_path, 'schema_001.py')
File "C:\Python24\lib\ntpath.py", line 90, in join
assert len(path) > 0
TypeError: len() of unsized object
Patrick K. O'Brien
2006-05-30 13:41:31 UTC
Permalink
Post by Patrick K. O'Brien
The simplest way to add icon support is to define the SchevoIcon entity
Post by Patrick K. O'Brien
from schevo.schema import *
schevo.schema.prep(locals())
_hidden = True
name = f.unicode()
data = f.image()
_key(name)
Thanks for the tip; no problem creating a new db with it. But as to
updating existing databases, maybe it is traceback time after all. When
I make the change suggested above to a existing schema (that governs a
This change might be better handled using "schevo db inject ..." but I'd
hold off a little bit longer. We should have an official release of
Schevo very soon now and that will be the best thing to use for a while.
--
Patrick K. O'Brien
Orbtech http://www.orbtech.com
Schevo http://www.schevo.org
Louie http://www.pylouie.org
Loading...