2013-12-09 3 views
0

Redhawk 1.9를 사용하고 있습니다. 1.8.4 IDE에서 Redhawk 장치를 만들었습니다. (모든 기본 설정으로 생성)Redhawk 장치를 1.8.4에서 1.9로 변환 할 때 변환 오류가 발생했습니다.

  • 1.8.4 Redhawk이 장치
  • C++ 구현
  • 가져 오기 기존 프로젝트
  • IDE 1.9에 나는 1.8.4 사이의 변환하는 방법에 대한 Redhawk이 1.9 릴리스 노트를 읽어 및 1.9 프로젝트 * *

1.9 IDE로 기본 1.8.4 장치를 가져옵니다. 1.9 IDE에서 1.8.4 장치를 실행하고 빌드 할 수 있습니다. 1.8.4 장치 용 코드를 다시 생성하려고하면 IDE에서 1.9로 업그레이드할지 묻습니다. 팝업에서 "ConversionTestDevice는 사용되지 않는 코드 생성기를 사용합니다.이 프로젝트를 업그레이드 하시겠습니까?" 나는 업그레이드를하기로 결정했다. 그때 나는 다음과 같은 오류 메시지가 : 파일 "/ usr/지방/Redhawk이 :

/usr/지방/Redhawk이/코어/빈/update_project 오류 코드 1

역 추적 (마지막으로 가장 최근 통화)로 반환/core/bin/update_project ", 222 행에? if check_bulkio_input (compCpp) : check_bulkio_input의 105 행에있는 "/ usr/local/redhawk/core/bin/update_project"파일 strip_comments (open (filename, 'r'))의 행 : 파일 "/ usr/usr/local/redhawk/core/bin/update_project "줄 56, safe_next에있는 파일 chlo = safe_next (문자) 다음 반환 (항목) NameError : 글로벌 이름 'next'가 정의되지 않았습니다.

1.8.4 장치를 1.9 장치로 변환하는 방법에 대한 제안을 부탁드립니다.

+0

update_project python 스크립트가 Python 2.4.3 버전과 호환되지 않는 것으로 나타났습니다. 이 버전의 python은 반복기에서 다음 명령을 인식하지 못하는 것으로 보입니다. 최신 버전의 Python을 시도 할 때 업그레이드 스크립트가 예상대로 작동했습니다. –

+0

파이썬 2.4.3 버전과 함께 제공되는 CentOS 5.3을 사용하고있었습니다. –

답변

0

오류 메시지 "NameError : 글로벌 이름 '다음'이 정의되어 있지 않습니다. '및 update_project python 스크립트의 1.9.0 릴리스 내용을 기반으로 사용자가 Python 버전 2.6 미만을 실행 중이라고 가정합니다. 다음 함수는 파이썬 2.6 (http://docs.python.org/2/library/functions.html#next)에서 소개 된 파이썬 내장 함수입니다. 이것은 Python 2.6뿐만 아니라 Python 2.4 (CentOS 5와 6 각각 기본 Python 설치)와 호환되어야하므로 업그레이드 스크립트의 알려진 버그입니다. 이 문제를 해결하려면, 당신은 $ OSSIEHOME/빈/update_project에있는 update_project 스크립트를 수정하고 다음 함수를 정의 할 수 있습니다 : 당신은 다음 이전에 정의 된 "safe_next"기능을 제거해야합니다

if not hasattr(__builtins__, 'next'): 
    # Python 2.4 does not have a free-standing next() function 
    def next(iterator, default): 
     """ 
     Backwards compatibility next() equivalent for Python 2.4. 
     """ 
     try: 
      return iterator.next() 
     except StopIteration: 
      return default 

.

마지막으로, 당신은 새로 빈 문자열 ''명확성을 위해

, 이러한 변화와 update_project의 DIFF의 두 번째 인수를 다음 기능을 구현하고 추가를 호출 두 통화에서 "safe_next"를 교체해야

@@ -46,16 +46,16 @@ Options: 

_bulkio_re = re.compile('BULKIO_data[A-Za-z]+_In_i') 

-def safe_next(item): 
- """ 
- Returns the next value of the iterator, or an empty string if the end of 
- iteration has been reached. Allows string processing to gracefully handle 
- the end of a line without explicit catch statements. 
- """ 
- try: 
-  return next(item) 
- except StopIteration: 
-  return '' 
+if not hasattr(__builtins__, 'next'): 
+ # Python 2.4 does not have a free-standing next() function 
+ def next(iterator, default): 
+  """ 
+  Backwards compatibility next() equivalent for Python 2.4. 
+  """ 
+  try: 
+   return iterator.next() 
+  except StopIteration: 
+   return default 

def strip_comments(source): 
    """ 
@@ -75,7 +75,7 @@ def strip_comments(source): 
       # Look for end comment token; if the end of the line is reached 
       # ch will be an empty string 
       while ch == '*': 
-     ch = safe_next(chars) 
+     ch = next(chars, '') 
        if ch == '/': 
         inComment = False 
         break 
@@ -83,7 +83,7 @@ def strip_comments(source): 
      if ch == '/': 
       # Read the next character to see if it matches a comment token 
       # (if it does not, both characters will be added to the output) 
-    ch += safe_next(chars) 
+    ch += next(chars, '') 
       if ch == '/*': 
        # Comment, start discarding 
        inComment = True 
관련 문제