blob: 6c03262ffcc3ac0e2c834327d21f6d89bc0e8934 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
#!/usr/bin/env python
# RaidGuessFS, a FUSE pseudo-filesystem to guess RAID parameters of a damaged device
# Copyright (C) 2015 Ludovic Pouzenc <ludovic@pouzenc.fr>
#
# This file is part of RaidGuessFS.
#
# RaidGuessFS is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# RaidGuessFS is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with RaidGuessFS. If not, see <http://www.gnu.org/licenses/>
import logging
class MyTasks():
"""Auxiliary class, managing long or background tasks"""
TASK_NAMES = [ 'find_bootsect', 'find_files' ]
def __init__(self, *args, **kwargs):
self.tasks = []
self.find_files_pathlist = []
def get_task_start(self):
return 'Write a task_name in this pseudo-file to start it\n'
def get_task_kill(self):
return 'Write a task_name in this pseudo-file to kill it\n'
def get_find_files_pathlist(self):
return self.find_files_pathlist
def get_find_files_pathlist_str(self):
return '\n'.join(self.find_files_pathlist)
def set_task_start(self, task_name):
raise Exception('Not yet implemented')
def set_task_kill(self, task_name):
raise Exception('Not yet implemented')
def set_find_files_pathlist(self, new_find_files_pathlist):
self.find_files_pathlist = new_find_files_pathlist
def read_find_bootsect(self):
return 'This task is not started\n'
def read_find_files(self):
return 'This task is not started\n'
|