Univention Bugzilla – Attachment 6801 Details for
Bug 32888
Allow distribution of whole (sub-)directories
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
(WIP) progress so far distribution
ucs-school.patch (text/plain), 3.15 KB, created by
Drees Dormann
on 2015-04-02 15:01:58 CEST
(
hide
)
Description:
(WIP) progress so far distribution
Filename:
MIME Type:
Creator:
Drees Dormann
Created:
2015-04-02 15:01:58 CEST
Size:
3.15 KB
patch
obsolete
>Index: ucs-school-umc-distribution/umc/js/distribution/DetailPage.js >=================================================================== >--- ucs-school-umc-distribution/umc/js/distribution/DetailPage.js (Revision 59559) >+++ ucs-school-umc-distribution/umc/js/distribution/DetailPage.js (Arbeitskopie) >@@ -150,6 +150,7 @@ > }) > }, { > type: MultiUploader, >+ multiFile: true, > name: 'files', > command: 'distribution/upload', > dynamicOptions: { >@@ -312,6 +313,8 @@ > }, > > _checkFilenameUpload: function(fileInfo) { >+ console.log('### _checkFilenameUpload:', fileInfo); >+ //return true; > var nameWidget = this._form.getWidget('name'); > var isNewProject = !nameWidget.get('disabled'); > return this.umcpCommand('distribution/checkfiles', { >Index: ucs-school-umc-distribution/umc/python/distribution/__init__.py >=================================================================== >--- ucs-school-umc-distribution/umc/python/distribution/__init__.py (Revision 59559) >+++ ucs-school-umc-distribution/umc/python/distribution/__init__.py (Arbeitskopie) >@@ -72,22 +72,26 @@ > @file_upload > def upload(self, request): > # make sure that we got a list >+ MODULE.info('### upload: %r' % (request, )) >+ MODULE.info('### upload options: %r' % (request.options, )) > if not isinstance(request.options, (tuple, list)): > raise UMC_OptionTypeError( 'Expected list of dicts, but got: %s' % str(request.options) ) >- file = request.options[0] >- if not ('tmpfile' in file and 'filename' in file): >- raise UMC_OptionTypeError( 'Invalid upload data, got: %s' % str(file) ) > >- # create a temporary upload directory, if it does not already exist >- if not self._tmpDir: >- self._tmpDir = tempfile.mkdtemp(prefix='ucsschool-distribution-upload-') >- MODULE.info('Created temporary directory: %s' % self._tmpDir) >+ #file = request.options[0] >+ for file in request.options: >+ if not ('tmpfile' in file and 'filename' in file): >+ raise UMC_OptionTypeError( 'Invalid upload data, got: %s' % str(file) ) > >- filename = self.__workaround_filename_bug(file) >- destPath = os.path.join(self._tmpDir, filename) >- MODULE.info('Received file %r, saving it to %r' % (file['tmpfile'], destPath)) >- shutil.move(file['tmpfile'], destPath) >+ # create a temporary upload directory, if it does not already exist >+ if not self._tmpDir: >+ self._tmpDir = tempfile.mkdtemp(prefix='ucsschool-distribution-upload-') >+ MODULE.info('Created temporary directory: %s' % self._tmpDir) > >+ filename = self.__workaround_filename_bug(file) >+ destPath = os.path.join(self._tmpDir, filename) >+ MODULE.info('Received file %r, saving it to %r' % (file['tmpfile'], destPath)) >+ shutil.move(file['tmpfile'], destPath) >+ > # done > self.finished( request.id, None ) > >@@ -124,6 +128,11 @@ > 'distributed': True|False > } > ''' >+ ###TODO: remove me >+ MODULE.info ('### Request: %r' % (request, )) >+ MODULE.info ('### Request.options: %r' % (request.options, )) >+ self.finished( request.id, True ) >+ return > > if not 'filenames' in request.options or not 'project' in request.options: > raise UMC_OptionTypeError( 'Expected dict with entries "filenames" and "project", but got: %s' % request.options )
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 32888
:
6800
|
6801
|
6823
|
6824
|
6825