diff options
author | Nino van Hooff <ninovanhooff@gmail.com> | 2020-05-08 18:37:49 +0300 |
---|---|---|
committer | Nino van Hooff <ninovanhooff@gmail.com> | 2020-05-08 18:37:49 +0300 |
commit | a09cd0e63e6b5cffba068c9f704b01280b2313e7 (patch) | |
tree | b594d320c6c25bea78519011be5e1b6e55d09df0 /plugins/RemovableDriveOutputDevice | |
parent | a4fe3d7685b677dd121262b2a1b137c33ba7ecd3 (diff) |
Convert doxygen to rst for Prepare, Preview, RemovableOutputDevice
Diffstat (limited to 'plugins/RemovableDriveOutputDevice')
4 files changed, 31 insertions, 24 deletions
diff --git a/plugins/RemovableDriveOutputDevice/LinuxRemovableDrivePlugin.py b/plugins/RemovableDriveOutputDevice/LinuxRemovableDrivePlugin.py index cf889ebb12..3661bfa63c 100644 --- a/plugins/RemovableDriveOutputDevice/LinuxRemovableDrivePlugin.py +++ b/plugins/RemovableDriveOutputDevice/LinuxRemovableDrivePlugin.py @@ -10,12 +10,14 @@ import glob import os import subprocess -## Support for removable devices on Linux. -# -# TODO: This code uses the most basic interfaces for handling this. -# We should instead use UDisks2 to handle mount/unmount and hotplugging events. -# + class LinuxRemovableDrivePlugin(RemovableDrivePlugin.RemovableDrivePlugin): + """Support for removable devices on Linux. + + TODO: This code uses the most basic interfaces for handling this. + We should instead use UDisks2 to handle mount/unmount and hotplugging events. + """ + def checkRemovableDrives(self): drives = {} for volume in glob.glob("/media/*"): diff --git a/plugins/RemovableDriveOutputDevice/OSXRemovableDrivePlugin.py b/plugins/RemovableDriveOutputDevice/OSXRemovableDrivePlugin.py index 0d2c474e42..70e2107898 100644 --- a/plugins/RemovableDriveOutputDevice/OSXRemovableDrivePlugin.py +++ b/plugins/RemovableDriveOutputDevice/OSXRemovableDrivePlugin.py @@ -9,8 +9,10 @@ import os import plistlib -## Support for removable devices on Mac OSX + class OSXRemovableDrivePlugin(RemovableDrivePlugin.RemovableDrivePlugin): + """Support for removable devices on Mac OSX""" + def checkRemovableDrives(self): drives = {} p = subprocess.Popen(["system_profiler", "SPUSBDataType", "-xml"], stdout = subprocess.PIPE, stderr = subprocess.PIPE) diff --git a/plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py b/plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py index c81e4a76bc..a4fe7309f7 100644 --- a/plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py +++ b/plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py @@ -28,17 +28,19 @@ class RemovableDriveOutputDevice(OutputDevice): self._writing = False self._stream = None - ## Request the specified nodes to be written to the removable drive. - # - # \param nodes A collection of scene nodes that should be written to the - # removable drive. - # \param file_name \type{string} A suggestion for the file name to write - # to. If none is provided, a file name will be made from the names of the - # meshes. - # \param limit_mimetypes Should we limit the available MIME types to the - # MIME types available to the currently active machine? - # def requestWrite(self, nodes, file_name = None, filter_by_machine = False, file_handler = None, **kwargs): + """Request the specified nodes to be written to the removable drive. + + :param nodes: A collection of scene nodes that should be written to the + removable drive. + :param file_name: :type{string} A suggestion for the file name to write to. + If none is provided, a file name will be made from the names of the + meshes. + :param limit_mimetypes: Should we limit the available MIME types to the + MIME types available to the currently active machine? + + """ + filter_by_machine = True # This plugin is intended to be used by machine (regardless of what it was told to do) if self._writing: raise OutputDeviceError.DeviceBusyError() @@ -106,14 +108,14 @@ class RemovableDriveOutputDevice(OutputDevice): Logger.log("e", "Operating system would not let us write to %s: %s", file_name, str(e)) raise OutputDeviceError.WriteRequestFailedError(catalog.i18nc("@info:status Don't translate the XML tags <filename> or <message>!", "Could not save to <filename>{0}</filename>: <message>{1}</message>").format(file_name, str(e))) from e - ## Generate a file name automatically for the specified nodes to be saved - # in. - # - # The name generated will be the name of one of the nodes. Which node that - # is can not be guaranteed. - # - # \param nodes A collection of nodes for which to generate a file name. def _automaticFileName(self, nodes): + """Generate a file name automatically for the specified nodes to be saved in. + + The name generated will be the name of one of the nodes. Which node that + is can not be guaranteed. + + :param nodes: A collection of nodes for which to generate a file name. + """ for root in nodes: for child in BreadthFirstIterator(root): if child.getMeshData(): diff --git a/plugins/RemovableDriveOutputDevice/WindowsRemovableDrivePlugin.py b/plugins/RemovableDriveOutputDevice/WindowsRemovableDrivePlugin.py index 8a183c25f4..ddcabd7311 100644 --- a/plugins/RemovableDriveOutputDevice/WindowsRemovableDrivePlugin.py +++ b/plugins/RemovableDriveOutputDevice/WindowsRemovableDrivePlugin.py @@ -42,8 +42,9 @@ ctypes.windll.kernel32.DeviceIoControl.argtypes = [ #type: ignore ctypes.windll.kernel32.DeviceIoControl.restype = wintypes.BOOL #type: ignore -## Removable drive support for windows class WindowsRemovableDrivePlugin(RemovableDrivePlugin.RemovableDrivePlugin): + """Removable drive support for windows""" + def checkRemovableDrives(self): drives = {} |