rask  Check-in [babe44a242]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
SHA1 Hash:babe44a242f8ec59fba463973f4fda32ff0fbdff
Date: 2017-03-17 07:12:10
User: umgeher
Comment:merge from v/0.1.1
Tags And Properties
  • branch=rask/master inherited from [e712659d71]
  • sym-rask/master inherited from [e712659d71]
Context
2017-03-17
08:27
[de2698ffae] merge from v/0.1.2 (user: umgeher, tags: rask/master)
07:24
[0986e499f7] merge from rask/master (user: umgeher, tags: rask/f/riak)
07:12
[babe44a242] merge from v/0.1.1 (user: umgeher, tags: rask/master)
07:10
[4564f7a552] Leaf: version stuff (user: umgeher, tags: rask/v/0.1.1)
2017-03-12
18:13
[f930fed1e5] bye bye (user: umgeher, tags: rask/master)
Changes

Changes to rask/README.md.

1
2
3
4
5
6

7
8
9
10
11
12
13
# Rask

## Changelog

|Version|Description|
|----|----|

|0.1.0|rask_raid project is merged to rask project|
|0.0.120|riak sets in dict to map and map to dict parsers|
|0.0.119|pdbpp as default pdb. dict to map and map to dict from parser.riak imported|
|0.0.118|wrong namespace fixed|
|0.0.117|dict to map of riak tools fixed|
|0.0.116|riak schema parser|
|0.0.115|some changes in Future Chain|






>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Rask

## Changelog

|Version|Description|
|----|----|
|0.1.1|riak parser has now float schema|
|0.1.0|rask_raid project is merged to rask project|
|0.0.120|riak sets in dict to map and map to dict parsers|
|0.0.119|pdbpp as default pdb. dict to map and map to dict from parser.riak imported|
|0.0.118|wrong namespace fixed|
|0.0.117|dict to map of riak tools fixed|
|0.0.116|riak schema parser|
|0.0.115|some changes in Future Chain|

Changes to rask/rask/parser/riak/dict_to_map.py.

7
8
9
10
11
12
13

14
15
16
17
18
19
20
..
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
..
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
    @property
    def recipes(self):
        try:
            assert self.__recipes
        except (AssertionError,AttributeError):
            self.__recipes = {
                'bool':self.__recipe_bool,

                'int':self.__recipe_str,
                'set':self.__recipe_set,
                'set+':self.__recipe_set_add,
                'set-':self.__recipe_set_discard,
                'str':self.__recipe_str,
                'unicode':self.__recipe_unicode
            }
................................................................................
    def __recipe_set_add(self,key,value,record):
        record.sets[key].add(str(value[1:]))
        return record

    def __recipe_set_discard(self,key,value,record):
        record.sets[key].discard(str(value[1:]))
        return record
    
    def __recipe_str(self,key,data,record,schema):
        record.registers[key].assign(str(data[key]))
        return record

    def __recipe_unicode(self,key,data,record,schema):
        record.registers[key].assign(b64encode(data[key]))
        return record
    
    def consume(self,data,record,schema,i,future):
        try:
            key = i.next()
            assert schema[key]['recipe'] in self.recipes
        except (AssertionError,KeyError):
            pass
        except StopIteration:
................................................................................
            self.consume,
            data=data,
            record=record,
            schema=schema,
            i=i,
            future=future
        )
    
    def process(self,data,record,schema,future):
        return self.ioengine.loop.add_callback(
            self.consume,
            data=data,
            record=record,
            schema=schema,
            i=iter(data),
            future=future
        )







>







 







|







|







 







|









7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
..
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
..
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
    @property
    def recipes(self):
        try:
            assert self.__recipes
        except (AssertionError,AttributeError):
            self.__recipes = {
                'bool':self.__recipe_bool,
                'float':self.__recipe_str,
                'int':self.__recipe_str,
                'set':self.__recipe_set,
                'set+':self.__recipe_set_add,
                'set-':self.__recipe_set_discard,
                'str':self.__recipe_str,
                'unicode':self.__recipe_unicode
            }
................................................................................
    def __recipe_set_add(self,key,value,record):
        record.sets[key].add(str(value[1:]))
        return record

    def __recipe_set_discard(self,key,value,record):
        record.sets[key].discard(str(value[1:]))
        return record

    def __recipe_str(self,key,data,record,schema):
        record.registers[key].assign(str(data[key]))
        return record

    def __recipe_unicode(self,key,data,record,schema):
        record.registers[key].assign(b64encode(data[key]))
        return record

    def consume(self,data,record,schema,i,future):
        try:
            key = i.next()
            assert schema[key]['recipe'] in self.recipes
        except (AssertionError,KeyError):
            pass
        except StopIteration:
................................................................................
            self.consume,
            data=data,
            record=record,
            schema=schema,
            i=i,
            future=future
        )

    def process(self,data,record,schema,future):
        return self.ioengine.loop.add_callback(
            self.consume,
            data=data,
            record=record,
            schema=schema,
            i=iter(data),
            future=future
        )

Changes to rask/rask/parser/riak/map_to_dict.py.

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
..
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
    @property
    def recipes(self):
        try:
            assert self.__recipes
        except (AssertionError,AttributeError):
            self.__recipes = {
                'bool':self.__recipe_bool,

                'int':self.__recipe_int,
                'set':self.__recipe_set,
                'str':self.__recipe_str,
                'unicode':self.__recipe_unicode
            }
        except:
            raise
        return self.__recipes

    def __recipe_bool(self,key,record,schema):
        return record.flags[key].value




    def __recipe_int(self,key,record,schema):
        return int(record.registers[key].value or 0)

    def __recipe_set(self,key,record,schema):
        return list(record.sets[key].value)
    
    def __recipe_str(self,key,record,schema):
        return str(record.registers[key].value)
    
    def __recipe_unicode(self,key,record,schema):
        return b64decode(record.registers[key].value)

    def consume(self,result,record,schema,i,future):
        try:
            key = i.next()
            assert schema[key]['recipe'] in self.recipes
................................................................................
            raise
        else:
            result[key] = self.recipes[schema[key]['recipe']](
                key=key,
                record=record,
                schema=schema[key]
            )
            
        self.ioengine.loop.add_callback(
            self.consume,
            result=result,
            record=record,
            schema=schema,
            i=i,
            future=future
        )
        return None
    
    def process(self,record,schema,future):
        self.ioengine.loop.add_callback(
            self.consume,
            result={},
            record=record,
            schema=schema,
            i=iter(schema),
            future=future
        )
        return True







>












>
>
>





|


|







 







|









|










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
..
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
    @property
    def recipes(self):
        try:
            assert self.__recipes
        except (AssertionError,AttributeError):
            self.__recipes = {
                'bool':self.__recipe_bool,
                'float':self.__recipe_float,
                'int':self.__recipe_int,
                'set':self.__recipe_set,
                'str':self.__recipe_str,
                'unicode':self.__recipe_unicode
            }
        except:
            raise
        return self.__recipes

    def __recipe_bool(self,key,record,schema):
        return record.flags[key].value

    def __recipe_float(self,key,record,schema):
        return float(record.registers[key].value or 0)

    def __recipe_int(self,key,record,schema):
        return int(record.registers[key].value or 0)

    def __recipe_set(self,key,record,schema):
        return list(record.sets[key].value)

    def __recipe_str(self,key,record,schema):
        return str(record.registers[key].value)

    def __recipe_unicode(self,key,record,schema):
        return b64decode(record.registers[key].value)

    def consume(self,result,record,schema,i,future):
        try:
            key = i.next()
            assert schema[key]['recipe'] in self.recipes
................................................................................
            raise
        else:
            result[key] = self.recipes[schema[key]['recipe']](
                key=key,
                record=record,
                schema=schema[key]
            )

        self.ioengine.loop.add_callback(
            self.consume,
            result=result,
            record=record,
            schema=schema,
            i=i,
            future=future
        )
        return None

    def process(self,record,schema,future):
        self.ioengine.loop.add_callback(
            self.consume,
            result={},
            record=record,
            schema=schema,
            i=iter(schema),
            future=future
        )
        return True

Changes to rask/setup.py.

13
14
15
16
17
18
19
20
21
    ],
    license='http://code.umgeher.org/fossil.cgi/rask/artifact/3b9a146264aed1f5',
    maintainer='Umgeher Torgersen',
    maintainer_email='me@umgeher.org',
    name='rask',
    packages=find_packages(),
    url='http://code.umgeher.org/rask',
    version="0.1.0"
)







|

13
14
15
16
17
18
19
20
21
    ],
    license='http://code.umgeher.org/fossil.cgi/rask/artifact/3b9a146264aed1f5',
    maintainer='Umgeher Torgersen',
    maintainer_email='me@umgeher.org',
    name='rask',
    packages=find_packages(),
    url='http://code.umgeher.org/rask',
    version="0.1.1"
)