Krenair

MCP 7.0pre 7.0 runtime diff

Aug 1st, 2012
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.06 KB | None | 0 0
  1. alex@alex:~/MCP$ diff 7.0pre/runtime/ 7.0/runtime/ -r
  2. diff -r 7.0pre/runtime/commands.py 7.0/runtime/commands.py
  3. 318a319,320
  4. > if self.has_renumber_csv:
  5. > reqs.append('renumber csv')
  6. 412a415
  7. > self.csvnewids = os.path.normpath(config.get('CSV', 'NewIds'))
  8. 418a422
  9. > self.has_renumber_csv = False
  10. 422a427
  11. > header_newids = csv_header(self.csvnewids)
  12. 432a438,439
  13. > if set(['client', 'server', 'newid']) <= header_newids:
  14. > self.has_renumber_csv = True
  15. 1237a1245,1307
  16. > def process_renumber(self, side):
  17. > """Renumber the sources using the CSV data"""
  18. > pathsrclk = {CLIENT: self.srcclient, SERVER: self.srcserver}
  19. >
  20. > if not self.has_renumber_csv:
  21. > self.logger.warning('!! renumbering disabled due to no csv !!')
  22. > return False
  23. >
  24. > regexps = {
  25. > 'methods': re.compile(r'func_([0-9]+)_[a-zA-Z_]+'),
  26. > 'fields': re.compile(r'field_([0-9]+)_[a-zA-Z_]+'),
  27. > 'params': re.compile(r'p_[\d]+_'),
  28. > }
  29. >
  30. > # HINT: We read the relevant CSVs
  31. > mapping = {'methods': {}, 'fields': {}, 'params': {}}
  32. > with open(self.csvnewids, 'rb') as fh:
  33. > in_csv = csv.DictReader(fh)
  34. > for line in in_csv:
  35. > in_id = None
  36. > if side == CLIENT:
  37. > if line['client'] != '*':
  38. > in_id = line['client']
  39. > else:
  40. > if line['server'] != '*':
  41. > in_id = line['server']
  42. > if in_id:
  43. > method_match = regexps['methods'].match(in_id)
  44. > if method_match is not None:
  45. > if in_id not in mapping['methods']:
  46. > mapping['methods'][in_id] = line['newid']
  47. > in_param = 'p_' + method_match.group(1) + '_'
  48. > method_match = regexps['methods'].match(line['newid'])
  49. > if method_match is not None:
  50. > out_param = 'p_' + method_match.group(1) + '_'
  51. > mapping['params'][in_param] = out_param
  52. > field_match = regexps['fields'].match(in_id)
  53. > if field_match is not None:
  54. > if in_id not in mapping['fields']:
  55. > mapping['fields'][in_id] = line['newid']
  56. >
  57. > def updatefile(src_file):
  58. > tmp_file = src_file + '.tmp'
  59. > with open(src_file, 'r') as fh:
  60. > buf = fh.read()
  61. > for group in mapping.keys():
  62. > def mapname(match):
  63. > try:
  64. > return mapping[group][match.group(0)]
  65. > except KeyError:
  66. > pass
  67. > return match.group(0)
  68. > buf = regexps[group].sub(mapname, buf)
  69. > with open(tmp_file, 'w') as fh:
  70. > fh.write(buf)
  71. > shutil.move(tmp_file, src_file)
  72. >
  73. > # HINT: We pathwalk the sources
  74. > for path, _, filelist in os.walk(pathsrclk[side], followlinks=True):
  75. > for cur_file in fnmatch.filter(filelist, '*.java'):
  76. > updatefile(os.path.normpath(os.path.join(path, cur_file)))
  77. > return True
  78. >
  79. 1483c1553,1555
  80. < self.logger.info('> File %s not found for %s', out_class, in_class)
  81. ---
  82. > self.logger.error('* File %s not found for %s', out_class, in_class)
  83. > except IOError:
  84. > self.logger.error('* File %s failed extracting for %s', out_class, in_class)
  85. 1579,1580c1651,1656
  86. < shutil.copyfile(src_file, dest_file)
  87. < self.logger.info('> Outputted %s to %s', in_class.ljust(35), outpathlk[side])
  88. ---
  89. > try:
  90. > shutil.copyfile(src_file, dest_file)
  91. > self.logger.info('> Outputted %s to %s', in_class.ljust(35), outpathlk[side])
  92. > except IOError:
  93. > self.logger.error('* File %s copy failed', in_class)
  94. >
  95. Binary files 7.0pre/runtime/commands.pyc and 7.0/runtime/commands.pyc differ
  96. Binary files 7.0pre/runtime/filehandling/__init__.pyc and 7.0/runtime/filehandling/__init__.pyc differ
  97. Binary files 7.0pre/runtime/filehandling/srgsexport.pyc and 7.0/runtime/filehandling/srgsexport.pyc differ
  98. Binary files 7.0pre/runtime/filehandling/srgshandler.pyc and 7.0/runtime/filehandling/srgshandler.pyc differ
  99. diff -r 7.0pre/runtime/mcp.py 7.0/runtime/mcp.py
  100. 175a176,189
  101. >
  102. >
  103. > def updateids_side(commands, side, no_comments=False):
  104. > if not commands.checksourcedir(side):
  105. > return False
  106. > starttime = time.time()
  107. > commands.logger.info('== Updating %s ==', SIDE_NAME[side])
  108. > if commands.has_renumber_csv:
  109. > commands.logger.info('> Renumbering sources')
  110. > commands.process_renumber(side)
  111. > else:
  112. > commands.logger.warning('!! renumbering disabled due to no csvs !!')
  113. > commands.logger.info('- Done in %.2f seconds', time.time() - starttime)
  114. > return True
  115. Binary files 7.0pre/runtime/mcp.pyc and 7.0/runtime/mcp.pyc differ
  116. Binary files 7.0pre/runtime/pylibs/annotate_gl_constants.pyc and 7.0/runtime/pylibs/annotate_gl_constants.pyc differ
  117. Binary files 7.0pre/runtime/pylibs/cleanup_src.pyc and 7.0/runtime/pylibs/cleanup_src.pyc differ
  118. Binary files 7.0pre/runtime/pylibs/fffix.pyc and 7.0/runtime/pylibs/fffix.pyc differ
  119. Binary files 7.0pre/runtime/pylibs/__init__.pyc and 7.0/runtime/pylibs/__init__.pyc differ
  120. Binary files 7.0pre/runtime/pylibs/jadfix.pyc and 7.0/runtime/pylibs/jadfix.pyc differ
  121. Binary files 7.0pre/runtime/pylibs/normlines.pyc and 7.0/runtime/pylibs/normlines.pyc differ
  122. Binary files 7.0pre/runtime/pylibs/normpatch.pyc and 7.0/runtime/pylibs/normpatch.pyc differ
  123. Binary files 7.0pre/runtime/pylibs/whereis.pyc and 7.0/runtime/pylibs/whereis.pyc differ
  124. Only in 7.0/runtime/: updateids.py
Advertisement
Add Comment
Please, Sign In to add comment