~nchohan/appscale/zk3.3.4

« back to all changes in this revision

Viewing changes to AppServer/google/appengine/api/images/images_service_pb.py

  • Committer: Chris Bunch
  • Date: 2012-02-17 08:19:21 UTC
  • mfrom: (787.2.3 appscale-raj-merge)
  • Revision ID: cgb@cs.ucsb.edu-20120217081921-pakidyksaenlpzur
merged with main branch, gaining rabbitmq and upgrades for hbase, cassandra, and hypertable, as well as upgrading to gae 1.6.1 for python and go

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
__pychecker__ = """maxreturns=0 maxbranches=0 no-callinit
25
25
                   unusednames=printElemNumber,debug_strs no-special"""
26
26
 
 
27
if hasattr(ProtocolBuffer, 'ExtendableProtocolMessage'):
 
28
  _extension_runtime = True
 
29
  _ExtendableProtocolMessage = ProtocolBuffer.ExtendableProtocolMessage
 
30
else:
 
31
  _extension_runtime = False
 
32
  _ExtendableProtocolMessage = ProtocolBuffer.ProtocolMessage
 
33
 
27
34
class ImagesServiceError(ProtocolBuffer.ProtocolMessage):
28
35
 
29
36
 
109
116
 
110
117
  _STYLE = """"""
111
118
  _STYLE_CONTENT_TYPE = """"""
 
119
  _PROTO_DESCRIPTOR_NAME = 'apphosting.ImagesServiceError'
112
120
class ImagesServiceTransform(ProtocolBuffer.ProtocolMessage):
113
121
 
114
122
 
194
202
 
195
203
  _STYLE = """"""
196
204
  _STYLE_CONTENT_TYPE = """"""
 
205
  _PROTO_DESCRIPTOR_NAME = 'apphosting.ImagesServiceTransform'
197
206
class Transform(ProtocolBuffer.ProtocolMessage):
198
207
  has_width_ = 0
199
208
  width_ = 0
200
209
  has_height_ = 0
201
210
  height_ = 0
 
211
  has_crop_to_fit_ = 0
 
212
  crop_to_fit_ = 0
 
213
  has_crop_offset_x_ = 0
 
214
  crop_offset_x_ = 0.5
 
215
  has_crop_offset_y_ = 0
 
216
  crop_offset_y_ = 0.5
202
217
  has_rotate_ = 0
203
218
  rotate_ = 0
204
219
  has_horizontal_flip_ = 0
245
260
 
246
261
  def has_height(self): return self.has_height_
247
262
 
 
263
  def crop_to_fit(self): return self.crop_to_fit_
 
264
 
 
265
  def set_crop_to_fit(self, x):
 
266
    self.has_crop_to_fit_ = 1
 
267
    self.crop_to_fit_ = x
 
268
 
 
269
  def clear_crop_to_fit(self):
 
270
    if self.has_crop_to_fit_:
 
271
      self.has_crop_to_fit_ = 0
 
272
      self.crop_to_fit_ = 0
 
273
 
 
274
  def has_crop_to_fit(self): return self.has_crop_to_fit_
 
275
 
 
276
  def crop_offset_x(self): return self.crop_offset_x_
 
277
 
 
278
  def set_crop_offset_x(self, x):
 
279
    self.has_crop_offset_x_ = 1
 
280
    self.crop_offset_x_ = x
 
281
 
 
282
  def clear_crop_offset_x(self):
 
283
    if self.has_crop_offset_x_:
 
284
      self.has_crop_offset_x_ = 0
 
285
      self.crop_offset_x_ = 0.5
 
286
 
 
287
  def has_crop_offset_x(self): return self.has_crop_offset_x_
 
288
 
 
289
  def crop_offset_y(self): return self.crop_offset_y_
 
290
 
 
291
  def set_crop_offset_y(self, x):
 
292
    self.has_crop_offset_y_ = 1
 
293
    self.crop_offset_y_ = x
 
294
 
 
295
  def clear_crop_offset_y(self):
 
296
    if self.has_crop_offset_y_:
 
297
      self.has_crop_offset_y_ = 0
 
298
      self.crop_offset_y_ = 0.5
 
299
 
 
300
  def has_crop_offset_y(self): return self.has_crop_offset_y_
 
301
 
248
302
  def rotate(self): return self.rotate_
249
303
 
250
304
  def set_rotate(self, x):
354
408
    assert x is not self
355
409
    if (x.has_width()): self.set_width(x.width())
356
410
    if (x.has_height()): self.set_height(x.height())
 
411
    if (x.has_crop_to_fit()): self.set_crop_to_fit(x.crop_to_fit())
 
412
    if (x.has_crop_offset_x()): self.set_crop_offset_x(x.crop_offset_x())
 
413
    if (x.has_crop_offset_y()): self.set_crop_offset_y(x.crop_offset_y())
357
414
    if (x.has_rotate()): self.set_rotate(x.rotate())
358
415
    if (x.has_horizontal_flip()): self.set_horizontal_flip(x.horizontal_flip())
359
416
    if (x.has_vertical_flip()): self.set_vertical_flip(x.vertical_flip())
369
426
    if self.has_width_ and self.width_ != x.width_: return 0
370
427
    if self.has_height_ != x.has_height_: return 0
371
428
    if self.has_height_ and self.height_ != x.height_: return 0
 
429
    if self.has_crop_to_fit_ != x.has_crop_to_fit_: return 0
 
430
    if self.has_crop_to_fit_ and self.crop_to_fit_ != x.crop_to_fit_: return 0
 
431
    if self.has_crop_offset_x_ != x.has_crop_offset_x_: return 0
 
432
    if self.has_crop_offset_x_ and self.crop_offset_x_ != x.crop_offset_x_: return 0
 
433
    if self.has_crop_offset_y_ != x.has_crop_offset_y_: return 0
 
434
    if self.has_crop_offset_y_ and self.crop_offset_y_ != x.crop_offset_y_: return 0
372
435
    if self.has_rotate_ != x.has_rotate_: return 0
373
436
    if self.has_rotate_ and self.rotate_ != x.rotate_: return 0
374
437
    if self.has_horizontal_flip_ != x.has_horizontal_flip_: return 0
395
458
    n = 0
396
459
    if (self.has_width_): n += 1 + self.lengthVarInt64(self.width_)
397
460
    if (self.has_height_): n += 1 + self.lengthVarInt64(self.height_)
 
461
    if (self.has_crop_to_fit_): n += 2
 
462
    if (self.has_crop_offset_x_): n += 5
 
463
    if (self.has_crop_offset_y_): n += 5
398
464
    if (self.has_rotate_): n += 1 + self.lengthVarInt64(self.rotate_)
399
465
    if (self.has_horizontal_flip_): n += 2
400
466
    if (self.has_vertical_flip_): n += 2
409
475
    n = 0
410
476
    if (self.has_width_): n += 1 + self.lengthVarInt64(self.width_)
411
477
    if (self.has_height_): n += 1 + self.lengthVarInt64(self.height_)
 
478
    if (self.has_crop_to_fit_): n += 2
 
479
    if (self.has_crop_offset_x_): n += 5
 
480
    if (self.has_crop_offset_y_): n += 5
412
481
    if (self.has_rotate_): n += 1 + self.lengthVarInt64(self.rotate_)
413
482
    if (self.has_horizontal_flip_): n += 2
414
483
    if (self.has_vertical_flip_): n += 2
422
491
  def Clear(self):
423
492
    self.clear_width()
424
493
    self.clear_height()
 
494
    self.clear_crop_to_fit()
 
495
    self.clear_crop_offset_x()
 
496
    self.clear_crop_offset_y()
425
497
    self.clear_rotate()
426
498
    self.clear_horizontal_flip()
427
499
    self.clear_vertical_flip()
462
534
    if (self.has_autolevels_):
463
535
      out.putVarInt32(80)
464
536
      out.putBoolean(self.autolevels_)
 
537
    if (self.has_crop_to_fit_):
 
538
      out.putVarInt32(88)
 
539
      out.putBoolean(self.crop_to_fit_)
 
540
    if (self.has_crop_offset_x_):
 
541
      out.putVarInt32(101)
 
542
      out.putFloat(self.crop_offset_x_)
 
543
    if (self.has_crop_offset_y_):
 
544
      out.putVarInt32(109)
 
545
      out.putFloat(self.crop_offset_y_)
465
546
 
466
547
  def OutputPartial(self, out):
467
548
    if (self.has_width_):
494
575
    if (self.has_autolevels_):
495
576
      out.putVarInt32(80)
496
577
      out.putBoolean(self.autolevels_)
 
578
    if (self.has_crop_to_fit_):
 
579
      out.putVarInt32(88)
 
580
      out.putBoolean(self.crop_to_fit_)
 
581
    if (self.has_crop_offset_x_):
 
582
      out.putVarInt32(101)
 
583
      out.putFloat(self.crop_offset_x_)
 
584
    if (self.has_crop_offset_y_):
 
585
      out.putVarInt32(109)
 
586
      out.putFloat(self.crop_offset_y_)
497
587
 
498
588
  def TryMerge(self, d):
499
589
    while d.avail() > 0:
528
618
      if tt == 80:
529
619
        self.set_autolevels(d.getBoolean())
530
620
        continue
 
621
      if tt == 88:
 
622
        self.set_crop_to_fit(d.getBoolean())
 
623
        continue
 
624
      if tt == 101:
 
625
        self.set_crop_offset_x(d.getFloat())
 
626
        continue
 
627
      if tt == 109:
 
628
        self.set_crop_offset_y(d.getFloat())
 
629
        continue
531
630
 
532
631
 
533
632
      if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
538
637
    res=""
539
638
    if self.has_width_: res+=prefix+("width: %s\n" % self.DebugFormatInt32(self.width_))
540
639
    if self.has_height_: res+=prefix+("height: %s\n" % self.DebugFormatInt32(self.height_))
 
640
    if self.has_crop_to_fit_: res+=prefix+("crop_to_fit: %s\n" % self.DebugFormatBool(self.crop_to_fit_))
 
641
    if self.has_crop_offset_x_: res+=prefix+("crop_offset_x: %s\n" % self.DebugFormatFloat(self.crop_offset_x_))
 
642
    if self.has_crop_offset_y_: res+=prefix+("crop_offset_y: %s\n" % self.DebugFormatFloat(self.crop_offset_y_))
541
643
    if self.has_rotate_: res+=prefix+("rotate: %s\n" % self.DebugFormatInt32(self.rotate_))
542
644
    if self.has_horizontal_flip_: res+=prefix+("horizontal_flip: %s\n" % self.DebugFormatBool(self.horizontal_flip_))
543
645
    if self.has_vertical_flip_: res+=prefix+("vertical_flip: %s\n" % self.DebugFormatBool(self.vertical_flip_))
554
656
 
555
657
  kwidth = 1
556
658
  kheight = 2
 
659
  kcrop_to_fit = 11
 
660
  kcrop_offset_x = 12
 
661
  kcrop_offset_y = 13
557
662
  krotate = 3
558
663
  khorizontal_flip = 4
559
664
  kvertical_flip = 5
575
680
    8: "crop_right_x",
576
681
    9: "crop_bottom_y",
577
682
    10: "autolevels",
578
 
  }, 10)
 
683
    11: "crop_to_fit",
 
684
    12: "crop_offset_x",
 
685
    13: "crop_offset_y",
 
686
  }, 13)
579
687
 
580
688
  _TYPES = _BuildTagLookupTable({
581
689
    0: ProtocolBuffer.Encoder.NUMERIC,
589
697
    8: ProtocolBuffer.Encoder.FLOAT,
590
698
    9: ProtocolBuffer.Encoder.FLOAT,
591
699
    10: ProtocolBuffer.Encoder.NUMERIC,
592
 
  }, 10, ProtocolBuffer.Encoder.MAX_TYPE)
 
700
    11: ProtocolBuffer.Encoder.NUMERIC,
 
701
    12: ProtocolBuffer.Encoder.FLOAT,
 
702
    13: ProtocolBuffer.Encoder.FLOAT,
 
703
  }, 13, ProtocolBuffer.Encoder.MAX_TYPE)
593
704
 
594
705
 
595
706
  _STYLE = """"""
596
707
  _STYLE_CONTENT_TYPE = """"""
 
708
  _PROTO_DESCRIPTOR_NAME = 'apphosting.Transform'
597
709
class ImageData(ProtocolBuffer.ProtocolMessage):
598
710
  has_content_ = 0
599
711
  content_ = ""
727
839
 
728
840
  _STYLE = """"""
729
841
  _STYLE_CONTENT_TYPE = """"""
 
842
  _PROTO_DESCRIPTOR_NAME = 'apphosting.ImageData'
 
843
class InputSettings(ProtocolBuffer.ProtocolMessage):
 
844
 
 
845
 
 
846
  UNCHANGED_ORIENTATION =    0
 
847
  CORRECT_ORIENTATION =    1
 
848
 
 
849
  _ORIENTATION_CORRECTION_TYPE_NAMES = {
 
850
    0: "UNCHANGED_ORIENTATION",
 
851
    1: "CORRECT_ORIENTATION",
 
852
  }
 
853
 
 
854
  def ORIENTATION_CORRECTION_TYPE_Name(cls, x): return cls._ORIENTATION_CORRECTION_TYPE_NAMES.get(x, "")
 
855
  ORIENTATION_CORRECTION_TYPE_Name = classmethod(ORIENTATION_CORRECTION_TYPE_Name)
 
856
 
 
857
  has_correct_exif_orientation_ = 0
 
858
  correct_exif_orientation_ = 0
 
859
  has_parse_metadata_ = 0
 
860
  parse_metadata_ = 0
 
861
 
 
862
  def __init__(self, contents=None):
 
863
    if contents is not None: self.MergeFromString(contents)
 
864
 
 
865
  def correct_exif_orientation(self): return self.correct_exif_orientation_
 
866
 
 
867
  def set_correct_exif_orientation(self, x):
 
868
    self.has_correct_exif_orientation_ = 1
 
869
    self.correct_exif_orientation_ = x
 
870
 
 
871
  def clear_correct_exif_orientation(self):
 
872
    if self.has_correct_exif_orientation_:
 
873
      self.has_correct_exif_orientation_ = 0
 
874
      self.correct_exif_orientation_ = 0
 
875
 
 
876
  def has_correct_exif_orientation(self): return self.has_correct_exif_orientation_
 
877
 
 
878
  def parse_metadata(self): return self.parse_metadata_
 
879
 
 
880
  def set_parse_metadata(self, x):
 
881
    self.has_parse_metadata_ = 1
 
882
    self.parse_metadata_ = x
 
883
 
 
884
  def clear_parse_metadata(self):
 
885
    if self.has_parse_metadata_:
 
886
      self.has_parse_metadata_ = 0
 
887
      self.parse_metadata_ = 0
 
888
 
 
889
  def has_parse_metadata(self): return self.has_parse_metadata_
 
890
 
 
891
 
 
892
  def MergeFrom(self, x):
 
893
    assert x is not self
 
894
    if (x.has_correct_exif_orientation()): self.set_correct_exif_orientation(x.correct_exif_orientation())
 
895
    if (x.has_parse_metadata()): self.set_parse_metadata(x.parse_metadata())
 
896
 
 
897
  def Equals(self, x):
 
898
    if x is self: return 1
 
899
    if self.has_correct_exif_orientation_ != x.has_correct_exif_orientation_: return 0
 
900
    if self.has_correct_exif_orientation_ and self.correct_exif_orientation_ != x.correct_exif_orientation_: return 0
 
901
    if self.has_parse_metadata_ != x.has_parse_metadata_: return 0
 
902
    if self.has_parse_metadata_ and self.parse_metadata_ != x.parse_metadata_: return 0
 
903
    return 1
 
904
 
 
905
  def IsInitialized(self, debug_strs=None):
 
906
    initialized = 1
 
907
    return initialized
 
908
 
 
909
  def ByteSize(self):
 
910
    n = 0
 
911
    if (self.has_correct_exif_orientation_): n += 1 + self.lengthVarInt64(self.correct_exif_orientation_)
 
912
    if (self.has_parse_metadata_): n += 2
 
913
    return n
 
914
 
 
915
  def ByteSizePartial(self):
 
916
    n = 0
 
917
    if (self.has_correct_exif_orientation_): n += 1 + self.lengthVarInt64(self.correct_exif_orientation_)
 
918
    if (self.has_parse_metadata_): n += 2
 
919
    return n
 
920
 
 
921
  def Clear(self):
 
922
    self.clear_correct_exif_orientation()
 
923
    self.clear_parse_metadata()
 
924
 
 
925
  def OutputUnchecked(self, out):
 
926
    if (self.has_correct_exif_orientation_):
 
927
      out.putVarInt32(8)
 
928
      out.putVarInt32(self.correct_exif_orientation_)
 
929
    if (self.has_parse_metadata_):
 
930
      out.putVarInt32(16)
 
931
      out.putBoolean(self.parse_metadata_)
 
932
 
 
933
  def OutputPartial(self, out):
 
934
    if (self.has_correct_exif_orientation_):
 
935
      out.putVarInt32(8)
 
936
      out.putVarInt32(self.correct_exif_orientation_)
 
937
    if (self.has_parse_metadata_):
 
938
      out.putVarInt32(16)
 
939
      out.putBoolean(self.parse_metadata_)
 
940
 
 
941
  def TryMerge(self, d):
 
942
    while d.avail() > 0:
 
943
      tt = d.getVarInt32()
 
944
      if tt == 8:
 
945
        self.set_correct_exif_orientation(d.getVarInt32())
 
946
        continue
 
947
      if tt == 16:
 
948
        self.set_parse_metadata(d.getBoolean())
 
949
        continue
 
950
 
 
951
 
 
952
      if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
 
953
      d.skipData(tt)
 
954
 
 
955
 
 
956
  def __str__(self, prefix="", printElemNumber=0):
 
957
    res=""
 
958
    if self.has_correct_exif_orientation_: res+=prefix+("correct_exif_orientation: %s\n" % self.DebugFormatInt32(self.correct_exif_orientation_))
 
959
    if self.has_parse_metadata_: res+=prefix+("parse_metadata: %s\n" % self.DebugFormatBool(self.parse_metadata_))
 
960
    return res
 
961
 
 
962
 
 
963
  def _BuildTagLookupTable(sparse, maxtag, default=None):
 
964
    return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
 
965
 
 
966
  kcorrect_exif_orientation = 1
 
967
  kparse_metadata = 2
 
968
 
 
969
  _TEXT = _BuildTagLookupTable({
 
970
    0: "ErrorCode",
 
971
    1: "correct_exif_orientation",
 
972
    2: "parse_metadata",
 
973
  }, 2)
 
974
 
 
975
  _TYPES = _BuildTagLookupTable({
 
976
    0: ProtocolBuffer.Encoder.NUMERIC,
 
977
    1: ProtocolBuffer.Encoder.NUMERIC,
 
978
    2: ProtocolBuffer.Encoder.NUMERIC,
 
979
  }, 2, ProtocolBuffer.Encoder.MAX_TYPE)
 
980
 
 
981
 
 
982
  _STYLE = """"""
 
983
  _STYLE_CONTENT_TYPE = """"""
 
984
  _PROTO_DESCRIPTOR_NAME = 'apphosting.InputSettings'
730
985
class OutputSettings(ProtocolBuffer.ProtocolMessage):
731
986
 
732
987
 
733
988
  PNG          =    0
734
989
  JPEG         =    1
 
990
  WEBP         =    2
735
991
 
736
992
  _MIME_TYPE_NAMES = {
737
993
    0: "PNG",
738
994
    1: "JPEG",
 
995
    2: "WEBP",
739
996
  }
740
997
 
741
998
  def MIME_TYPE_Name(cls, x): return cls._MIME_TYPE_NAMES.get(x, "")
868
1125
 
869
1126
  _STYLE = """"""
870
1127
  _STYLE_CONTENT_TYPE = """"""
 
1128
  _PROTO_DESCRIPTOR_NAME = 'apphosting.OutputSettings'
871
1129
class ImagesTransformRequest(ProtocolBuffer.ProtocolMessage):
872
1130
  has_image_ = 0
873
1131
  has_output_ = 0
 
1132
  has_input_ = 0
 
1133
  input_ = None
874
1134
 
875
1135
  def __init__(self, contents=None):
876
1136
    self.image_ = ImageData()
877
1137
    self.transform_ = []
878
1138
    self.output_ = OutputSettings()
 
1139
    self.lazy_init_lock_ = thread.allocate_lock()
879
1140
    if contents is not None: self.MergeFromString(contents)
880
1141
 
881
1142
  def image(self): return self.image_
910
1171
 
911
1172
  def has_output(self): return self.has_output_
912
1173
 
 
1174
  def input(self):
 
1175
    if self.input_ is None:
 
1176
      self.lazy_init_lock_.acquire()
 
1177
      try:
 
1178
        if self.input_ is None: self.input_ = InputSettings()
 
1179
      finally:
 
1180
        self.lazy_init_lock_.release()
 
1181
    return self.input_
 
1182
 
 
1183
  def mutable_input(self): self.has_input_ = 1; return self.input()
 
1184
 
 
1185
  def clear_input(self):
 
1186
 
 
1187
    if self.has_input_:
 
1188
      self.has_input_ = 0;
 
1189
      if self.input_ is not None: self.input_.Clear()
 
1190
 
 
1191
  def has_input(self): return self.has_input_
 
1192
 
913
1193
 
914
1194
  def MergeFrom(self, x):
915
1195
    assert x is not self
916
1196
    if (x.has_image()): self.mutable_image().MergeFrom(x.image())
917
1197
    for i in xrange(x.transform_size()): self.add_transform().CopyFrom(x.transform(i))
918
1198
    if (x.has_output()): self.mutable_output().MergeFrom(x.output())
 
1199
    if (x.has_input()): self.mutable_input().MergeFrom(x.input())
919
1200
 
920
1201
  def Equals(self, x):
921
1202
    if x is self: return 1
926
1207
      if e1 != e2: return 0
927
1208
    if self.has_output_ != x.has_output_: return 0
928
1209
    if self.has_output_ and self.output_ != x.output_: return 0
 
1210
    if self.has_input_ != x.has_input_: return 0
 
1211
    if self.has_input_ and self.input_ != x.input_: return 0
929
1212
    return 1
930
1213
 
931
1214
  def IsInitialized(self, debug_strs=None):
942
1225
      if debug_strs is not None:
943
1226
        debug_strs.append('Required field: output not set.')
944
1227
    elif not self.output_.IsInitialized(debug_strs): initialized = 0
 
1228
    if (self.has_input_ and not self.input_.IsInitialized(debug_strs)): initialized = 0
945
1229
    return initialized
946
1230
 
947
1231
  def ByteSize(self):
950
1234
    n += 1 * len(self.transform_)
951
1235
    for i in xrange(len(self.transform_)): n += self.lengthString(self.transform_[i].ByteSize())
952
1236
    n += self.lengthString(self.output_.ByteSize())
 
1237
    if (self.has_input_): n += 1 + self.lengthString(self.input_.ByteSize())
953
1238
    return n + 2
954
1239
 
955
1240
  def ByteSizePartial(self):
962
1247
    if (self.has_output_):
963
1248
      n += 1
964
1249
      n += self.lengthString(self.output_.ByteSizePartial())
 
1250
    if (self.has_input_): n += 1 + self.lengthString(self.input_.ByteSizePartial())
965
1251
    return n
966
1252
 
967
1253
  def Clear(self):
968
1254
    self.clear_image()
969
1255
    self.clear_transform()
970
1256
    self.clear_output()
 
1257
    self.clear_input()
971
1258
 
972
1259
  def OutputUnchecked(self, out):
973
1260
    out.putVarInt32(10)
980
1267
    out.putVarInt32(26)
981
1268
    out.putVarInt32(self.output_.ByteSize())
982
1269
    self.output_.OutputUnchecked(out)
 
1270
    if (self.has_input_):
 
1271
      out.putVarInt32(34)
 
1272
      out.putVarInt32(self.input_.ByteSize())
 
1273
      self.input_.OutputUnchecked(out)
983
1274
 
984
1275
  def OutputPartial(self, out):
985
1276
    if (self.has_image_):
994
1285
      out.putVarInt32(26)
995
1286
      out.putVarInt32(self.output_.ByteSizePartial())
996
1287
      self.output_.OutputPartial(out)
 
1288
    if (self.has_input_):
 
1289
      out.putVarInt32(34)
 
1290
      out.putVarInt32(self.input_.ByteSizePartial())
 
1291
      self.input_.OutputPartial(out)
997
1292
 
998
1293
  def TryMerge(self, d):
999
1294
    while d.avail() > 0:
1016
1311
        d.skip(length)
1017
1312
        self.mutable_output().TryMerge(tmp)
1018
1313
        continue
 
1314
      if tt == 34:
 
1315
        length = d.getVarInt32()
 
1316
        tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
 
1317
        d.skip(length)
 
1318
        self.mutable_input().TryMerge(tmp)
 
1319
        continue
1019
1320
 
1020
1321
 
1021
1322
      if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
1040
1341
      res+=prefix+"output <\n"
1041
1342
      res+=self.output_.__str__(prefix + "  ", printElemNumber)
1042
1343
      res+=prefix+">\n"
 
1344
    if self.has_input_:
 
1345
      res+=prefix+"input <\n"
 
1346
      res+=self.input_.__str__(prefix + "  ", printElemNumber)
 
1347
      res+=prefix+">\n"
1043
1348
    return res
1044
1349
 
1045
1350
 
1049
1354
  kimage = 1
1050
1355
  ktransform = 2
1051
1356
  koutput = 3
 
1357
  kinput = 4
1052
1358
 
1053
1359
  _TEXT = _BuildTagLookupTable({
1054
1360
    0: "ErrorCode",
1055
1361
    1: "image",
1056
1362
    2: "transform",
1057
1363
    3: "output",
1058
 
  }, 3)
 
1364
    4: "input",
 
1365
  }, 4)
1059
1366
 
1060
1367
  _TYPES = _BuildTagLookupTable({
1061
1368
    0: ProtocolBuffer.Encoder.NUMERIC,
1062
1369
    1: ProtocolBuffer.Encoder.STRING,
1063
1370
    2: ProtocolBuffer.Encoder.STRING,
1064
1371
    3: ProtocolBuffer.Encoder.STRING,
1065
 
  }, 3, ProtocolBuffer.Encoder.MAX_TYPE)
 
1372
    4: ProtocolBuffer.Encoder.STRING,
 
1373
  }, 4, ProtocolBuffer.Encoder.MAX_TYPE)
1066
1374
 
1067
1375
 
1068
1376
  _STYLE = """"""
1069
1377
  _STYLE_CONTENT_TYPE = """"""
 
1378
  _PROTO_DESCRIPTOR_NAME = 'apphosting.ImagesTransformRequest'
1070
1379
class ImagesTransformResponse(ProtocolBuffer.ProtocolMessage):
1071
1380
  has_image_ = 0
 
1381
  has_source_metadata_ = 0
 
1382
  source_metadata_ = ""
1072
1383
 
1073
1384
  def __init__(self, contents=None):
1074
1385
    self.image_ = ImageData()
1082
1393
 
1083
1394
  def has_image(self): return self.has_image_
1084
1395
 
 
1396
  def source_metadata(self): return self.source_metadata_
 
1397
 
 
1398
  def set_source_metadata(self, x):
 
1399
    self.has_source_metadata_ = 1
 
1400
    self.source_metadata_ = x
 
1401
 
 
1402
  def clear_source_metadata(self):
 
1403
    if self.has_source_metadata_:
 
1404
      self.has_source_metadata_ = 0
 
1405
      self.source_metadata_ = ""
 
1406
 
 
1407
  def has_source_metadata(self): return self.has_source_metadata_
 
1408
 
1085
1409
 
1086
1410
  def MergeFrom(self, x):
1087
1411
    assert x is not self
1088
1412
    if (x.has_image()): self.mutable_image().MergeFrom(x.image())
 
1413
    if (x.has_source_metadata()): self.set_source_metadata(x.source_metadata())
1089
1414
 
1090
1415
  def Equals(self, x):
1091
1416
    if x is self: return 1
1092
1417
    if self.has_image_ != x.has_image_: return 0
1093
1418
    if self.has_image_ and self.image_ != x.image_: return 0
 
1419
    if self.has_source_metadata_ != x.has_source_metadata_: return 0
 
1420
    if self.has_source_metadata_ and self.source_metadata_ != x.source_metadata_: return 0
1094
1421
    return 1
1095
1422
 
1096
1423
  def IsInitialized(self, debug_strs=None):
1105
1432
  def ByteSize(self):
1106
1433
    n = 0
1107
1434
    n += self.lengthString(self.image_.ByteSize())
 
1435
    if (self.has_source_metadata_): n += 1 + self.lengthString(len(self.source_metadata_))
1108
1436
    return n + 1
1109
1437
 
1110
1438
  def ByteSizePartial(self):
1112
1440
    if (self.has_image_):
1113
1441
      n += 1
1114
1442
      n += self.lengthString(self.image_.ByteSizePartial())
 
1443
    if (self.has_source_metadata_): n += 1 + self.lengthString(len(self.source_metadata_))
1115
1444
    return n
1116
1445
 
1117
1446
  def Clear(self):
1118
1447
    self.clear_image()
 
1448
    self.clear_source_metadata()
1119
1449
 
1120
1450
  def OutputUnchecked(self, out):
1121
1451
    out.putVarInt32(10)
1122
1452
    out.putVarInt32(self.image_.ByteSize())
1123
1453
    self.image_.OutputUnchecked(out)
 
1454
    if (self.has_source_metadata_):
 
1455
      out.putVarInt32(18)
 
1456
      out.putPrefixedString(self.source_metadata_)
1124
1457
 
1125
1458
  def OutputPartial(self, out):
1126
1459
    if (self.has_image_):
1127
1460
      out.putVarInt32(10)
1128
1461
      out.putVarInt32(self.image_.ByteSizePartial())
1129
1462
      self.image_.OutputPartial(out)
 
1463
    if (self.has_source_metadata_):
 
1464
      out.putVarInt32(18)
 
1465
      out.putPrefixedString(self.source_metadata_)
1130
1466
 
1131
1467
  def TryMerge(self, d):
1132
1468
    while d.avail() > 0:
1137
1473
        d.skip(length)
1138
1474
        self.mutable_image().TryMerge(tmp)
1139
1475
        continue
 
1476
      if tt == 18:
 
1477
        self.set_source_metadata(d.getPrefixedString())
 
1478
        continue
1140
1479
 
1141
1480
 
1142
1481
      if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
1149
1488
      res+=prefix+"image <\n"
1150
1489
      res+=self.image_.__str__(prefix + "  ", printElemNumber)
1151
1490
      res+=prefix+">\n"
 
1491
    if self.has_source_metadata_: res+=prefix+("source_metadata: %s\n" % self.DebugFormatString(self.source_metadata_))
1152
1492
    return res
1153
1493
 
1154
1494
 
1156
1496
    return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
1157
1497
 
1158
1498
  kimage = 1
 
1499
  ksource_metadata = 2
1159
1500
 
1160
1501
  _TEXT = _BuildTagLookupTable({
1161
1502
    0: "ErrorCode",
1162
1503
    1: "image",
1163
 
  }, 1)
 
1504
    2: "source_metadata",
 
1505
  }, 2)
1164
1506
 
1165
1507
  _TYPES = _BuildTagLookupTable({
1166
1508
    0: ProtocolBuffer.Encoder.NUMERIC,
1167
1509
    1: ProtocolBuffer.Encoder.STRING,
1168
 
  }, 1, ProtocolBuffer.Encoder.MAX_TYPE)
 
1510
    2: ProtocolBuffer.Encoder.STRING,
 
1511
  }, 2, ProtocolBuffer.Encoder.MAX_TYPE)
1169
1512
 
1170
1513
 
1171
1514
  _STYLE = """"""
1172
1515
  _STYLE_CONTENT_TYPE = """"""
 
1516
  _PROTO_DESCRIPTOR_NAME = 'apphosting.ImagesTransformResponse'
1173
1517
class CompositeImageOptions(ProtocolBuffer.ProtocolMessage):
1174
1518
 
1175
1519
 
1450
1794
 
1451
1795
  _STYLE = """"""
1452
1796
  _STYLE_CONTENT_TYPE = """"""
 
1797
  _PROTO_DESCRIPTOR_NAME = 'apphosting.CompositeImageOptions'
1453
1798
class ImagesCanvas(ProtocolBuffer.ProtocolMessage):
1454
1799
  has_width_ = 0
1455
1800
  width_ = 0
1665
2010
 
1666
2011
  _STYLE = """"""
1667
2012
  _STYLE_CONTENT_TYPE = """"""
 
2013
  _PROTO_DESCRIPTOR_NAME = 'apphosting.ImagesCanvas'
1668
2014
class ImagesCompositeRequest(ProtocolBuffer.ProtocolMessage):
1669
2015
  has_canvas_ = 0
1670
2016
 
1874
2220
 
1875
2221
  _STYLE = """"""
1876
2222
  _STYLE_CONTENT_TYPE = """"""
 
2223
  _PROTO_DESCRIPTOR_NAME = 'apphosting.ImagesCompositeRequest'
1877
2224
class ImagesCompositeResponse(ProtocolBuffer.ProtocolMessage):
1878
2225
  has_image_ = 0
1879
2226
 
1977
2324
 
1978
2325
  _STYLE = """"""
1979
2326
  _STYLE_CONTENT_TYPE = """"""
 
2327
  _PROTO_DESCRIPTOR_NAME = 'apphosting.ImagesCompositeResponse'
1980
2328
class ImagesHistogramRequest(ProtocolBuffer.ProtocolMessage):
1981
2329
  has_image_ = 0
1982
2330
 
2080
2428
 
2081
2429
  _STYLE = """"""
2082
2430
  _STYLE_CONTENT_TYPE = """"""
 
2431
  _PROTO_DESCRIPTOR_NAME = 'apphosting.ImagesHistogramRequest'
2083
2432
class ImagesHistogram(ProtocolBuffer.ProtocolMessage):
2084
2433
 
2085
2434
  def __init__(self, contents=None):
2269
2618
 
2270
2619
  _STYLE = """"""
2271
2620
  _STYLE_CONTENT_TYPE = """"""
 
2621
  _PROTO_DESCRIPTOR_NAME = 'apphosting.ImagesHistogram'
2272
2622
class ImagesHistogramResponse(ProtocolBuffer.ProtocolMessage):
2273
2623
  has_histogram_ = 0
2274
2624
 
2372
2722
 
2373
2723
  _STYLE = """"""
2374
2724
  _STYLE_CONTENT_TYPE = """"""
 
2725
  _PROTO_DESCRIPTOR_NAME = 'apphosting.ImagesHistogramResponse'
2375
2726
class ImagesGetUrlBaseRequest(ProtocolBuffer.ProtocolMessage):
2376
2727
  has_blob_key_ = 0
2377
2728
  blob_key_ = ""
2471
2822
 
2472
2823
  _STYLE = """"""
2473
2824
  _STYLE_CONTENT_TYPE = """"""
 
2825
  _PROTO_DESCRIPTOR_NAME = 'apphosting.ImagesGetUrlBaseRequest'
2474
2826
class ImagesGetUrlBaseResponse(ProtocolBuffer.ProtocolMessage):
2475
2827
  has_url_ = 0
2476
2828
  url_ = ""
2570
2922
 
2571
2923
  _STYLE = """"""
2572
2924
  _STYLE_CONTENT_TYPE = """"""
 
2925
  _PROTO_DESCRIPTOR_NAME = 'apphosting.ImagesGetUrlBaseResponse'
 
2926
if _extension_runtime:
 
2927
  pass
2573
2928
 
2574
 
__all__ = ['ImagesServiceError','ImagesServiceTransform','Transform','ImageData','OutputSettings','ImagesTransformRequest','ImagesTransformResponse','CompositeImageOptions','ImagesCanvas','ImagesCompositeRequest','ImagesCompositeResponse','ImagesHistogramRequest','ImagesHistogram','ImagesHistogramResponse','ImagesGetUrlBaseRequest','ImagesGetUrlBaseResponse']
 
2929
__all__ = ['ImagesServiceError','ImagesServiceTransform','Transform','ImageData','InputSettings','OutputSettings','ImagesTransformRequest','ImagesTransformResponse','CompositeImageOptions','ImagesCanvas','ImagesCompositeRequest','ImagesCompositeResponse','ImagesHistogramRequest','ImagesHistogram','ImagesHistogramResponse','ImagesGetUrlBaseRequest','ImagesGetUrlBaseResponse']