44a8f0e66f679eab4a4ec66344abecbfd8dcf7c7,src/python/pants/backend/codegen/tasks/protobuf_gen.py,ProtobufGen,calculate_genfiles,#ProtobufGen#Any#Any#,288

Before Change


    protobuf_parse = ProtobufParse(path, source)
    protobuf_parse.parse()

    genfiles = defaultdict(set)
    genfiles["py"].update(self.calculate_python_genfiles(source))
    genfiles["java"].update(self.calculate_java_genfiles(protobuf_parse))
    return genfiles


  def calculate_python_genfiles(self, source):
    yield re.sub(r"\.proto$", "_pb2.py", source)

After Change


  def calculate_genfiles(self, path, source):
    protobuf_parse = ProtobufParse(path, source)
    protobuf_parse.parse()
    return OrderedSet(self.calculate_java_genfiles(protobuf_parse))

  def calculate_java_genfiles(self, protobuf_parse):
    basepath = protobuf_parse.package.replace(".", os.path.sep)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: pantsbuild/pants
Commit Name: 44a8f0e66f679eab4a4ec66344abecbfd8dcf7c7
Time: 2015-06-02
Author: garrett.malmquist@gmail.com
File Name: src/python/pants/backend/codegen/tasks/protobuf_gen.py
Class Name: ProtobufGen
Method Name: calculate_genfiles


Project Name: pantsbuild/pants
Commit Name: 44a8f0e66f679eab4a4ec66344abecbfd8dcf7c7
Time: 2015-06-02
Author: garrett.malmquist@gmail.com
File Name: src/python/pants/backend/codegen/tasks/protobuf_gen.py
Class Name: ProtobufGen
Method Name: calculate_genfiles


Project Name: home-assistant/home-assistant
Commit Name: abc253c4c582438c6a42135799393f285e23c2e7
Time: 2016-02-03
Author: sean@dague.net
File Name: homeassistant/components/history.py
Class Name:
Method Name: state_changes_during_period


Project Name: pantsbuild/pants
Commit Name: d0717e9c8f16ad5ddfae5ceee4389d874a463263
Time: 2015-05-29
Author: garrett.malmquist@gmail.com
File Name: src/python/pants/backend/codegen/tasks/wire_gen.py
Class Name: WireGen
Method Name: calculate_genfiles