Skip to content

Commit 88f26b1

Browse files
bbluemelatomi
authored and
atomi
committed
Update importer, and implement CF10 with backwards compatibility to CF7.
1 parent f0e0548 commit 88f26b1

File tree

7 files changed

+14359
-4560
lines changed

7 files changed

+14359
-4560
lines changed

coldfusiontagcompletions.py

+16-4,550
Large diffs are not rendered by default.

importer/import.cfc

+21-10
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,11 @@ component output="false" displayname="import" {
5151
for ( j = 1; j <= ArrayLen( currenttag.parameter ); j++ ) {
5252
paramname = currenttag.parameter[j].XmlAttributes.name;
5353
newtag.completions.add( paramname );
54-
if ( currenttag.parameter[j].XmlAttributes.type == "Boolean" ||
55-
( StructKeyExists( currenttag.parameter[j], "values" ) && StructKeyExists( currenttag.parameter[j].values, "value" ) ) ) {
56-
newattribute = Duplicate( this.newattributetemplate );
57-
newattribute.name = currenttag.parameter[j].XmlAttributes.name;
54+
newattribute = Duplicate( this.newattributetemplate );
55+
newattribute.name = currenttag.parameter[j].XmlAttributes.name;
56+
if ( StructKeyExists( currenttag.parameter[j].XmlAttributes, "type" ) && ( currenttag.parameter[j].XmlAttributes.type == "Boolean" ||
57+
( StructKeyExists( currenttag.parameter[j], "values" ) && StructKeyExists( currenttag.parameter[j].values, "value" ) ) ) ) {
58+
5859
switch ( currenttag.parameter[j].XmlAttributes.type ) {
5960
case "Boolean":
6061
newattribute.completions.add( "true" );
@@ -68,8 +69,9 @@ component output="false" displayname="import" {
6869
}
6970
break;
7071
}
71-
newtag.attributes[newattribute.name] = newattribute;
72+
7273
}
74+
newtag.attributes[newattribute.name] = newattribute;
7375
/*
7476
if ( StructKeyExists( currenttag.parameter[j].XmlAttributes, "required" ) && currenttag.parameter[j].XmlAttributes.required EQ "true" ) {
7577
@@ -91,10 +93,12 @@ component output="false" displayname="import" {
9193
var attrCompIterator = "";
9294
var attrComp = "";
9395
var crlf = chr( 13 ) & chr( 10 );
96+
var attrIterator = "";
97+
var attr = "";
9498

9599
while( tagIterator.hasNext() ) {
96100
tag = tagIterator.next();
97-
pythonoutput &= "'" & tag.name & "': {" & crlf;
101+
pythonoutput &= "self.completions['" & tag.name & "'] = {" & crlf;
98102
compIter = tag.completions.iterator();
99103
pythonoutput &= " 'completions': [" & crlf;
100104
while ( compIter.hasNext() ) {
@@ -113,11 +117,18 @@ component output="false" displayname="import" {
113117
}
114118
pythonoutput &= crlf;
115119
}
116-
pythonoutput &= " ]" & crlf;
117-
pythonoutput &= "}";
118-
if ( tagIterator.hasNext() ) {
119-
pythonoutput &= "," & crlf;
120+
pythonoutput &= " ]," & crlf;
121+
attrIterator = StructKeyArray(tag.attributes).iterator();
122+
pythonoutput &= " 'attributes': [";
123+
while ( attrIterator.hasNext() ) {
124+
attr = attrIterator.next();
125+
pythonoutput &= crlf & ' "' & attr & '"';
126+
if ( attrIterator.hasNext() ) {
127+
pythonoutput &= ",";
128+
}
120129
}
130+
pythonoutput &= crlf & " ]" & crlf;
131+
pythonoutput &= "}" & crlf;
121132
}
122133
return pythonoutput;
123134
}

taglib/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)