Skip to content

Commit a728391

Browse files
tpwrulespeterbarker
authored andcommitted
generator: fix inconsistent tabs and spaces in Python outputs
1 parent 2e01c34 commit a728391

File tree

4 files changed

+23
-23
lines changed

4 files changed

+23
-23
lines changed

generator/mavgen_cpp11.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ def generate_main_hpp(directory, xml):
5353
f = open(os.path.join(directory, xml.basename + ".hpp"), mode='w')
5454
t.write(f, '''
5555
/** @file
56-
* @brief MAVLink comm protocol generated from ${basename}.xml
57-
* @see http://mavlink.org
56+
* @brief MAVLink comm protocol generated from ${basename}.xml
57+
* @see http://mavlink.org
5858
*/
5959
6060
#pragma once
@@ -188,8 +188,8 @@ def generate_gtestsuite_hpp(directory, xml):
188188
f = open(os.path.join(directory, "gtestsuite.hpp"), mode='w')
189189
t.write(f, '''
190190
/** @file
191-
* @brief MAVLink comm testsuite protocol generated from ${basename}.xml
192-
* @see http://mavlink.org
191+
* @brief MAVLink comm testsuite protocol generated from ${basename}.xml
192+
* @see http://mavlink.org
193193
*/
194194
195195
#pragma once

generator/mavgen_javascript.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def generate_preamble(outf, msgs, args, xml):
4242
jspack = (global && global.jspack) || require("jspack").jspack;
4343
} else {
4444
import("./local_modules/jspack/jspack.js").then((mod) => {
45-
jspack = new mod.default()
45+
jspack = new mod.default()
4646
}).catch((e) => {
4747
});
4848
}
@@ -814,20 +814,20 @@ def generate_mavlink_class(outf, msgs, xml):
814814
stream_key = new Array(link_id,srcSystem,srcComponent).toString();
815815
816816
if (stream_key in this.signing.stream_timestamps){
817-
if (timestamp <= this.signing.stream_timestamps[stream_key]){
818-
//# reject old timestamp
819-
//console.log('old timestamp')
820-
return false
821-
}
817+
if (timestamp <= this.signing.stream_timestamps[stream_key]){
818+
//# reject old timestamp
819+
//console.log('old timestamp')
820+
return false
821+
}
822822
}else{
823-
//# a new stream has appeared. Accept the timestamp if it is at most
824-
//# one minute behind our current timestamp
823+
//# a new stream has appeared. Accept the timestamp if it is at most
824+
//# one minute behind our current timestamp
825825
if (timestamp + 6000*1000 < this.signing.timestamp){
826-
//console.log('bad new stream ', timestamp/(100.0*1000*60*60*24*365), this.signing.timestamp/(100.0*1000*60*60*24*365))
827-
return false
828-
}
829-
this.signing.stream_timestamps[stream_key] = timestamp;
830-
//console.log('new stream',this.signing.stream_timestamps)
826+
//console.log('bad new stream ', timestamp/(100.0*1000*60*60*24*365), this.signing.timestamp/(100.0*1000*60*60*24*365))
827+
return false
828+
}
829+
this.signing.stream_timestamps[stream_key] = timestamp;
830+
//console.log('new stream',this.signing.stream_timestamps)
831831
}
832832
833833
// just the last 6 of 13 available are the actual sig . ie excluding the linkid(1) and timestamp(6)

generator/mavgen_spin2.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -505,10 +505,10 @@ def generate_mavlink_parser(outf, msgs, xml):
505505
parse_state := PARSE_STATE_IDLE
506506
inPacket~
507507
payloadIndex~
508-
508+
509509
PUB getPacket(): packetAddr
510-
packetAddr := @inPacket
511-
return packetAddr
510+
packetAddr := @inPacket
511+
return packetAddr
512512
513513
PUB parse_char(c)
514514
CASE_FAST parse_state

generator/mavgen_wlua.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -506,8 +506,8 @@ def generate_packet_dis(outf):
506506
local version = buffer(offset,1):uint()
507507
local protocolString = ""
508508
509-
while (true)
510-
do
509+
while (true)
510+
do
511511
protocolString = protocolVersions[version]
512512
if (protocolString ~= nil) then
513513
break
@@ -536,7 +536,7 @@ def generate_packet_dis(outf):
536536
end
537537
return
538538
end
539-
end
539+
end
540540
end
541541
542542
if (unknownFrameBeginOffset ~= 0) then

0 commit comments

Comments
 (0)