Skip to content

Commit

Permalink
Merge pull request #37 from pfernique/master
Browse files Browse the repository at this point in the history
Improve health
  • Loading branch information
pfernique committed Aug 19, 2016
2 parents 77c3ee0 + 86cf58b commit 505c315
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 38 deletions.
7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
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
RUN $HOME/miniconda/bin/conda build $HOME/AutoWIG/conda/python-autowig -c statiskit -c conda-forge

# 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
4 changes: 2 additions & 2 deletions src/py/autowig/asg.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
64 changes: 32 additions & 32 deletions src/py/autowig/libclang_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 505c315

Please sign in to comment.