summaryrefslogtreecommitdiff
path: root/source4/pidl/lib/Parse/Pidl
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-05-22 13:00:04 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-05-23 04:21:34 +0200
commita9c96b2e7b9d7d894b194d520e4925e772ca0247 (patch)
tree58ad2db59d7efabe5d2ac279d52e4b3fdc7c0b9d /source4/pidl/lib/Parse/Pidl
parent6ccb9785e7e1b2374a0121b5c70a2969b120a926 (diff)
downloadsamba-a9c96b2e7b9d7d894b194d520e4925e772ca0247.tar.gz
samba-a9c96b2e7b9d7d894b194d520e4925e772ca0247.tar.bz2
samba-a9c96b2e7b9d7d894b194d520e4925e772ca0247.zip
Fix indentation.
(This used to be commit 5c3d4fce06ae07663632cc50d9703ddbc728c737)
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl')
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4/Python.pm25
1 files changed, 16 insertions, 9 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm b/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm
index 884ee1d822..88f2daa3b8 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm
@@ -203,7 +203,7 @@ sub PythonStruct($$$$$$)
$self->pidl("return 0;");
$self->deindent;
$self->pidl("}");
- $self->pidl("");
+ $self->pidl("");
}
$getsetters = "py_$name\_getsetters";
@@ -253,6 +253,20 @@ sub PythonStruct($$$$$$)
return "&$typeobject";
}
+sub get_metadata_var($)
+{
+ my ($e) = @_;
+ sub get_var($) { my $x = shift; $x =~ s/\*//g; return $x; }
+
+ if (has_property($e, "length_is")) {
+ return get_var($e->{PROPERTIES}->{length_is});
+ } elsif (has_property($e, "size_is")) {
+ return get_var($e->{PROPERTIES}->{size_is});
+ }
+
+ return undef;
+}
+
sub PythonFunctionBody($$$)
{
my ($self, $fn, $iface, $prettyname) = @_;
@@ -274,17 +288,10 @@ sub PythonFunctionBody($$$)
my $metadata_args = { in => {}, out => {} };
- sub get_var($) { my $x = shift; $x =~ s/\*//g; return $x; }
-
# Determine arguments that are metadata for other arguments (size_is/length_is)
foreach my $e (@{$fn->{ELEMENTS}}) {
foreach my $dir (@{$e->{DIRECTION}}) {
- my $main = undef;
- if (has_property($e, "length_is")) {
- $main = get_var($e->{PROPERTIES}->{length_is});
- } elsif (has_property($e, "size_is")) {
- $main = get_var($e->{PROPERTIES}->{size_is});
- }
+ my $main = get_metadata_var($e);
if ($main) {
$metadata_args->{$dir}->{$main} = $e->{NAME};
}