srcparser.py split mixed windows path with os.path.split

-fixes #2997
This commit is contained in:
Daniel Agar 2015-10-15 14:41:49 -04:00
parent 3105b49b22
commit 7d63920f25
2 changed files with 4 additions and 2 deletions

View File

@ -1,5 +1,6 @@
from xml.sax.saxutils import escape
import codecs
import os
class RCOutput():
def __init__(self, groups, board):
@ -30,7 +31,7 @@ class RCOutput():
for group in groups:
result += "# GROUP: %s\n\n" % group.GetName()
for param in group.GetParams():
path = param.GetPath().rsplit('/', 1)[1]
path = os.path.split(param.GetPath())[1]
id_val = param.GetId()
name = param.GetFieldValue("short_desc")
long_desc = param.GetFieldValue("long_desc")

View File

@ -1,5 +1,6 @@
import sys
import re
import os
class ParameterGroup(object):
"""
@ -160,7 +161,7 @@ class SourceParser(object):
"""
airframe_id = None
airframe_id = path.rsplit('/',1)[1].split('_',1)[0]
airframe_id = os.path.split(path)[1].split('_',1)[0]
# Skip if not numeric
if (not self.IsNumber(airframe_id)):