Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(32)  |  Call(22)  |  Derive(0)  |  Import(10)

src/d/j/django-bundles-0.4.1/django_bundles/management/commands/create_bundles.py   django-bundles(Download)
from django_bundles.core import get_bundles, set_bundle_versions
from django_bundles.processors import processor_pipeline, processor_library
from django_bundles.utils.files import FileChunkGenerator
from django_bundles.utils.processes import run_process
 
def iter_bundle_files(bundle, debug=False):
    for bundle_file in bundle.files:
        for chunk in processor_pipeline(bundle_file.processors, FileChunkGenerator(open(bundle_file.file_path, 'rb')), debug=debug):
            yield chunk
        yield '\n'
            if bundle_file.processors:
                # for now preprocessed files are written to temp files and therefore won't be available in the source map
                output_pipeline = processor_pipeline(bundle_file.processors, FileChunkGenerator(open(bundle_file.file_path, 'rb')), debug=debug)
                tmp_input_file = NamedTemporaryFile()
                source_map_processed_input_files.append(tmp_input_file)
                infile_list.append(tmp_input_file.name)
            else:
                for chunk in FileChunkGenerator(open(bundle_file.file_path, 'rb')):
                    m.update(chunk)
                infile_list.append(bundle_file.file_path)
 
            with open(single_file_output, 'wb') as output_file:
                for chunk in processor_pipeline(processors, FileChunkGenerator(open(single_file_input, 'rb'))):
                    output_file.write(chunk)
 

src/d/j/django_bundles-HEAD/django_bundles/management/commands/create_bundles.py   django_bundles(Download)
from django_bundles.core import get_bundles, set_bundle_versions
from django_bundles.processors import processor_pipeline, processor_library
from django_bundles.utils.files import FileChunkGenerator
from django_bundles.utils.processes import run_process
 
def iter_bundle_files(bundle, debug=False):
    for bundle_file in bundle.files:
        for chunk in processor_pipeline(bundle_file.processors, FileChunkGenerator(open(bundle_file.file_path, 'rb')), debug=debug):
            yield chunk
        yield '\n'
            if bundle_file.processors:
                # for now preprocessed files are written to temp files and therefore won't be available in the source map
                output_pipeline = processor_pipeline(bundle_file.processors, FileChunkGenerator(open(bundle_file.file_path, 'rb')), debug=debug)
                tmp_input_file = NamedTemporaryFile()
                source_map_processed_input_files.append(tmp_input_file)
                infile_list.append(tmp_input_file.name)
            else:
                for chunk in FileChunkGenerator(open(bundle_file.file_path, 'rb')):
                    m.update(chunk)
                infile_list.append(bundle_file.file_path)
 
            with open(single_file_output, 'wb') as output_file:
                for chunk in processor_pipeline(processors, FileChunkGenerator(open(single_file_input, 'rb'))):
                    output_file.write(chunk)
 

src/d/j/django-bundles-0.4.1/django_bundles/management/commands/lint_bundles.py   django-bundles(Download)
from django_bundles.core import get_bundles
from django_bundles.processors import processor_pipeline
from django_bundles.utils.files import FileChunkGenerator
from django_bundles.utils.processes import run_process
from django_bundles.conf.bundles_settings import bundles_settings
                        for bundle in watching[watchdir]:
                            if src in bundle:
                                result, error_message = self.lint_file(bundle.bundle_type, src, iter_input=processor_pipeline(bundle[src].processors, FileChunkGenerator(open(src, 'rb'))))
                                self.log_watch_result(src, result, error_message=error_message)
                                break
                    continue
 
                success, error_message = self.lint_file(bundle.bundle_type, bundle_file.file_path, iter_input=processor_pipeline(bundle_file.processors, FileChunkGenerator(open(bundle_file.file_path, 'rb'))))
 
                failures += file_checked(success, error_message, bundle_file.file_path)

src/d/j/django_bundles-HEAD/django_bundles/management/commands/lint_bundles.py   django_bundles(Download)
from django_bundles.core import get_bundles
from django_bundles.processors import processor_pipeline
from django_bundles.utils.files import FileChunkGenerator
from django_bundles.utils.processes import run_process
from django_bundles.conf.bundles_settings import bundles_settings
                        for bundle in watching[watchdir]:
                            if src in bundle:
                                result, error_message = self.lint_file(bundle.bundle_type, src, iter_input=processor_pipeline(bundle[src].processors, FileChunkGenerator(open(src, 'rb'))))
                                self.log_watch_result(src, result, error_message=error_message)
                                break
                    continue
 
                success, error_message = self.lint_file(bundle.bundle_type, bundle_file.file_path, iter_input=processor_pipeline(bundle_file.processors, FileChunkGenerator(open(bundle_file.file_path, 'rb'))))
 
                failures += file_checked(success, error_message, bundle_file.file_path)

src/d/j/django-bundles-0.4.1/django_bundles/processors/base.py   django-bundles(Download)
from django_bundles.conf.bundles_settings import bundles_settings
from django_bundles.utils import get_class
from django_bundles.utils.files import FileChunkGenerator
from django_bundles.utils.processes import run_process
from django.core.exceptions import ImproperlyConfigured
            # Consume the iterator into a zero length deque
            collections.deque(g, maxlen=0)
            return FileChunkGenerator(output_file)
        else:
            return g

src/d/j/django_bundles-HEAD/django_bundles/processors/base.py   django_bundles(Download)
from django_bundles.conf.bundles_settings import bundles_settings
from django_bundles.utils import get_class
from django_bundles.utils.files import FileChunkGenerator
from django_bundles.utils.processes import run_process
from django.core.exceptions import ImproperlyConfigured
            # Consume the iterator into a zero length deque
            collections.deque(g, maxlen=0)
            return FileChunkGenerator(output_file)
        else:
            return g

src/d/j/django-bundles-0.4.1/django_bundles/views.py   django-bundles(Download)
from django_bundles.core import get_bundles
from django_bundles.processors import processor_pipeline
from django_bundles.utils.files import FileChunkGenerator
 
from django.conf import settings
 
            file_cache[path]['cache'] = {
                'contents': reduce(concat, (chunk for chunk in processor_pipeline(file_cache[path]['bundle_file'].processors, FileChunkGenerator(open(file_cache[path]['bundle_file'].file_path, 'rb'))))),
                'mimetype': mimetype,
            }

src/d/j/django_bundles-HEAD/django_bundles/views.py   django_bundles(Download)
from django_bundles.core import get_bundles
from django_bundles.processors import processor_pipeline
from django_bundles.utils.files import FileChunkGenerator
 
from django.conf import settings
 
            file_cache[path]['cache'] = {
                'contents': reduce(concat, (chunk for chunk in processor_pipeline(file_cache[path]['bundle_file'].processors, FileChunkGenerator(open(file_cache[path]['bundle_file'].file_path, 'rb'))))),
                'mimetype': mimetype,
            }

src/d/j/django-bundles-0.4.1/django_bundles/tests/utils/files.py   django-bundles(Download)
from django.test import TestCase
 
 
from django_bundles.utils.files import expand_file_names, FileChunkGenerator
 
 
        with open(__file__, 'r') as f:
            g = FileChunkGenerator(f)
 
            file_contents_2 = ''
    def test_file_closes(self):
        with open(__file__, 'r') as f:
            g = FileChunkGenerator(f)
 
            collections.deque(g, maxlen=0)
    def test_file_stays_open(self):
        with open(__file__, 'r') as f:
            g = FileChunkGenerator(f, close=False)
 
            collections.deque(g, maxlen=0)

src/d/j/django_bundles-HEAD/django_bundles/tests/utils/files.py   django_bundles(Download)
from django.test import TestCase
 
 
from django_bundles.utils.files import expand_file_names, FileChunkGenerator
 
 
        with open(__file__, 'r') as f:
            g = FileChunkGenerator(f)
 
            file_contents_2 = ''
    def test_file_closes(self):
        with open(__file__, 'r') as f:
            g = FileChunkGenerator(f)
 
            collections.deque(g, maxlen=0)
    def test_file_stays_open(self):
        with open(__file__, 'r') as f:
            g = FileChunkGenerator(f, close=False)
 
            collections.deque(g, maxlen=0)