-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathdata.py
More file actions
23 lines (17 loc) · 719 Bytes
/
data.py
File metadata and controls
23 lines (17 loc) · 719 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from enum import Enum
DataObjectType = Enum('DataObjectType','file directory')
class DataObject(object):
def __init__(self, data_object_type):
self.data_object_type = data_object_type
def is_file(self):
'''Returns whether object is a file'''
return self.data_object_type is DataObjectType.file
def is_dir(self):
'''Returns whether object is a directory'''
return self.data_object_type is DataObjectType.directory
def get_type(self):
'''Returns type of this DataObject'''
return self.data_object_type
def set_attributes(self):
'''Sets attributes about the directory after querying the Data API'''
raise NotImplementedError