diff --git a/Dockerfile b/Dockerfile index c0e95f90..64c66f83 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,8 @@ -FROM statiskit/ubuntu:trusty +FROM statiskit/ubuntu:pyclanglite # Clone the repository RUN git clone https://github.com/StatisKit/AutoWIG.git $HOME/AutoWIG RUN git -C $HOME/AutoWIG pull -RUN more $HOME/AutoWIG/conda/python-autowig/meta.yaml # Build recipes RUN $HOME/miniconda/bin/conda build $HOME/AutoWIG/conda/python-clang -c statiskit -c conda-forge @@ -11,8 +10,8 @@ RUN $HOME/miniconda/bin/conda build $HOME/AutoWIG/conda/python-autowig -c statis # Create a file for anaconda upload RUN touch $HOME/upload.sh -RUN echo "$HOME/miniconda/bin/anaconda upload `conda build $HOME/AutoWIG/conda/python-clang --output` --user statiskit --force" >> $HOME/upload.sh -RUN echo "$HOME/miniconda/bin/anaconda upload `conda build $HOME/AutoWIG/conda/python-autowig --output` --user statiskit --force" >> $HOME/upload.sh +RUN echo $HOME/miniconda/bin/anaconda upload \`conda build $HOME/AutoWIG/conda/python-clang --output\` --user statiskit --force >> $HOME/upload.sh +RUN echo $HOME/miniconda/bin/anaconda upload \`conda build $HOME/AutoWIG/conda/python-autowig --output\` --user statiskit --force >> $HOME/upload.sh # Install packages RUN $HOME/miniconda/bin/conda install python-autowig -c statiskit -c conda-forge --use-local \ No newline at end of file diff --git a/src/py/autowig/asg.py b/src/py/autowig/asg.py index 92b1f99b..69708057 100644 --- a/src/py/autowig/asg.py +++ b/src/py/autowig/asg.py @@ -1257,7 +1257,7 @@ def declarations(self, pattern=None, inherited=False, access='private'): if basedeclaration.access == 'public': basedeclaration.access = 'protected' elif base.access == 'private': - for basedeclaration in basedeclarations: + for basedeclaration in basedeclarations: basedeclaration.access = 'private' declarations += basedeclarations else: @@ -1437,7 +1437,7 @@ def access(self): accesses = ['none', 'public', 'protected', 'private'] access = accesses.index(getattr(self, '_access', self.specialize.access)) for template in self.templates: - access = max(access, accesses.index(template.desugared_type.unqualified_type.access)) + access = max(access, accesses.index(template.desugared_type.unqualified_type.access)) return accesses[access] @access.setter diff --git a/src/py/autowig/libclang_parser.py b/src/py/autowig/libclang_parser.py index ce8d8922..abf04ba8 100644 --- a/src/py/autowig/libclang_parser.py +++ b/src/py/autowig/libclang_parser.py @@ -592,38 +592,38 @@ def read_tag(asg, cursor, scope): return [spelling] def read_namespace(asg, cursor, scope): - spelling = scope - if spelling.startswith('enum '): - spelling = spelling[5:] - elif spelling.startswith('class '): - spelling = spelling[6:] - elif spelling.startswith('union '): - spelling = spelling[6:] - elif spelling.startswith('struct '): - spelling = spelling[7:] - if not scope.endswith('::'): - spelling = spelling + "::" + cursor.spelling - else: - spelling = spelling + cursor.spelling - if cursor.spelling == '': - children = [] - if not spelling == '::': - spelling = spelling[:-2] - for child in cursor.get_children(): - children.extend(read_cursor(asg, child, spelling)) - read_access(asg, cursor.access_specifier, *children) - return children - else: - if not spelling in asg: - asg._nodes[spelling] = dict(_proxy=NamespaceProxy, - _is_inline=False) # TODO - asg._syntax_edges[spelling] = [] - if not spelling in asg._syntax_edges[scope]: - asg._syntax_edges[scope].append(spelling) - for child in cursor.get_children(): - read_cursor(asg, child, spelling) - read_access(asg, cursor.access_specifier, spelling) - return [spelling] + spelling = scope + if spelling.startswith('enum '): + spelling = spelling[5:] + elif spelling.startswith('class '): + spelling = spelling[6:] + elif spelling.startswith('union '): + spelling = spelling[6:] + elif spelling.startswith('struct '): + spelling = spelling[7:] + if not scope.endswith('::'): + spelling = spelling + "::" + cursor.spelling + else: + spelling = spelling + cursor.spelling + if cursor.spelling == '': + children = [] + if not spelling == '::': + spelling = spelling[:-2] + for child in cursor.get_children(): + children.extend(read_cursor(asg, child, spelling)) + read_access(asg, cursor.access_specifier, *children) + return children + else: + if not spelling in asg: + asg._nodes[spelling] = dict(_proxy=NamespaceProxy, + _is_inline=False) # TODO + asg._syntax_edges[spelling] = [] + if not spelling in asg._syntax_edges[scope]: + asg._syntax_edges[scope].append(spelling) + for child in cursor.get_children(): + read_cursor(asg, child, spelling) + read_access(asg, cursor.access_specifier, spelling) + return [spelling] def read_cursor(asg, cursor, scope): if cursor.kind is CursorKind.UNEXPOSED_DECL: