Changeset 1644

Show
Ignore:
Timestamp:
02/09/09 13:54:21 (4 years ago)
Author:
tbonfort
Message:

move mapserver data to own directory
add default fonts
use only one test mapfile

Location:
sandbox/camptocamp/MapCat
Files:
5 added
1 removed
5 modified
3 moved

Legend:

Unmodified
Added
Removed
  • sandbox/camptocamp/MapCat/data/mapserver/fonts.lst

    r1454 r1644  
    1 sc /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf 
    2 scb /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansCondensed-Bold.ttf 
    3 park park.ttf 
     1sc fonts/DejaVuSans.ttf 
     2scb fonts/DejaVuSansCondensed-Bold.ttf 
     3park fonts/park.ttf 
  • sandbox/camptocamp/MapCat/data/mapserver/fonts/park.ttf

  • sandbox/camptocamp/MapCat/data/mapserver/symbols.sym

  • sandbox/camptocamp/MapCat/development.ini

    r1642 r1644  
    3535# mapfiles dir path  
    3636mapfiles_dir = %(here)s/data/mapfiles 
     37mapserver_dir = %(here)s/data/mapserver 
    3738 
    3839# path to the template including the <script> tags 
  • sandbox/camptocamp/MapCat/mapcat/tests/functional/test_mapfiles.py

    r1596 r1644  
    8181 
    8282        mapfile = Mapfile() 
    83         mapfile.from_file(os.path.join(config['mapfiles_dir'], 'test/test1.map')) 
    84         mapfile = self._change_to_valid_fontset(mapfile) 
     83        mapfile.from_file(os.path.join(config['mapfiles_dir'], 'dummy_mapfile.map')) 
     84        mapfile = self._change_mapfile_paths(mapfile) 
    8585        dict = mapfile.to_dict() 
    8686        content = simplejson.dumps(dict) 
     
    108108 
    109109        mapfile = Mapfile() 
    110         mapfile.from_file(os.path.join(config['mapfiles_dir'], 'test/test1.map')) 
    111         mapfile = self._change_to_valid_fontset(mapfile) 
     110        mapfile.from_file(os.path.join(config['mapfiles_dir'], 'dummy_mapfile.map')) 
     111        mapfile = self._change_mapfile_paths(mapfile) 
    112112        dict = mapfile.to_dict() 
    113113        content = simplejson.dumps(dict) 
     
    154154        # so that it matches user environnement 
    155155        mapfile = Mapfile() 
    156         mapfile.from_file(os.path.join(config['mapfiles_dir'], 'test/test1.map')) 
    157         mapfile = self._change_to_valid_fontset(mapfile) 
     156        mapfile.from_file(os.path.join(config['mapfiles_dir'], 'dummy_mapfile.map')) 
     157        mapfile = self._change_mapfile_paths(mapfile) 
    158158        mapfile.to_file(os.path.join(config['mapfiles_dir'], nose_map_test['filepath'])) 
    159159        assert os.path.exists(os.path.join(config['mapfiles_dir'], nose_map_test['filepath'])) 
     
    164164        nose_map_test['id'] = map.id 
    165165 
    166     def _change_to_valid_fontset(self, mapfile): 
     166    def _change_mapfile_paths(self, mapfile): 
    167167        # change fontset path so that it matches user environnement 
    168168        dict = mapfile.to_dict() 
    169         dict['fontset'] = os.path.join(config['mapfiles_dir'], 'test', dict['fontset']) 
     169        dict['fontset'] = os.path.join(config['mapserver_dir'],"fonts.lst") 
     170        dict['symbolset'] = os.path.join(config['mapserver_dir'],"symbols.sym") 
    170171        mapfile.from_dict(dict) 
    171172        return mapfile 
  • sandbox/camptocamp/MapCat/mapcat/tests/test_mapfile_parser.py

    r1596 r1644  
    124124    map = mapscript.mapObj() 
    125125    map.setExtent(-90,-180,90,180) 
    126     map.setFontSet(config['mapfiles_dir']+'/test/fonts.lst') 
     126    map.setFontSet(config['mapserver_dir']+'/fonts.lst') 
    127127    map.setSize(400,300) 
    128128    map.imagecolor.setHex("#00ff00") 
     
    132132    map.setProjection('+init=epsg:27572') 
    133133    map.resolution = 73 
    134     map.setSymbolSet(config['mapfiles_dir']+'/test/symbols.sym') 
     134    map.setSymbolSet(config['mapserver_dir']+'/symbols.sym') 
    135135    map.units = mapscript.MS_KILOMETERS 
    136136    map.web.metadata.set("foo","bar") 
  • sandbox/camptocamp/MapCat/mapcat/websetup.py

    r1642 r1644  
    7070 
    7171def _create_mapfile(): 
    72     # copy test mapfile test1.map and change fontset path 
    73     # so that it matches user environnement 
    74     mapfile = Mapfile() 
    75     mapfile.from_file(os.path.join(config['mapfiles_dir'], 'test/test1.map')) 
    76     mapfile = _change_to_valid_paths(mapfile) 
    77     mapfile.to_file(os.path.join(config['mapfiles_dir'], 'dummy_mapfile.map')) 
    7872    # db insertion of new mapfile 
    7973    map = model.Map('dummy_mapfile', 'dummy_mapfile.map', 1) 
    8074    model.meta.Session.add(map) 
    8175    model.meta.Session.commit() 
    82  
    83 def _change_to_valid_paths(mapfile): 
    84     # change symbolset and fontset path so that it matches user environnement 
    85     dict = mapfile.to_dict() 
    86     dict['symbolset'] = os.path.join(config['mapfiles_dir'], 'test', dict['symbolset']) 
    87     dict['fontset'] = os.path.join(config['mapfiles_dir'], 'test', dict['fontset']) 
    88     mapfile.from_dict(dict) 
    89     return mapfile 
    9076 
    9177def _merge_js(input_file, input_dir, output_file): 
     
    9581    merge_js.main(input_file, input_dir, output_file) 
    9682 
    97  
    98  
  • sandbox/camptocamp/MapCat/test.ini

    r1642 r1644  
    3535# mapfiles dir path  
    3636mapfiles_dir = %(here)s/data/mapfiles 
     37mapserver_dir = %(here)s/data/mapserver 
    3738 
    3839# path to the template including the <script> tags