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

All Samples(15)  |  Call(8)  |  Derive(0)  |  Import(7)

src/r/a/ralph-1.2.9/src/ralph/discovery/management/commands/import.py   ralph(Download)
from django.db.models import Q
 
from bob.csvutil import UnicodeReader
from ralph.discovery.models import Device
 
    def handle(self, filename, fields='', delimiter=b',', **options):
        fields = [field.strip() for field in fields.split(',')]
        with open(filename, 'rb') as f:
            for row in UnicodeReader(f, delimiter=delimiter):
                data = dict(zip(fields, row))

src/r/a/ralph-1.2.9/src/ralph/ui/views/deploy.py   ralph(Download)
    PrepareMassDeploymentForm,
)
from bob.csvutil import UnicodeReader, UnicodeWriter
 
 
        reserved_ip_addresses = []
        new_csv_rows = []
        csv_rows = UnicodeReader(cStringIO.StringIO(
            mass_deployment.csv.strip()
        ))

src/r/a/ralph-1.2.9/src/ralph/ui/forms/deployment.py   ralph(Download)
from ralph.ui.widgets import DeviceWidget
from ralph.util import Eth
from bob.csvutil import UnicodeReader
from ralph.ui.widgets import ReadOnlySelectWidget, ReadOnlyWidget
 
    def clean_csv(self):
        csv_string = self.cleaned_data['csv'].strip().lower()
        rows = UnicodeReader(cStringIO.StringIO(csv_string))
        parsed_macs = set()
        for row_number, cols in enumerate(rows, start=1):
    def clean_csv(self):
        csv_string = self.cleaned_data['csv'].strip().lower()
        rows = UnicodeReader(cStringIO.StringIO(csv_string))
        cleaned_csv = []
        parsed_hostnames = set()

src/r/a/ralph-1.2.9/src/ralph/dnsedit/management/commands/importdnsrecords.py   ralph(Download)
from powerdns.models import Domain, Record, RECORD_TYPES
 
from bob.csvutil import UnicodeReader
from ralph.dnsedit.util import get_domain
 
        print('Importing DNS records from {}...'.format(filename))
        with open(filename, 'rb') as f:
            for i, value in enumerate(UnicodeReader(f), 1):
                if len(value) != 3:
                    raise IncorrectLengthRowError(

src/r/a/ralph-1.2.9/src/ralph/discovery/management/commands/networkimport.py   ralph(Download)
 
from django.core.management.base import BaseCommand
from bob.csvutil import UnicodeReader
 
from ralph.discovery.models import (
    def handle_single(self, filename):
        print('Importing Network from {}...'.format(filename))
        with open(filename, 'rb') as f:
            for i, value in enumerate(UnicodeReader(f), 1):
                if len(value) != 5:

src/r/a/ralph-1.2.9/src/ralph/business/management/commands/profitcenter.py   ralph(Download)
 
from django.core.management.base import BaseCommand
from bob.csvutil import UnicodeReader
from optparse import make_option
 
            self.not_found_profit_centers = set()
            self.not_found_business_segments = set()
            for i, value in enumerate(UnicodeReader(f), 1):
                if len(value) != 3:
                    raise IncorrectLengthRowError(

src/r/a/ralph-1.2.9/src/ralph/ui/views/catalog.py   ralph(Download)
import datetime
 
from bob.csvutil import UnicodeReader
from bob.menu import MenuItem, MenuHeader
from django.contrib import messages
            return
        f = cStringIO.StringIO(uploaded_file.read())
        rows = iter(UnicodeReader(f))
        header = list(rows.next())
        if header[0].strip() != 'sn':