Revision: 3520
Author: jussi.ao.malinen
Date: Wed May 26 00:43:23 2010
Log: removed old resourcefile from parsing
http://code.google.com/p/robotframework/source/detail?r=3520
Deleted:
/trunk/src/robot/parsing/resourcefile.py
=======================================
--- /trunk/src/robot/parsing/resourcefile.py Thu May 20 05:09:39 2010
+++ /dev/null
@@ -1,49 +0,0 @@
-# Copyright 2008-2009 Nokia Siemens Networks Oyj
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-from robot import utils
-from robot.errors import DataError
-
-from rawdata import RawData
-from userkeyword import UserHandlerList
-
-# FIXME: update to new model
-class ResourceFile:
-
- def __init__(self, path):
- self.source = utils.normpath(path)
- rawdata = RawData(self.source)
- if rawdata.get_type() != rawdata.RESOURCE:
- self._raise_not_resource(rawdata)
- self.user_keywords = UserHandlerList(rawdata.keywords)
- self.variables = rawdata.variables
- self.imports = []
- self.doc = ''
- for item in rawdata.settings:
- if utils.eq_any(item.name,
['Library', 'Resource', 'Variables']):
- self.imports.append(ImportSetting(item))
- elif utils.eq(item.name, 'Documentation'):
- self.doc = ' '.join(item.value)
- else:
- msg = "Only settings 'Library', 'Resource', 'Variables'
and " \
- + "'Documentation' allowed in resource files.
Found: %s"
- item.report_invalid_syntax(msg % item.name)
-
- def _raise_not_resource(self, rawdata):
- if rawdata.get_type() == rawdata.EMPTY:
- msg = "Parsed file '%s' contains no resources"
- else:
- msg = "Parsed file '%s' is not a resource file"
- raise DataError(msg % rawdata.source)