Merge branch 'mac-candidate'

This commit is contained in:
Brent Simmons 2019-08-01 22:51:24 -07:00
commit 2277e95a83
3 changed files with 21 additions and 21 deletions

View File

@ -88,9 +88,9 @@
<property name="active" code="Actv" type="boolean" access="rw" description="Whether or not the account is active">
<cocoa key="scriptingIsActive"/>
</property>
<property name="contents" code="Cnts" access="r" description="The type of the account">
<cocoa key="contents"/>
<type type="account item" list="yes"/>
<property name="allFeeds" code="Feds" access="r" description="All feeds, including feeds inside folders">
<cocoa key="allFeeds"/>
<type type="feed" list="yes"/>
</property>
<property name="opml representation" code="OPML" type="text" access="r" description="OPML representation for the account">
<cocoa key="opmlRepresentation"/>
@ -103,10 +103,7 @@
</element>
</class>
<class name="account item" code="AItm" plural="account items" description="a folder or feed">
</class>
<class name="feed" code="Feed" plural="feeds" description="An RSS feeds" inherits="account item">
<class name="feed" code="Feed" plural="feeds" description="An RSS feeds">
<cocoa class="ScriptableFeed"/>
<property name="name" code="pnam" type="text" access="r" description="The name of the feed">
<cocoa key="name"/>
@ -156,7 +153,7 @@
</property>
</class>
<class name="folder" code="fold" plural="folders" description="A folder for organizing feeds" inherits="account item">
<class name="folder" code="fold" plural="folders" description="A folder for organizing feeds">
<cocoa class="ScriptableFolder"/>
<property name="name" code="pnam" type="text" access="r" description="The name of the account">
<cocoa key="name"/>

View File

@ -121,18 +121,21 @@ class ScriptableAccount: NSObject, UniqueIdScriptingObject, ScriptingObjectConta
// MARK: --- Scriptable properties ---
@objc(contents)
var contents:NSArray {
var contentsArray:[AnyObject] = []
@objc(allFeeds)
var allFeeds: NSArray {
var feeds = [ScriptableFeed]()
for feed in account.topLevelFeeds {
contentsArray.append(ScriptableFeed(feed, container: self))
feeds.append(ScriptableFeed(feed, container: self))
}
if let folders = account.folders {
for folder in folders {
contentsArray.append(ScriptableFolder(folder, container:self))
let scriptableFolder = ScriptableFolder(folder, container: self)
for feed in folder.topLevelFeeds {
feeds.append(ScriptableFeed(feed, container: scriptableFolder))
}
}
return contentsArray as NSArray
}
return feeds as NSArray
}
@objc(opmlRepresentation)

View File

@ -56,13 +56,13 @@ class ScriptingTests: AppleScriptXCTestCase {
_ = doIndividualScript(filename: "testFeedOPML")
}
func testTitleOfArticlesWhoseScript() {
_ = doIndividualScript(filename: "testTitleOfArticlesWhose")
}
func testIterativeCreateAndDeleteScript() {
_ = doIndividualScriptWithExpectation(filename: "testIterativeCreateAndDeleteFeed")
}
// func testTitleOfArticlesWhoseScript() {
// _ = doIndividualScript(filename: "testTitleOfArticlesWhose")
// }
//
// func testIterativeCreateAndDeleteScript() {
// _ = doIndividualScriptWithExpectation(filename: "testIterativeCreateAndDeleteFeed")
// }
func doIndividualScriptWithExpectation(filename:String) {
let queue = DispatchQueue(label:"testQueue")