예제 #1
0
    def __init__(self, path, format=None, client=None):
        super(S3Target, self).__init__(path)
        if format is None:
            format = get_default_format()

        self.format = format
        self.fs = client or S3Client()
예제 #2
0
    def __init__(self, path, client=None, format=None):
        super(WebHdfsTarget, self).__init__(path)
        path = self.path
        self.fs = client or WebHdfsClient()
        if format is None:
            format = get_default_format()

        self.format = format
예제 #3
0
파일: s3.py 프로젝트: roverdotcom/luigi
    def __init__(self, path, format=None, client=None, **kwargs):
        super(S3Target, self).__init__(path)
        if format is None:
            format = get_default_format()

        self.path = path
        self.format = format
        self.fs = client or S3Client()
        self.s3_options = kwargs
예제 #4
0
파일: s3.py 프로젝트: vikrambala/luigi
    def __init__(self, path, format=None, client=None, **kwargs):
        super(S3Target, self).__init__(path)
        if format is None:
            format = get_default_format()

        self.path = path
        self.format = format
        self.fs = client or S3Client()
        self.s3_options = kwargs
예제 #5
0
파일: s3.py 프로젝트: BlackMaria/luigi
    def __init__(self, path, format=None, client=None):
        super(S3Target, self).__init__(path)
        if format is None:
            format = get_default_format()

        # Allow to write unicode in file for retrocompatibility
        if sys.version_info[:2] <= (2, 6):
            format = format >> MixedUnicodeBytes

        self.format = format
        self.fs = client or S3Client()
예제 #6
0
    def __init__(self, fn, is_tmp=None, mirror_on_stderr=False, format=None):
        self._mirror_on_stderr = mirror_on_stderr
        self.path = fn
        if format is None:
            format = get_default_format()

        # Allow to write unicode in file for retrocompatibility
        if six.PY2:
            format = format >> MixedUnicodeBytes

        self.format = format
예제 #7
0
파일: mock.py 프로젝트: 0xD3ADB33F/luigi
    def __init__(self, fn, is_tmp=None, mirror_on_stderr=False, format=None):
        self._mirror_on_stderr = mirror_on_stderr
        self.path = fn
        if format is None:
            format = get_default_format()

        # Allow to write unicode in file for retrocompatibility
        if six.PY2:
            format = format >> MixedUnicodeBytes

        self.format = format
예제 #8
0
파일: s3.py 프로젝트: wwj718/luigi
    def __init__(self, path, format=None, client=None):
        super(S3Target, self).__init__(path)
        if format is None:
            format = get_default_format()

        # Allow to write unicode in file for retrocompatibility
        if sys.version_info[:2] <= (2, 6):
            format = format >> MixedUnicodeBytes

        self.format = format
        self.fs = client or S3Client()
예제 #9
0
파일: local_target.py 프로젝트: riga/luigi
    def __init__(self, path=None, format=None, is_tmp=False):
        if format is None:
            format = get_default_format()

        if not path:
            if not is_tmp:
                raise Exception('path or is_tmp must be set')
            path = os.path.join(tempfile.gettempdir(), 'luigi-tmp-%09d' % random.randint(0, 999999999))
        super(LocalTarget, self).__init__(path)
        self.format = format
        self.is_tmp = is_tmp
예제 #10
0
파일: gcs.py 프로젝트: nkdhny/gcstarget
    def __init__(self, path, format=None, gcs_filesystem=None):
        super(GcsTarget, self).__init__(path)
        if format is None:
            format = get_default_format()

        # Allow to write unicode in file for retrocompatibility
        if sys.version_info[:2] <= (2, 6):
            format = format >> MixedUnicodeBytes

        self.format = format
        self.fs = gcs_filesystem or GcsFileSystem()
예제 #11
0
    def __init__(self, path=None, format=None, is_tmp=False):
        if format is None:
            format = get_default_format()

        if not path:
            if not is_tmp:
                raise Exception('path or is_tmp must be set')
            path = os.path.join(tempfile.gettempdir(), 'luigi-tmp-%09d' % random.randint(0, 999999999))
        super(LocalTarget, self).__init__(path)
        self.format = format
        self.is_tmp = is_tmp
예제 #12
0
파일: file.py 프로젝트: mortardata/luigi
    def __init__(self, path=None, format=None, is_tmp=False):
        if format is None:
            format = get_default_format()

        # Allow to write unicode in file for retrocompatibility
        if sys.version_info[:2] <= (2, 6):
            format = format >> MixedUnicodeBytes

        if not path:
            if not is_tmp:
                raise Exception('path or is_tmp must be set')
            path = os.path.join(tempfile.gettempdir(), 'luigi-tmp-%09d' % random.randint(0, 999999999))
        super(LocalTarget, self).__init__(path)
        self.format = format
        self.is_tmp = is_tmp
예제 #13
0
    def __init__(self, path=None, format=None, is_tmp=False):
        if format is None:
            format = get_default_format()

        # Allow to write unicode in file for retrocompatibility
        if sys.version_info[:2] <= (2, 6):
            format = format >> MixedUnicodeBytes

        if not path:
            if not is_tmp:
                raise Exception('path or is_tmp must be set')
            path = os.path.join(tempfile.gettempdir(), 'luigi-tmp-%09d' % random.randint(0, 999999999))
        super(LocalTarget, self).__init__(path)
        self.format = format
        self.is_tmp = is_tmp
예제 #14
0
파일: s3.py 프로젝트: h3biomed/luigi
    def __init__(self, path, format=None, client=None, flag="_SUCCESS"):
        """
        Initializes a S3FlagTarget.

        :param path: the directory where the files are stored.
        :type path: str
        :param client:
        :type client:
        :param flag:
        :type flag: str
        """
        if format is None:
            format = get_default_format()

        if path[-1] != "/":
            raise ValueError("S3FlagTarget requires the path to be to a " "directory.  It must end with a slash ( / ).")
        super(S3FlagTarget, self).__init__(path, format, client)
        self.flag = flag
예제 #15
0
    def __init__(self, path, format=None, client=None, flag='_SUCCESS'):
        """
        Initializes a S3FlagTarget.

        :param path: the directory where the files are stored.
        :type path: str
        :param client:
        :type client:
        :param flag:
        :type flag: str
        """
        if format is None:
            format = get_default_format()

        if path[-1] != "/":
            raise ValueError("S3FlagTarget requires the path to be to a "
                             "directory.  It must end with a slash ( / ).")
        super(S3FlagTarget, self).__init__(path, format, client)
        self.flag = flag
예제 #16
0
    def __init__(self,
                 path,
                 format=None,
                 client=None,
                 remote_temp_write=False,
                 boto3_session_kwargs=None,
                 **kwargs):
        """
        Creates an S3Target that can be opened for reading or writing.

        Setting remote_temp_write to True will place the temporary file on S3
        instead of the local file system. Requires boto3 >=1.4.0.
        """
        super(S3Target, self).__init__(path)
        if format is None:
            format = get_default_format()

        self.path = path
        self.format = format
        self.fs = client or S3Client()
        self.s3_options = kwargs
        self.remote_temp_write = remote_temp_write
        self.boto3_session_kwargs = boto3_session_kwargs
예제 #17
0
 def __init__(self, path, format=None, client=None):
     super(S3Target, self).__init__(path)
     if format is None:
         format = get_default_format()
     self.format = format
     self.fs = client or S3Client()
예제 #18
0
 def __init__(self, path=None, format=None, is_tmp=False):
     if format is None:
         format = get_default_format()
     super(LocalTarget, self).__init__(path)
     self.format = format
예제 #19
0
 def __init__(self, fn, is_tmp=None, mirror_on_stderr=False, format=None):
     self._mirror_on_stderr = mirror_on_stderr
     self.path = fn
     self.format = format or get_default_format()
예제 #20
0
파일: mock.py 프로젝트: Jitendrakry/luigi
 def __init__(self, fn, is_tmp=None, mirror_on_stderr=False, format=None):
     self._mirror_on_stderr = mirror_on_stderr
     self._fn = fn
     if format is None:
         format = get_default_format()
     self.format = format