Ejemplo n.º 1
0
    def copy_extensions(self, extensions):
        build_exe.copy_extensions(self, extensions)

        # Define the data path where the files reside.
        data_path = os.path.join(babelfish.__path__[0], 'data')
        #print data_path

        # Create the subdir where the json files are collected.
        media = os.path.join('babelfish', 'data')
        #print media
        full = os.path.join(self.collect_dir, media)
        #print full
        self.mkpath(full)

        # Copy the json files to the collection dir. Also add the copied file
        # to the list of compiled files so it will be included in the zipfile.
        for name in os.listdir(data_path):
            file_name = os.path.join(data_path, name)
            self.copy_file(file_name, os.path.join(full, name))
            #print "copy_file", file_name, os.path.join(full, name)
            self.compiled_files.append(os.path.join(media, name))
            #print "compiled_files.append", os.path.join(media, name)

        data_path = os.path.join(guessit.__path__[0], '')
        media = os.path.join('guessit')
        full = os.path.join(self.collect_dir, media)
        self.mkpath(full)

        for name in os.listdir(data_path):
            if 'tlds-alpha-by-domain.txt' == name:
                file_name = os.path.join(data_path, name)
                self.copy_file(file_name, os.path.join(full, name))
                self.compiled_files.append(os.path.join(media, name))
Ejemplo n.º 2
0
    def copy_extensions(self, extensions):
        build_exe.copy_extensions(self, extensions)

        # Create the media subdir where the
        # Python files are collected.
        media = 'selenium\\webdriver\\firefox'
        full = os.path.join(self.collect_dir, media)
        if not os.path.exists(full):
            self.mkpath(full)

        # Copy the media files to the collection dir.
        # Also add the copied file to the list of compiled
        # files so it will be included in zipfile.
        files = [
            '''C:\\Python27\\Lib\\site-packages\\selenium\\webdriver\\firefox\\webdriver.xpi''',
            '../install/chromedriver.exe',
            #   '''C:/Python27/Lib/site-packages/selenium-2.46.0-py2.7.egg/selenium/webdriver/firefox/webdriver.xpi''',
            # '''C:\\Python27\\Lib\\site-packages\\selenium\\webdriver\\firefox\\webdriver_prefs.json'''
        ]
        for f in files:  #glob.glob('tools/'):
            name = os.path.basename(f)
            try:
                self.copy_file(f, os.path.join(full, name))
                self.compiled_files.append(os.path.join(media, name))
            except Exception as e:
                print(traceback.format_exc())
Ejemplo n.º 3
0
    def copy_extensions(self, extensions):
        build_exe.copy_extensions(self, extensions)

        # Create the media subdir where the
        # Python files are collected.
        media = 'selenium\\webdriver\\firefox'
        full = os.path.join(self.collect_dir, media)
        if not os.path.exists(full):
            self.mkpath(full)

        # Copy the media files to the collection dir.
        # Also add the copied file to the list of compiled
        # files so it will be included in zipfile.
        files = [
                '''C:\\Python27\\Lib\\site-packages\\selenium\\webdriver\\firefox\\webdriver.xpi''',
                '../install/chromedriver.exe',
                 #   '''C:/Python27/Lib/site-packages/selenium-2.46.0-py2.7.egg/selenium/webdriver/firefox/webdriver.xpi''',
                 # '''C:\\Python27\\Lib\\site-packages\\selenium\\webdriver\\firefox\\webdriver_prefs.json'''
                 ]
        for f in files :#glob.glob('tools/'):
            name = os.path.basename(f)
            try:
                self.copy_file(f, os.path.join(full, name))
                self.compiled_files.append(os.path.join(media, name))
            except Exception as e:
                print(traceback.format_exc())
Ejemplo n.º 4
0
 def copy_extensions(self, extensions):
     build_exe.copy_extensions(self, extensions)
     self.copy_file(
         'txclib/cacert.pem',
         os.path.join(self.collect_dir, 'txclib/cacert.pem')
     )
     self.compiled_files.append('txclib/cacert.pem')
Ejemplo n.º 5
0
        def copy_extensions(self, extensions):
            """Hack the py2exe C extension copier
               to put pkg_resources into the
               library.zip file.
               """
            builder.copy_extensions(self, extensions)
            package_data = self.distribution.package_data.copy()

            for package, patterns in self.distribution.package_data.items():
                package_dir = os.path.join(*package.split('.'))
                collect_dir = os.path.join(self.collect_dir, package_dir)

                # create sub-dirs in py2exe collection area
                # Copy the media files to the collection dir.
                # Also add the copied file to the list of compiled
                # files so it will be included in zipfile.
                for pattern in patterns:
                    pattern = os.path.join(*pattern.split('/'))
                    for f in glob.glob(os.path.join(package_dir, pattern)):
                        name = os.path.basename(f)
                        folder = os.path.join(collect_dir, os.path.dirname(f))
                        if not os.path.exists(folder):
                            self.mkpath(folder)
                        self.copy_file(f, os.path.join(collect_dir, name))
                        self.compiled_files.append(
                            os.path.join(package_dir, name))
Ejemplo n.º 6
0
        def copy_extensions(self, extensions):
            build_exe.copy_extensions(self, extensions)
            collect_dir = ph.path(self.collect_dir)

            for package_file_i in package_files:
                collected_i = collect_dir.joinpath(package_file_i['target'])
                collected_i.parent.makedirs_p()
                self.copy_file(package_file_i['source'], collected_i)
                self.compiled_files.append(package_file_i['target'])
Ejemplo n.º 7
0
 def copy_extensions(self, extensions):
     build_exe.copy_extensions(self, extensions)
     source = os.path.join('makechr', 'res')
     target = os.path.join(self.collect_dir, source)
     if not os.path.exists(target):
         self.mkpath(target)
     for f in glob.glob(os.path.join(source, '*')):
         name = os.path.basename(f)
         self.copy_file(f, os.path.join(target, name))
         self.compiled_files.append(os.path.join(source, name))
Ejemplo n.º 8
0
 def copy_extensions(self, extensions):
   build_exe.copy_extensions(self, extensions)
   source = os.path.join('makechr', 'res')
   target = os.path.join(self.collect_dir, source)
   if not os.path.exists(target):
     self.mkpath(target)
   for f in glob.glob(os.path.join(source, '*')):
     name = os.path.basename(f)
     self.copy_file(f, os.path.join(target, name))
     self.compiled_files.append(os.path.join(source, name))
Ejemplo n.º 9
0
    def copy_extensions(self, extensions):
        #super(MediaCollector, self).copy_extensions(extensions)
        build_exe.copy_extensions(self, extensions)

        for folder in CONTENT_DIRS:
            self.addDirectoryToZip(folder)

        for fileName in EXTRA_FILES:
            name = os.path.basename(fileName)
            self.copy_file(fileName, os.path.join(self.collect_dir, name))
            self.compiled_files.append(name)
Ejemplo n.º 10
0
    def copy_extensions(self, extensions):
        #super(MediaCollector, self).copy_extensions(extensions)
        build_exe.copy_extensions(self, extensions)

        for folder in CONTENT_DIRS:
            self.addDirectoryToZip(folder)

        for fileName in EXTRA_FILES:
            name = os.path.basename(fileName)
            self.copy_file(fileName, os.path.join(self.collect_dir, name))
            self.compiled_files.append(name)
Ejemplo n.º 11
0
    def copy_extensions(self, extensions):
        """Copy the missing extensions."""
        build_exe.copy_extensions(self, extensions)

        res_dir = os.path.join("fs_uae_launcher", "res")
        full = os.path.join(self.collect_dir, res_dir)
        if not os.path.exists(full):
            self.mkpath(full)

        for f in glob.glob(res_dir + '/*.*'):
            name = os.path.basename(f)
            self.copy_file(f, os.path.join(full, name))
            self.compiled_files.append(os.path.join(res_dir, name))
Ejemplo n.º 12
0
    def copy_extensions(self, extensions):
        py2exe_cmd.copy_extensions(self, extensions)

        # package egg metadata to be read by bootstrap script
        packages = {}
        for dist in self.eggs:
            packages[dist.egg_name() + ".egg"] = self.collect_metadata(dist)
        print "*** packaging egg metadata ***"
        print "\n".join(packages.keys())

        with open(os.path.join(self.collect_dir, "packages.pickle"), "wb") as f:
            pickle.dump(packages, f, pickle.HIGHEST_PROTOCOL)
        self.compiled_files.append("packages.pickle")
Ejemplo n.º 13
0
 def copy_extensions(self, extensions):
  builder.copy_extensions(self,extensions)

  for package,masks in self.package_data.iteritems():
   destination = os.path.join(self.collect_dir,package)
   for mask in masks:
    for filename in glob.glob(os.path.join(package,mask)):
     reldir = os.path.dirname(os.path.relpath(filename,package))
     copy_dir = os.path.join(destination,reldir)
     if not os.path.exists(copy_dir):
      self.mkpath(copy_dir)

     self.copy_file(filename, copy_dir)
     self.compiled_files.append(filename)
Ejemplo n.º 14
0
        def copy_extensions(self, extensions):
            """Copy the missing extensions."""
            build_exe.copy_extensions(self, extensions)

            # Create the media subdir where the
            # Python files are collected.
            media = 'guessit' # os.path.join('guessit')
            full = os.path.join(self.collect_dir, media)
            if not os.path.exists(full):
                self.mkpath(full)

            # Copy the media files to the collection dir.
            # Also add the copied file to the list of compiled
            # files so it will be included in zipfile.
            for f in glob.glob(guessit.__path__[0] + '/*.txt'):
                name = os.path.basename(f)
                self.copy_file(f, os.path.join(full, name))
                self.compiled_files.append(os.path.join(media, name))
Ejemplo n.º 15
0
        def copy_extensions(self, extensions):
            """Copy the missing extensions."""
            build_exe.copy_extensions(self, extensions)

            # Create the media subdir where the
            # Python files are collected.
            media = 'guessit'  # os.path.join('guessit')
            full = os.path.join(self.collect_dir, media)
            if not os.path.exists(full):
                self.mkpath(full)

            # Copy the media files to the collection dir.
            # Also add the copied file to the list of compiled
            # files so it will be included in zipfile.
            for f in glob.glob(guessit.__path__[0] + '/*.txt'):
                name = os.path.basename(f)
                self.copy_file(f, os.path.join(full, name))
                self.compiled_files.append(os.path.join(media, name))
    def copy_extensions(self, extensions):
        build_exe.copy_extensions(self, extensions)

        # lib2to3 files Grammar.txt and PatternGrammar.txt

        # Define the data path where the files reside.
        data_path = os.path.join(lib2to3.__path__[0], '*.txt')

        # Create the subdir where the json files are collected.
        media = os.path.join('lib2to3')
        full = os.path.join(self.collect_dir, media)
        self.mkpath(full)

        # Copy the json files to the collection dir. Also add the copied file
        # to the list of compiled files so it will be included in the zipfile.
        for f in glob.glob(data_path):
            name = os.path.basename(f)
            self.copy_file(f, os.path.join(full, name))
            self.compiled_files.append(os.path.join(media, name))
   def copy_extensions(self, extensions):
      build_exe.copy_extensions(self, extensions)

      # lib2to3 files Grammar.txt and PatternGrammar.txt

      # Define the data path where the files reside.
      data_path = os.path.join(lib2to3.__path__[0],'*.txt')

      # Create the subdir where the json files are collected.
      media = os.path.join('lib2to3')
      full = os.path.join(self.collect_dir, media)
      self.mkpath(full)

      # Copy the json files to the collection dir. Also add the copied file
      # to the list of compiled files so it will be included in the zipfile.
      for f in glob.glob(data_path):
         name = os.path.basename(f)
         self.copy_file(f, os.path.join(full, name))
         self.compiled_files.append(os.path.join(media, name))
Ejemplo n.º 18
0
    def copy_extensions(self, extensions):
        BuildExe.copy_extensions(self, extnsions)

        from bravo.plugins import authenticators
        from bravo.plugins import automatons
        from bravo.plugins import beds
        from bravo.plugins import build_hooks
        from bravo.plugins import compound_hooks
        from bravo.plugins import dig_hooks
        from bravo.plugins import door
        from bravo.plugins import fertilizer
        from bravo.plugins import generators
        from bravo.plugins import aintings
        from bravo.plugins import hysics
        from bravo.plugins import redstone
        from bravo.plugins import teleport
        from bravo.plugins import tracks
        from bravo.plugins import web
        from bravo.plugins import window_hooks
        from bravo.plugins import worldedit
        from bravo.plugins import commands
        from bravo.plugins.commands import common
        from bravo.plugins.commands import debug
        from bravo.plugins.commands import warp
        from bravo.plugins import serializers
        from bravo.plugins.serializers import beta
        from bravo.pluginsvserializers import memory

        plugins = [ authenticators, automatons, beds, build_hooks,
                    compound_hooks, dig_hooks, door, fertilizer, generators,
                    aintings, hysics, redstone, teleport, tracks, web,
                    window_hooks, worldedit, common, debug, warp, commands,
                    beta, memory, serializers,  ]

        for p in plugins:
            getCache(p)

            f = os.join(*(p.__name__.split(".")[:-1] + ["dropin.cache"]))
            full = os.path.join(self.collect_dir, f)

            self.compiled_files.append(f)
Ejemplo n.º 19
0
        def copy_extensions(self, extensions):
            build_exe.copy_extensions(self, extensions)

            # Copy the files to the collection dir.
            # Also add the copied file to the list of compiled
            # files so it will be included in zipfile.
            all_files = ([f for f in glob.glob('aarddict/*.tmpl')] +
                         [f for f in glob.glob('aarddict/*.js')] +
                         [f for f in glob.glob('aarddict/*.png')] +
                         [f for f in glob.glob('aarddict/*.css')] +
                         [f for f in glob.glob('aarddict/locale/*/*/*.mo')] +
                         [f for f in glob.glob('aarddict/locale/*.qm')] +
                         [f for f in glob.glob('aarddict/icons/*/*/*/*.png')])
            for f in all_files:

                dirname = os.path.dirname(f)
                collect_subdir = os.path.join(self.collect_dir, dirname)
                if not os.path.exists(collect_subdir):
                    self.mkpath(collect_subdir)

                self.copy_file(f, collect_subdir)
                self.compiled_files.append(f)
Ejemplo n.º 20
0
        def copy_extensions(self, extensions):
            build_exe.copy_extensions(self, extensions)

            # Copy the files to the collection dir.
            # Also add the copied file to the list of compiled
            # files so it will be included in zipfile.
            all_files = ([f for f in glob.glob('aarddict/*.tmpl')] +
                         [f for f in glob.glob('aarddict/*.js')] +
                         [f for f in glob.glob('aarddict/*.png')] +
                         [f for f in glob.glob('aarddict/*.css')] +
                         [f for f in glob.glob('aarddict/locale/*/*/*.mo')] +
                         [f for f in glob.glob('aarddict/locale/*.qm')] +
                         [f for f in glob.glob('aarddict/icons/*/*/*/*.png')]
                         )
            for f in all_files:

                dirname = os.path.dirname(f)
                collect_subdir = os.path.join(self.collect_dir, dirname)
                if not os.path.exists(collect_subdir):
                    self.mkpath(collect_subdir)

                self.copy_file(f, collect_subdir)
                self.compiled_files.append(f)
Ejemplo n.º 21
0
    def copy_extensions(self, extensions):
        build_exe.copy_extensions(self, extensions)
        collect_dir = ph.path(self.collect_dir)

        for path_i, module_i in (
            (ph.path(notebook.__path__[0]), ('templates', )),
            (ph.path(jsonschema.__path__[0]), ('schemas', )),
            (ph.path(nbformat.__path__[0]), ('v4', )),
        ):
            data_path = path_i.joinpath(*module_i)

            # Copy the template files to the collection dir. Also add the copied
            # file to the list of compiled files so it will be included in the
            # zipfile.
            # self.collect_dir.joinpath(rel_path_i).makedirs_p()

            for file_j in data_path.walkfiles():
                if file_j.ext.startswith('.py'):
                    continue
                rel_path_j = path_i.parent.relpathto(file_j)
                collected_j = collect_dir.joinpath(rel_path_j)
                collected_j.parent.makedirs_p()
                self.copy_file(file_j, collected_j)
                self.compiled_files.append(rel_path_j)
Ejemplo n.º 22
0
 def copy_extensions(self, extensions):
     build_exe.copy_extensions(self, extensions)
     self.copy_file('txclib/cacert.pem',
                    os.path.join(self.collect_dir, 'txclib/cacert.pem'))
     self.compiled_files.append('txclib/cacert.pem')