~c-e-pidcott/maus/devel

« back to all changes in this revision

Viewing changes to src/map/MapPyFakeTestSimulation/MapPyFakeTestSimulation.py

  • Committer: Chris Rogers
  • Date: 2011-11-04 16:46:18 UTC
  • mfrom: (656.1.27 maus-trunk3)
  • Revision ID: chris.rogers@stfc.ac.uk-20111104164618-4gaisprgsgivebix
Changes for release 0.1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- coding: utf-8 -*-
1
2
#  This file is part of MAUS: http://micewww.pp.rl.ac.uk:8080/projects/maus
2
3
3
4
#  MAUS is free software: you can redistribute it and/or modify
26
27
import os
27
28
 
28
29
class MapPyFakeTestSimulation:
 
30
    """ ___ """ 
29
31
    def birth(self, configJSON):
 
32
        """ Setting env variables and prototype json file """
30
33
        config = json.loads(configJSON)
31
 
        
 
34
 
32
35
        root_dir = os.environ.get("MAUS_ROOT_DIR")
33
36
        assert root_dir != None
34
37
        assert os.path.isdir(root_dir)
35
38
 
36
 
        self._filename = '%s/src/map/MapPyFakeTestSimulation/mausput_with_tracks'  % root_dir
 
39
        self._filename = \
 
40
        '%s/src/map/MapPyFakeTestSimulation/mausput_digits' % root_dir
37
41
        assert os.path.isfile(self._filename)
38
42
 
39
43
        self._file = open(self._filename, 'r')
40
44
        self._document = self._file.readline().rstrip()
41
45
        self._file.close()
42
 
        
 
46
 
43
47
        return True
44
48
 
45
49
    def process(self, str):
 
50
        """ The process """
46
51
        return self._document
47
52
 
48
53
    def death(self):
 
54
        """ Destructor """
49
55
        return True
50
56