Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

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

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

""" 

 

OffineGPI mimic limited functionalities in Ganga.GPI package, 

providing practical interface for the rest of GangaCK in absense 

of real `SetupGanga` environment. 

 

- Compare to actual GPI, these provide attributes for *read* only. 

 

""" 

 

from .OfflineJob import OfflineJob as Job 

from .config import Config 

 

config = Config() 

 

#-----------# 

# Functions # 

#-----------# 

 

def jobs(jid): 

"""Support only getting job from single int for now...""" 

return Job(jid) 

 

# dummy for now 

jobtree = None 

 

#--------------# 

# Lite-classes # 

#--------------# 

 

BKQuery = type('BKQuery', (list,), {'getDataset': lambda x: LHCbDataset()}) 

 

DiracFile = type('DiracFile', (dict,), { 

'getMetadata': lambda x: dict(), 

'put' : lambda x: None, 

'remove' : lambda x: None, 

}) 

 

JobTemplate = type('JobTemplate', (object,), {}) 

 

LocalFile = type('LocalFile', (object,), {}) 

 

LogicalFile = type('LogicalFile', (object,), {}) 

 

#---------# 

# Classes # 

#---------# 

 

class File(object): 

def __init__(self, name): 

self._name = name 

@property 

def name(self): 

return self._name 

 

class LHCbDataset(object): 

 

def __init__(self, files=[], XMLCatalogueSlice=''): 

# super(LHCbDataset,self).__init__(files) 

self._files = [ File(x) for x in files ] 

self._XMLCatalogueSlice = File(XMLCatalogueSlice) 

 

@property 

def files(self): 

return self._files 

@property 

def XMLCatalogueSlice(self): 

return self._XMLCatalogueSlice 

 

def getCatalog(self): 

raise NotImplementedError 

 

#------------# 

# SINGLETONS # 

#------------# 

 

_ThreadPoolQueueMonitor = type('ThreadPoolQueueMonitor', (), { 

'worker_status': [], 

}) 

 

class _queues(object): 

@property 

def _user_threadpool(self): 

return _ThreadPoolQueueMonitor() 

def add(self, func, args=(), kwargs={}, priority=5): 

pass 

 

queues = _queues()