parameters: (destination_eggdir, dist_data)
docstring: Move data entries to their correct location.
docstring_summary: Move data entries to their correct location.
docstring_tokens: Move data entries to their correct location .
function: def _move_data_entries(destination_eggdir, dist_data):
          """Move data entries to their correct location."""
          dist_data = os.path.join(destination_eggdir, dist_data)
          dist_data_scripts = os.path.join(dist_data, 'scripts')
          if os.path.exists(dist_data_scripts):
              egg_info_scripts = os.path.join(
                  destination_eggdir, 'EGG-INFO', 'scripts')
              os.mkdir(egg_info_scripts)
              for entry in os.listdir(dist_data_scripts):
                  # Remove bytecode, as it's not properly handled
                  # during easy_install scripts install phase.
                  if entry.endswith('.pyc'):
                      os.unlink(os.path.join(dist_data_scripts, entry))
                  else:
                      os.rename(
                          os.path.join(dist_data_scripts, entry),
                          os.path.join(egg_info_scripts, entry),
                      )
              os.rmdir(dist_data_scripts)
          for subdir in filter(os.path.exists, (
              os.path.join(dist_data, d)
              for d in ('data', 'headers', 'purelib', 'platlib')
          )):
              unpack(subdir, destination_eggdir)
          if os.path.exists(dist_data):
              os.rmdir(dist_data)
function_tokens: def _move_data_entries ( destination_eggdir , dist_data ) : dist_data = os . path . join ( destination_eggdir , dist_data ) dist_data_scripts = os . path . join ( dist_data , 'scripts' ) if os . path . exists ( dist_data_scripts ) : egg_info_scripts = os . path . join ( destination_eggdir , 'EGG-INFO' , 'scripts' ) os . mkdir ( egg_info_scripts ) for entry in os . listdir ( dist_data_scripts ) : # Remove bytecode, as it's not properly handled # during easy_install scripts install phase. if entry . endswith ( '.pyc' ) : os . unlink ( os . path . join ( dist_data_scripts , entry ) ) else : os . rename ( os . path . join ( dist_data_scripts , entry ) , os . path . join ( egg_info_scripts , entry ) , ) os . rmdir ( dist_data_scripts ) for subdir in filter ( os . path . exists , ( os . path . join ( dist_data , d ) for d in ( 'data' , 'headers' , 'purelib' , 'platlib' ) ) ) : unpack ( subdir , destination_eggdir ) if os . path . exists ( dist_data ) : os . rmdir ( dist_data )