Skip to content

Commit 1332a9b

Browse files
Andrei PashkinAndrei Pashkin
Andrei Pashkin
authored and
Andrei Pashkin
committed
rpc_progress2
1 parent 507177e commit 1332a9b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+3767
-486
lines changed

Makefile

+23-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
PROTOC = protoc
1+
PROTOC := protoc
22
CWD := $(shell pwd)
33
PROTOBUF_SRC := $(CWD)/protobuf
44
ENTITIES_DIR := $(CWD)/entities
5+
RPC_DIR := $(CWD)/RPC
56

67
# Entities Protobuf definitions generation.
78
# Assumes that Entities Protoc-plugin is installed.
@@ -18,12 +19,26 @@ entities-py-test-proto:
1819
--entities_out $(ENTITIES_DIR)/python/ \
1920
$(wildcard $(ENTITIES_DIR)/python/tests/*.proto) $(wildcard $(ENTITIES_DIR)/python/tests/**/*.proto) $(wildcard $(ENTITIES_DIR)/python/tests/**/**/*.proto)
2021

21-
# Entities: generate entity-classes for Python.
22-
.PHONY: entities-py-proto
23-
entities-py-proto:
22+
# Entities: generate RPC-models for Python.
23+
$(RPC_DIR)/proto/plugins/python/src/onedrive_client/RPC_protoc_plugins/plugin_pb2.py: $(RPC_DIR)/proto/onedrive_client/RPC_protoc_plugins/plugin.proto
2424
$(PROTOC) \
2525
--proto_path $(PROTOBUF_SRC)/src \
26-
--proto_path $(ENTITIES_DIR)/proto/ \
27-
--python_out $(ENTITIES_DIR)/python/src/ \
28-
--entities_out=$(ENTITIES_DIR)/python/src/ \
29-
$(wildcard $(ENTITIES_DIR)/proto/*.proto) $(wildcard $(ENTITIES_DIR)/proto/**/*.proto) $(wildcard $(ENTITIES_DIR)/proto/**/**/*.proto)
26+
--proto_path $(RPC_DIR)/proto/ \
27+
--python_out=$(RPC_DIR)/proto/plugins/python/src \
28+
$?
29+
30+
.PHONY: RPC-py-models
31+
RPC-py-models: export RPC_PATH := $(RPC_DIR)/proto
32+
RPC-py-models: $(RPC_DIR)/proto/plugins/python/src/onedrive_client/RPC_protoc_plugins/plugin_pb2.py
33+
$(PROTOC) \
34+
--proto_path $(PROTOBUF_SRC)/src \
35+
--proto_path $(RPC_DIR)/proto/ \
36+
--RPC-models_out=$(RPC_DIR)/python/src/ \
37+
$(wildcard $(RPC_DIR)/proto/onedrive_client/RPC/*.proto)
38+
39+
RPC-py-proto:
40+
$(PROTOC) \
41+
--proto_path $(PROTOBUF_SRC)/src \
42+
--proto_path $(RPC_DIR)/proto/ \
43+
--python_out=$(RPC_DIR)/python/src/ \
44+
$(wildcard $(RPC_DIR)/proto/onedrive_client/RPC/*.proto)

RPC/Expressions.g4

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/**
2+
* Simple boolean expression language.
3+
*
4+
* Operator precedence
5+
*
6+
* 1. not
7+
* 2. or
8+
* 3. and
9+
*
10+
* Full example:
11+
*
12+
* A and not (B or C) or D and not E and false or true
13+
*/
14+
grammar Expressions;
15+
16+
root: expr=expression EOF ;
17+
expression: group
18+
| operator=NOT expression
19+
| expression (operator=AND expression)+
20+
| expression (operator=OR expression)+
21+
| IDENTIFIER
22+
| literal
23+
;
24+
group : GROUP_START content=expression GROUP_END ;
25+
GROUP_START : '(' ;
26+
GROUP_END : ')' ;
27+
literal : value=TRUE | value=FALSE ;
28+
TRUE : 'true' ;
29+
FALSE : 'false' ;
30+
AND : 'and' ;
31+
OR : 'or' ;
32+
NOT : 'not' ;
33+
IDENTIFIER : [a-zA-Z_][a-zA-Z0-9_]* ;
34+
WS : [ \t\r\n]+ -> skip ;
2.09 KB
Binary file not shown.
1.28 KB
Binary file not shown.
1.01 KB
Binary file not shown.

rpc/README.rst RPC/README.rst

File renamed without changes.

0 commit comments

Comments
 (0)