Initial commit
This commit is contained in:
30
baRSS/AppDelegate.h
Normal file
30
baRSS/AppDelegate.h
Normal file
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// The MIT License (MIT)
|
||||
// Copyright (c) 2018 Oleg Geier
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
// this software and associated documentation files (the "Software"), to deal in
|
||||
// the Software without restriction, including without limitation the rights to
|
||||
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
// of the Software, and to permit persons to whom the Software is furnished to do
|
||||
// so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <CoreData/CoreData.h>
|
||||
|
||||
@interface AppDelegate : NSObject <NSApplicationDelegate>
|
||||
@property (readonly, strong) NSPersistentContainer *persistentContainer;
|
||||
- (IBAction)quitClicked:(id)sender;
|
||||
@end
|
||||
|
||||
150
baRSS/AppDelegate.m
Normal file
150
baRSS/AppDelegate.m
Normal file
@@ -0,0 +1,150 @@
|
||||
//
|
||||
// The MIT License (MIT)
|
||||
// Copyright (c) 2018 Oleg Geier
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
// this software and associated documentation files (the "Software"), to deal in
|
||||
// the Software without restriction, including without limitation the rights to
|
||||
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
// of the Software, and to permit persons to whom the Software is furnished to do
|
||||
// so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
#import "AppDelegate.h"
|
||||
#import "PyHandler.cpp"
|
||||
|
||||
@interface AppDelegate ()
|
||||
@property (strong) NSStatusItem *statusItem;
|
||||
@property (weak) IBOutlet NSMenu *statusMenu;
|
||||
@end
|
||||
|
||||
@implementation AppDelegate
|
||||
|
||||
- (IBAction)quitClicked:(id)sender {
|
||||
[NSApplication.sharedApplication terminate:self];
|
||||
}
|
||||
|
||||
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
|
||||
// Insert code here to initialize your application
|
||||
self.statusItem = [NSStatusBar.systemStatusBar statusItemWithLength:NSVariableStatusItemLength];
|
||||
self.statusItem.title = @"me";
|
||||
self.statusItem.menu = self.statusMenu;
|
||||
int a[] = {2017,8,9,13,9,59,0,0,0};
|
||||
printf("will init\n");
|
||||
pyhandler_init();
|
||||
printf("done\n");
|
||||
printf("%s", pyhandler_getWithDateArr([@"https://feeds.feedburner.com/simpledesktops" UTF8String], NULL, a));
|
||||
[self quitClicked:nil];
|
||||
}
|
||||
|
||||
- (void)applicationWillTerminate:(NSNotification *)aNotification {
|
||||
// Insert code here to tear down your application
|
||||
}
|
||||
|
||||
#pragma mark - Core Data stack
|
||||
|
||||
@synthesize persistentContainer = _persistentContainer;
|
||||
|
||||
- (NSPersistentContainer *)persistentContainer {
|
||||
// The persistent container for the application. This implementation creates and returns a container, having loaded the store for the application to it.
|
||||
@synchronized (self) {
|
||||
if (_persistentContainer == nil) {
|
||||
_persistentContainer = [[NSPersistentContainer alloc] initWithName:@"baRSS"];
|
||||
[_persistentContainer loadPersistentStoresWithCompletionHandler:^(NSPersistentStoreDescription *storeDescription, NSError *error) {
|
||||
if (error != nil) {
|
||||
// Replace this implementation with code to handle the error appropriately.
|
||||
// abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
|
||||
|
||||
/*
|
||||
Typical reasons for an error here include:
|
||||
* The parent directory does not exist, cannot be created, or disallows writing.
|
||||
* The persistent store is not accessible, due to permissions or data protection when the device is locked.
|
||||
* The device is out of space.
|
||||
* The store could not be migrated to the current model version.
|
||||
Check the error message to determine what the actual problem was.
|
||||
*/
|
||||
NSLog(@"Unresolved error %@, %@", error, error.userInfo);
|
||||
abort();
|
||||
}
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
return _persistentContainer;
|
||||
}
|
||||
|
||||
#pragma mark - Core Data Saving and Undo support
|
||||
|
||||
- (IBAction)saveAction:(id)sender {
|
||||
// Performs the save action for the application, which is to send the save: message to the application's managed object context. Any encountered errors are presented to the user.
|
||||
NSManagedObjectContext *context = self.persistentContainer.viewContext;
|
||||
|
||||
if (![context commitEditing]) {
|
||||
NSLog(@"%@:%@ unable to commit editing before saving", [self class], NSStringFromSelector(_cmd));
|
||||
}
|
||||
|
||||
NSError *error = nil;
|
||||
if (context.hasChanges && ![context save:&error]) {
|
||||
// Customize this code block to include application-specific recovery steps.
|
||||
[[NSApplication sharedApplication] presentError:error];
|
||||
}
|
||||
}
|
||||
|
||||
- (NSUndoManager *)windowWillReturnUndoManager:(NSWindow *)window {
|
||||
// Returns the NSUndoManager for the application. In this case, the manager returned is that of the managed object context for the application.
|
||||
return self.persistentContainer.viewContext.undoManager;
|
||||
}
|
||||
|
||||
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender {
|
||||
// Save changes in the application's managed object context before the application terminates.
|
||||
NSManagedObjectContext *context = self.persistentContainer.viewContext;
|
||||
|
||||
if (![context commitEditing]) {
|
||||
NSLog(@"%@:%@ unable to commit editing to terminate", [self class], NSStringFromSelector(_cmd));
|
||||
return NSTerminateCancel;
|
||||
}
|
||||
|
||||
if (!context.hasChanges) {
|
||||
return NSTerminateNow;
|
||||
}
|
||||
|
||||
NSError *error = nil;
|
||||
if (![context save:&error]) {
|
||||
|
||||
// Customize this code block to include application-specific recovery steps.
|
||||
BOOL result = [sender presentError:error];
|
||||
if (result) {
|
||||
return NSTerminateCancel;
|
||||
}
|
||||
|
||||
NSString *question = NSLocalizedString(@"Could not save changes while quitting. Quit anyway?", @"Quit without saves error question message");
|
||||
NSString *info = NSLocalizedString(@"Quitting now will lose any changes you have made since the last successful save", @"Quit without saves error question info");
|
||||
NSString *quitButton = NSLocalizedString(@"Quit anyway", @"Quit anyway button title");
|
||||
NSString *cancelButton = NSLocalizedString(@"Cancel", @"Cancel button title");
|
||||
NSAlert *alert = [[NSAlert alloc] init];
|
||||
[alert setMessageText:question];
|
||||
[alert setInformativeText:info];
|
||||
[alert addButtonWithTitle:quitButton];
|
||||
[alert addButtonWithTitle:cancelButton];
|
||||
|
||||
NSInteger answer = [alert runModal];
|
||||
|
||||
if (answer == NSAlertSecondButtonReturn) {
|
||||
return NSTerminateCancel;
|
||||
}
|
||||
}
|
||||
|
||||
return NSTerminateNow;
|
||||
}
|
||||
|
||||
@end
|
||||
58
baRSS/Assets.xcassets/AppIcon.appiconset/Contents.json
Normal file
58
baRSS/Assets.xcassets/AppIcon.appiconset/Contents.json
Normal file
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "16x16",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "16x16",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "32x32",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "32x32",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "128x128",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "128x128",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "256x256",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "256x256",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "512x512",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "512x512",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
6
baRSS/Assets.xcassets/Contents.json
Normal file
6
baRSS/Assets.xcassets/Contents.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
462
baRSS/Base.lproj/Main.xib
Normal file
462
baRSS/Base.lproj/Main.xib
Normal file
@@ -0,0 +1,462 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14113" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14113"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
|
||||
<connections>
|
||||
<outlet property="delegate" destination="Voe-Tx-rLC" id="GzC-gU-4Uq"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<customObject id="Voe-Tx-rLC" customClass="AppDelegate">
|
||||
<connections>
|
||||
<outlet property="statusMenu" destination="tDc-nD-HS2" id="eHw-32-GGa"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="YLy-65-1bz" customClass="NSFontManager"/>
|
||||
<customObject id="he0-Eb-PDA" customClass="NewsController">
|
||||
<connections>
|
||||
<outlet property="managedObjectContext" destination="ESi-qE-Dj9" id="Nnv-1A-WLk"/>
|
||||
<outlet property="openUnreadItem" destination="Qqw-Xj-oA5" id="8df-is-Qop"/>
|
||||
<outlet property="pauseItem" destination="D7r-Vb-9eO" id="o7e-jD-3Yj"/>
|
||||
<outlet property="updateAllItem" destination="wgp-fa-8Wj" id="edP-bQ-bIM"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="bgB-po-1IK" customClass="Preferences">
|
||||
<connections>
|
||||
<outlet property="appDelegate" destination="Voe-Tx-rLC" id="1aD-dC-e6r"/>
|
||||
<outlet property="toolbar" destination="wLj-fD-HpE" id="bMA-dd-1H1"/>
|
||||
<outlet property="viewFeeds" destination="EwH-fT-yW8" id="pmQ-as-O2V"/>
|
||||
<outlet property="viewGeneral" destination="8H4-sI-Ub8" id="lWU-Il-4in"/>
|
||||
<outlet property="window" destination="ai3-RW-O8g" id="Ncu-vV-dTy"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<menu id="tDc-nD-HS2">
|
||||
<items>
|
||||
<menuItem title="Pause Updates" id="D7r-Vb-9eO">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="pauseUpdates:" target="he0-Eb-PDA" id="9Nm-b4-h4h"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Update All Feeds" id="wgp-fa-8Wj">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="updateAllFeeds:" target="he0-Eb-PDA" id="z7p-Ax-hgc"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Open All Unread" id="Qqw-Xj-oA5">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="openAllUnread:" target="he0-Eb-PDA" id="bgo-Tt-0sv"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="ld2-b0-07a"/>
|
||||
<menuItem isSeparatorItem="YES" id="1VS-wM-kTc"/>
|
||||
<menuItem title="Preferences" keyEquivalent="," id="VFY-eR-2EA">
|
||||
<connections>
|
||||
<action selector="showWindow:" target="bgB-po-1IK" id="eBk-Wq-1eA"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Quit" keyEquivalent="q" id="Nb6-yK-a1A">
|
||||
<connections>
|
||||
<action selector="quitClicked:" target="Voe-Tx-rLC" id="itf-Lt-9Yn"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
<point key="canvasLocation" x="277" y="419"/>
|
||||
</menu>
|
||||
<window title="baRSS Preferences" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" showsToolbarButton="NO" visibleAtLaunch="NO" frameAutosaveName="" animationBehavior="default" tabbingMode="disallowed" id="ai3-RW-O8g" userLabel="Preferences">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="131" y="159" width="320" height="327"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="878"/>
|
||||
<value key="minSize" type="size" width="320" height="327"/>
|
||||
<view key="contentView" id="ct3-G7-3SQ">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="327"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</view>
|
||||
<toolbar key="toolbar" implicitIdentifier="5B23E7E6-13E5-4910-875D-2E3EA566F38B" autosavesConfiguration="NO" allowsUserCustomization="NO" displayMode="iconAndLabel" sizeMode="regular" id="wLj-fD-HpE">
|
||||
<allowedToolbarItems>
|
||||
<toolbarItem implicitItemIdentifier="AF4483E3-0457-47B7-AE52-AC11B1545455" explicitItemIdentifier="preferencesTabGeneral" label="General" paletteLabel="General" tag="-1" image="NSPreferencesGeneral" selectable="YES" id="0qP-ah-ojT">
|
||||
<connections>
|
||||
<action selector="clickGeneral:" target="bgB-po-1IK" id="G4I-Zs-FZR"/>
|
||||
</connections>
|
||||
</toolbarItem>
|
||||
<toolbarItem implicitItemIdentifier="E8527558-3D5F-4B79-99E4-675C1557D10B" explicitItemIdentifier="preferencesTabFeeds" label="Feeds" paletteLabel="Feeds" tag="-1" image="NSUserAccounts" selectable="YES" id="Av5-VA-zps">
|
||||
<connections>
|
||||
<action selector="clickFeeds:" target="bgB-po-1IK" id="Daq-b8-lpE"/>
|
||||
</connections>
|
||||
</toolbarItem>
|
||||
</allowedToolbarItems>
|
||||
<defaultToolbarItems>
|
||||
<toolbarItem reference="0qP-ah-ojT"/>
|
||||
<toolbarItem reference="Av5-VA-zps"/>
|
||||
</defaultToolbarItems>
|
||||
</toolbar>
|
||||
<point key="canvasLocation" x="-20" y="521"/>
|
||||
</window>
|
||||
<customView id="8H4-sI-Ub8" userLabel="Preferences-General">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="327"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="8fg-Da-IP3">
|
||||
<rect key="frame" x="18" y="291" width="284" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="check" title="Start on login" bezelStyle="regularSquare" imagePosition="left" inset="2" id="FZH-Op-qbn">
|
||||
<behavior key="behavior" pushIn="YES" changeContents="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<binding destination="K8S-BW-Na6" name="value" keyPath="values.startOnLogin" id="pzI-fT-f6T">
|
||||
<dictionary key="options">
|
||||
<bool key="NSAllowsEditingMultipleValuesSelection" value="NO"/>
|
||||
<integer key="NSNullPlaceholder" value="0"/>
|
||||
</dictionary>
|
||||
</binding>
|
||||
</connections>
|
||||
</button>
|
||||
<popUpButton verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="jeZ-Rk-wS6">
|
||||
<rect key="frame" x="155" y="17" width="148" height="26"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<popUpButtonCell key="cell" type="push" title="Default" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="Yb2-0r-GxD" id="g3B-HQ-prd">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="menu"/>
|
||||
<menu key="menu" id="UbA-VE-jT1">
|
||||
<items>
|
||||
<menuItem title="Default" state="on" id="Yb2-0r-GxD"/>
|
||||
<menuItem title="Safari" id="ewS-Sd-pW6"/>
|
||||
<menuItem title="other …" id="Hes-dQ-Wvu"/>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
</popUpButton>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="xcd-GA-o0T">
|
||||
<rect key="frame" x="18" y="22" width="133" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Open URL in:" id="ne1-ti-s3Q">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="fLb-n2-4Ao">
|
||||
<rect key="frame" x="18" y="248" width="284" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Show number of unread items:" id="nWD-1j-TOY">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="GUs-Oh-hZV">
|
||||
<rect key="frame" x="28" y="204" width="274" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="check" title="in groups" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="f74-LA-5Jp">
|
||||
<behavior key="behavior" pushIn="YES" changeContents="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<binding destination="K8S-BW-Na6" name="value" keyPath="values.unreadCountInGroups" id="s02-VK-YK9">
|
||||
<dictionary key="options">
|
||||
<bool key="NSAllowsEditingMultipleValuesSelection" value="NO"/>
|
||||
<integer key="NSNullPlaceholder" value="1"/>
|
||||
</dictionary>
|
||||
</binding>
|
||||
</connections>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="4DT-ca-4Lc">
|
||||
<rect key="frame" x="28" y="224" width="274" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="check" title="in menu bar" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="pdX-rq-cJn">
|
||||
<behavior key="behavior" pushIn="YES" changeContents="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<binding destination="K8S-BW-Na6" name="value" keyPath="values.unreadCountInMenuBar" id="5a2-tl-pbO">
|
||||
<dictionary key="options">
|
||||
<bool key="NSAllowsEditingMultipleValuesSelection" value="NO"/>
|
||||
<integer key="NSNullPlaceholder" value="1"/>
|
||||
</dictionary>
|
||||
</binding>
|
||||
</connections>
|
||||
</button>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="hUj-05-l3n">
|
||||
<rect key="frame" x="18" y="161" width="284" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Show in global menu:" id="diU-z3-ANf">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="AC4-r5-7Bp">
|
||||
<rect key="frame" x="28" y="137" width="274" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="check" title="Open all unread" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="ZJe-uW-2ZH">
|
||||
<behavior key="behavior" pushIn="YES" changeContents="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<binding destination="K8S-BW-Na6" name="value" keyPath="values.globalOpenUnread" id="RL3-dW-r1i">
|
||||
<dictionary key="options">
|
||||
<bool key="NSAllowsEditingMultipleValuesSelection" value="NO"/>
|
||||
<integer key="NSNullPlaceholder" value="1"/>
|
||||
</dictionary>
|
||||
</binding>
|
||||
</connections>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="JUl-Yj-If7">
|
||||
<rect key="frame" x="28" y="97" width="274" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="check" title="Mark all read" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="Nuu-c7-so1">
|
||||
<behavior key="behavior" pushIn="YES" changeContents="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<binding destination="K8S-BW-Na6" name="value" keyPath="values.globalMarkRead" id="F1p-mq-ioJ">
|
||||
<dictionary key="options">
|
||||
<bool key="NSAllowsEditingMultipleValuesSelection" value="NO"/>
|
||||
<integer key="NSNullPlaceholder" value="1"/>
|
||||
</dictionary>
|
||||
</binding>
|
||||
</connections>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="IYk-kt-g6F">
|
||||
<rect key="frame" x="28" y="77" width="274" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="check" title="Mark all unread" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="J6a-Sa-Jln">
|
||||
<behavior key="behavior" pushIn="YES" changeContents="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<binding destination="K8S-BW-Na6" name="value" keyPath="values.globalMarkUnread" id="xrj-88-9Vx">
|
||||
<dictionary key="options">
|
||||
<bool key="NSAllowsEditingMultipleValuesSelection" value="NO"/>
|
||||
<integer key="NSNullPlaceholder" value="1"/>
|
||||
</dictionary>
|
||||
</binding>
|
||||
</connections>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="IXp-K9-rmH">
|
||||
<rect key="frame" x="28" y="117" width="274" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="check" title="Update all feeds" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="QlO-jJ-wwY">
|
||||
<behavior key="behavior" pushIn="YES" changeContents="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<binding destination="K8S-BW-Na6" name="value" keyPath="values.globalUpdateAll" id="Z0d-uc-Zkk">
|
||||
<dictionary key="options">
|
||||
<bool key="NSAllowsEditingMultipleValuesSelection" value="NO"/>
|
||||
<integer key="NSNullPlaceholder" value="1"/>
|
||||
</dictionary>
|
||||
</binding>
|
||||
</connections>
|
||||
</button>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="iSF-za-duw">
|
||||
<rect key="frame" x="18" y="49" width="133" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Menu bar icon:" id="fA3-89-Vs4">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<imageView focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="kF6-OS-VSu">
|
||||
<rect key="frame" x="156" y="42" width="32" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<imageCell key="cell" selectable="YES" editable="YES" focusRingType="none" alignment="left" imageScaling="proportionallyDown" imageFrameStyle="grayBezel" image="NSBookmarksTemplate" id="KDF-hq-a31"/>
|
||||
</imageView>
|
||||
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="OgL-gT-9RX">
|
||||
<rect key="frame" x="28" y="184" width="274" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="check" title="in feeds" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="Zg8-Xf-2Xh">
|
||||
<behavior key="behavior" pushIn="YES" changeContents="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<binding destination="K8S-BW-Na6" name="value" keyPath="values.unreadCountInFeeds" id="QNe-dP-6av">
|
||||
<dictionary key="options">
|
||||
<bool key="NSAllowsEditingMultipleValuesSelection" value="NO"/>
|
||||
<integer key="NSNullPlaceholder" value="1"/>
|
||||
</dictionary>
|
||||
</binding>
|
||||
</connections>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Gv1-xI-QZh">
|
||||
<rect key="frame" x="18" y="271" width="284" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="check" title="Show tick mark for unread entries" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="wDf-M5-15o">
|
||||
<behavior key="behavior" pushIn="YES" changeContents="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<binding destination="K8S-BW-Na6" name="value" keyPath="values.markEntries" id="otO-lj-Y6D">
|
||||
<dictionary key="options">
|
||||
<bool key="NSAllowsEditingMultipleValuesSelection" value="NO"/>
|
||||
<integer key="NSNullPlaceholder" value="1"/>
|
||||
</dictionary>
|
||||
</binding>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<point key="canvasLocation" x="-20" y="903.5"/>
|
||||
</customView>
|
||||
<customView id="EwH-fT-yW8" userLabel="Preferences-Feeds">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="327"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<scrollView fixedFrame="YES" autohidesScrollers="YES" horizontalLineScroll="19" horizontalPageScroll="10" verticalLineScroll="19" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jUM-kR-Dxs">
|
||||
<rect key="frame" x="0.0" y="20" width="320" height="307"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<clipView key="contentView" ambiguous="YES" id="nZO-rz-NyQ">
|
||||
<rect key="frame" x="1" y="0.0" width="318" height="306"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<outlineView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" multipleSelection="NO" autosaveColumns="NO" rowSizeStyle="automatic" headerView="sii-NE-JkJ" viewBased="YES" indentationPerLevel="16" outlineTableColumn="Lb1-9n-wlc" id="hKk-G1-1po">
|
||||
<rect key="frame" x="0.0" y="0.0" width="318" height="283"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<size key="intercellSpacing" width="3" height="2"/>
|
||||
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
|
||||
<tableColumns>
|
||||
<tableColumn identifier="" editable="NO" width="252.5" minWidth="40" maxWidth="1000" id="Lb1-9n-wlc">
|
||||
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" title="Name">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
|
||||
</tableHeaderCell>
|
||||
<textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" title="Text Cell" id="cH3-bR-o7w">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES"/>
|
||||
<prototypeCellViews>
|
||||
<tableCellView id="6yl-oX-eNn">
|
||||
<rect key="frame" x="1" y="1" width="253" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Z97-we-rgn">
|
||||
<rect key="frame" x="0.0" y="0.0" width="253" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Table View Cell" id="FGY-QQ-joq">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
</subviews>
|
||||
<connections>
|
||||
<outlet property="textField" destination="Z97-we-rgn" id="Xfe-pC-8kn"/>
|
||||
</connections>
|
||||
</tableCellView>
|
||||
</prototypeCellViews>
|
||||
</tableColumn>
|
||||
<tableColumn identifier="" editable="NO" width="59.5" minWidth="40" maxWidth="1000" id="8st-OH-BXG">
|
||||
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" title="Update">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
|
||||
</tableHeaderCell>
|
||||
<textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" title="Text Cell" id="mMS-tN-b0C">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</tableColumn>
|
||||
</tableColumns>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="he0-Eb-PDA" id="bid-ep-fYr"/>
|
||||
<outlet property="delegate" destination="he0-Eb-PDA" id="FV8-3T-QDV"/>
|
||||
</connections>
|
||||
</outlineView>
|
||||
</subviews>
|
||||
</clipView>
|
||||
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="lc2-zx-cet">
|
||||
<rect key="frame" x="1" y="7" width="0.0" height="16"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
<scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="NO" id="mHR-Uh-oAd">
|
||||
<rect key="frame" x="-15" y="23" width="16" height="0.0"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
<tableHeaderView key="headerView" id="sii-NE-JkJ">
|
||||
<rect key="frame" x="0.0" y="0.0" width="318" height="23"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</tableHeaderView>
|
||||
</scrollView>
|
||||
<button toolTip="Create new feed item" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="jBx-pE-TgX">
|
||||
<rect key="frame" x="0.0" y="-1" width="25" height="23"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<buttonCell key="cell" type="smallSquare" alternateTitle="Add feed" bezelStyle="smallSquare" image="NSAddTemplate" imagePosition="overlaps" alignment="center" lineBreakMode="truncatingTail" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="WMA-eZ-pOl">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="addFeed:" target="he0-Eb-PDA" id="dC1-tw-xxy"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button toolTip="Delete item" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="kwZ-TS-nM7">
|
||||
<rect key="frame" x="24" y="-1" width="25" height="23"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<buttonCell key="cell" type="smallSquare" alternateTitle="Remove Feed" bezelStyle="smallSquare" image="NSRemoveTemplate" imagePosition="overlaps" alignment="center" lineBreakMode="truncatingTail" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="d9M-ZD-oma">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="removeFeed:" target="he0-Eb-PDA" id="C4r-3D-ARB"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button toolTip="Add new line separator" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="BRb-Je-jM4">
|
||||
<rect key="frame" x="96" y="-1" width="25" height="23"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<buttonCell key="cell" type="smallSquare" title="---" alternateTitle="Add separator" bezelStyle="smallSquare" image="NSPathTemplate" alignment="center" lineBreakMode="truncatingTail" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="eK7-zU-Qd2">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="addSeparator:" target="he0-Eb-PDA" id="68L-xT-tM9"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button toolTip="Add new grouping folder" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="kQF-LC-quC">
|
||||
<rect key="frame" x="72" y="-1" width="25" height="23"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<buttonCell key="cell" type="smallSquare" alternateTitle="Add group" bezelStyle="smallSquare" image="NSPathTemplate" imagePosition="overlaps" alignment="center" lineBreakMode="truncatingTail" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="9m2-U5-xE2">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="addGroup:" target="he0-Eb-PDA" id="82S-0f-6d9"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button hidden="YES" toolTip="Import or Export data" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="XaQ-S9-guo">
|
||||
<rect key="frame" x="295" y="-1" width="25" height="23"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
|
||||
<buttonCell key="cell" type="smallSquare" alternateTitle="Export" bezelStyle="smallSquare" image="NSShareTemplate" imagePosition="overlaps" alignment="center" lineBreakMode="truncatingTail" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="fhQ-ZO-ocb">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
</button>
|
||||
</subviews>
|
||||
<point key="canvasLocation" x="350" y="903.5"/>
|
||||
</customView>
|
||||
<managedObjectContext id="ESi-qE-Dj9"/>
|
||||
<userDefaultsController representsSharedInstance="YES" id="K8S-BW-Na6"/>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="NSAddTemplate" width="11" height="11"/>
|
||||
<image name="NSBookmarksTemplate" width="17" height="18"/>
|
||||
<image name="NSPathTemplate" width="16" height="10"/>
|
||||
<image name="NSPreferencesGeneral" width="32" height="32"/>
|
||||
<image name="NSRemoveTemplate" width="11" height="11"/>
|
||||
<image name="NSShareTemplate" width="11" height="16"/>
|
||||
<image name="NSUserAccounts" width="32" height="32"/>
|
||||
</resources>
|
||||
</document>
|
||||
34
baRSS/Info.plist
Normal file
34
baRSS/Info.plist
Normal file
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||
<key>LSUIElement</key>
|
||||
<true/>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2018 relikd. All rights reserved.</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>Main</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
</dict>
|
||||
</plist>
|
||||
26
baRSS/NewsController.h
Normal file
26
baRSS/NewsController.h
Normal file
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// The MIT License (MIT)
|
||||
// Copyright (c) 2018 Oleg Geier
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
// this software and associated documentation files (the "Software"), to deal in
|
||||
// the Software without restriction, including without limitation the rights to
|
||||
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
// of the Software, and to permit persons to whom the Software is furnished to do
|
||||
// so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface NewsController : NSViewController <NSOutlineViewDataSource, NSOutlineViewDelegate>
|
||||
@end
|
||||
79
baRSS/NewsController.m
Normal file
79
baRSS/NewsController.m
Normal file
@@ -0,0 +1,79 @@
|
||||
//
|
||||
// The MIT License (MIT)
|
||||
// Copyright (c) 2018 Oleg Geier
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
// this software and associated documentation files (the "Software"), to deal in
|
||||
// the Software without restriction, including without limitation the rights to
|
||||
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
// of the Software, and to permit persons to whom the Software is furnished to do
|
||||
// so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
#import "NewsController.h"
|
||||
|
||||
@interface NewsController ()
|
||||
@property (weak) IBOutlet NSMenuItem *pauseItem;
|
||||
@property (weak) IBOutlet NSMenuItem *updateAllItem;
|
||||
@property (weak) IBOutlet NSMenuItem *openUnreadItem;
|
||||
@property (weak) IBOutlet NSManagedObjectContext *managedObjectContext;
|
||||
@end
|
||||
|
||||
@implementation NewsController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do view setup here.
|
||||
}
|
||||
- (IBAction)pauseUpdates:(NSMenuItem *)sender {
|
||||
NSLog(@"pause");
|
||||
NSLog(@"%@", self.managedObjectContext);
|
||||
}
|
||||
- (IBAction)updateAllFeeds:(NSMenuItem *)sender {
|
||||
NSLog(@"update all");
|
||||
}
|
||||
- (IBAction)openAllUnread:(NSMenuItem *)sender {
|
||||
NSLog(@"all unread");
|
||||
}
|
||||
- (IBAction)addFeed:(NSButton *)sender {
|
||||
NSLog(@"add feed");
|
||||
NSLog(@"%@", self.managedObjectContext);
|
||||
}
|
||||
- (IBAction)removeFeed:(NSButton *)sender {
|
||||
NSLog(@"del feed");
|
||||
}
|
||||
- (IBAction)addGroup:(NSButton *)sender {
|
||||
NSLog(@"add group");
|
||||
}
|
||||
- (IBAction)addSeparator:(NSButton *)sender {
|
||||
NSLog(@"add separator");
|
||||
}
|
||||
|
||||
|
||||
- (NSInteger)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item {
|
||||
return 1;
|
||||
}
|
||||
|
||||
- (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item {
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item {
|
||||
return @"du";
|
||||
}
|
||||
|
||||
- (id)outlineView:(NSOutlineView *)outlineView child:(NSInteger)index ofItem:(id)item {
|
||||
return @"hi";
|
||||
}
|
||||
|
||||
@end
|
||||
27
baRSS/Preferences.h
Normal file
27
baRSS/Preferences.h
Normal file
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// The MIT License (MIT)
|
||||
// Copyright (c) 2018 Oleg Geier
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
// this software and associated documentation files (the "Software"), to deal in
|
||||
// the Software without restriction, including without limitation the rights to
|
||||
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
// of the Software, and to permit persons to whom the Software is furnished to do
|
||||
// so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface Preferences : NSWindowController
|
||||
|
||||
@end
|
||||
64
baRSS/Preferences.m
Normal file
64
baRSS/Preferences.m
Normal file
@@ -0,0 +1,64 @@
|
||||
//
|
||||
// The MIT License (MIT)
|
||||
// Copyright (c) 2018 Oleg Geier
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
// this software and associated documentation files (the "Software"), to deal in
|
||||
// the Software without restriction, including without limitation the rights to
|
||||
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
// of the Software, and to permit persons to whom the Software is furnished to do
|
||||
// so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
#import "Preferences.h"
|
||||
#import "AppDelegate.h"
|
||||
|
||||
@interface Preferences ()
|
||||
@property (weak) IBOutlet NSToolbar *toolbar;
|
||||
@property (weak) IBOutlet NSView *viewGeneral;
|
||||
@property (weak) IBOutlet NSView *viewFeeds;
|
||||
@property (weak) IBOutlet AppDelegate *appDelegate;
|
||||
@end
|
||||
|
||||
@implementation Preferences
|
||||
|
||||
- (void)windowDidLoad {
|
||||
[super windowDidLoad];
|
||||
NSLog(@"%@", @"hi");
|
||||
// Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
|
||||
}
|
||||
|
||||
- (IBAction)clickGeneral:(NSToolbarItem *)sender {
|
||||
self.window.contentView = self.viewGeneral;
|
||||
}
|
||||
|
||||
- (IBAction)clickFeeds:(NSToolbarItem *)sender {
|
||||
self.window.contentView = self.viewFeeds;
|
||||
}
|
||||
|
||||
- (BOOL)acceptsFirstResponder {
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)keyDown:(NSEvent *)event {
|
||||
if (event.modifierFlags & NSEventModifierFlagCommand) {
|
||||
if ([event.characters isEqualToString:@"w"]) {
|
||||
[self close];
|
||||
} else if ([event.characters isEqualToString:@"q"]) {
|
||||
[self.appDelegate quitClicked:self];
|
||||
}
|
||||
// TODO: new, delete, ...
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
127
baRSS/PyHandler.cpp
Normal file
127
baRSS/PyHandler.cpp
Normal file
@@ -0,0 +1,127 @@
|
||||
//
|
||||
// The MIT License (MIT)
|
||||
// Copyright (c) 2018 Oleg Geier
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
// this software and associated documentation files (the "Software"), to deal in
|
||||
// the Software without restriction, including without limitation the rights to
|
||||
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
// of the Software, and to permit persons to whom the Software is furnished to do
|
||||
// so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
#include <stdio.h>
|
||||
#include <Python/Python.h>
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
|
||||
static PyObject *parseFeed;
|
||||
|
||||
PyObject* appBundlePath() {
|
||||
CFBundleRef mainBundle = CFBundleGetMainBundle();
|
||||
CFURLRef appPath = CFBundleCopyResourcesDirectoryURL(mainBundle);
|
||||
CFURLRef absolutePath = CFURLCopyAbsoluteURL(appPath);
|
||||
CFStringRef path = CFURLCopyFileSystemPath(absolutePath, kCFURLPOSIXPathStyle);
|
||||
const char *resourcePath = CFStringGetCStringPtr(path, CFStringGetSystemEncoding());
|
||||
// const char *resourcePath = [[[NSBundle mainBundle] resourcePath] UTF8String];
|
||||
CFRelease(path);
|
||||
CFRelease(absolutePath);
|
||||
CFRelease(appPath);
|
||||
return PyString_FromString(resourcePath);
|
||||
}
|
||||
|
||||
void pyhandler_init() {
|
||||
Py_Initialize();
|
||||
PyObject *sys = PyImport_Import(PyString_FromString("sys"));
|
||||
PyObject *sys_path_append = PyObject_GetAttrString(PyObject_GetAttrString(sys, "path"), "append");
|
||||
PyObject *resourcePath = PyTuple_New(1);
|
||||
PyTuple_SetItem(resourcePath, 0, appBundlePath());
|
||||
PyObject_CallObject(sys_path_append, resourcePath);
|
||||
|
||||
// import MyModule # this is in my project folder
|
||||
PyObject *myModule = PyImport_Import(PyString_FromString("getFeed"));
|
||||
parseFeed = PyObject_GetAttrString(myModule, "parse");
|
||||
}
|
||||
|
||||
void pyhandler_shutdown() {
|
||||
PyObject_Free(parseFeed);
|
||||
Py_Finalize();
|
||||
}
|
||||
|
||||
char* pyhandler_run(PyObject *args) {
|
||||
if (parseFeed && PyCallable_Check(parseFeed)) {
|
||||
PyObject *result = PyObject_CallObject(parseFeed, args);
|
||||
if (result != NULL && PyObject_TypeCheck(result, &PyString_Type))
|
||||
return PyString_AsString(result);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char* pyhandler_getWithDateStr(const char * url, const char * etag, void * date) {
|
||||
return pyhandler_run(Py_BuildValue("(z z z)", url, etag, date));
|
||||
}
|
||||
|
||||
char* pyhandler_getWithDateArr(const char * url, const char * etag, int * d) {
|
||||
if (d == NULL || abs(d[8]) > 1) { // d[8] == tm_isdst (between -1 and 1). Array size must be 9
|
||||
return pyhandler_run(Py_BuildValue("(z z z)", url, etag, NULL));
|
||||
}
|
||||
return pyhandler_run(Py_BuildValue("(z z [iiiiiiiii])", url, etag,
|
||||
d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7], d[8]));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// @see https://docs.python.org/3/c-api/index.html
|
||||
/* PyObject *ObjcToPyObject(id object)
|
||||
{
|
||||
if (object == nil) {
|
||||
// This technically doesn't need to be an extra case,
|
||||
// but you may want to differentiate it for error checking
|
||||
return NULL;
|
||||
} else if ([object isKindOfClass:[NSString class]]) {
|
||||
return PyString_FromString([object UTF8String]);
|
||||
} else if ([object isKindOfClass:[NSNumber class]]) {
|
||||
// You could probably do some extra checking here if you need to
|
||||
// with the -objCType method.
|
||||
return PyLong_FromLong([object longValue]);
|
||||
} else if ([object isKindOfClass:[NSArray class]]) {
|
||||
// You may want to differentiate between NSArray (analagous to tuples)
|
||||
// and NSMutableArray (analagous to lists) here.
|
||||
Py_ssize_t i, len = [object count];
|
||||
PyObject *list = PyList_New(len);
|
||||
for (i = 0; i < len; ++i) {
|
||||
PyObject *item = ObjcToPyObject([object objectAtIndex:i]);
|
||||
NSCAssert(item != NULL, @"Can't add NULL item to Python List");
|
||||
// Note that PyList_SetItem() "steals" the reference to the passed item.
|
||||
// (i.e., you do not need to release it)
|
||||
PyList_SetItem(list, i, item);
|
||||
}
|
||||
return list;
|
||||
} else if ([object isKindOfClass:[NSDictionary class]]) {
|
||||
PyObject *dict = PyDict_New();
|
||||
for (id key in object) {
|
||||
PyObject *pyKey = ObjcToPyObject(key);
|
||||
NSCAssert(pyKey != NULL, @"Can't add NULL key to Python Dictionary");
|
||||
PyObject *pyItem = ObjcToPyObject([object objectForKey:key]);
|
||||
NSCAssert(pyItem != NULL, @"Can't add NULL item to Python Dictionary");
|
||||
PyDict_SetItem(dict, pyKey, pyItem);
|
||||
Py_DECREF(pyKey);
|
||||
Py_DECREF(pyItem);
|
||||
}
|
||||
return dict;
|
||||
} else {
|
||||
NSLog(@"ObjcToPyObject() could not convert Obj-C object to PyObject.");
|
||||
return NULL;
|
||||
}
|
||||
} */
|
||||
|
||||
12
baRSS/baRSS.entitlements
Normal file
12
baRSS/baRSS.entitlements
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.app-sandbox</key>
|
||||
<true/>
|
||||
<key>com.apple.security.files.user-selected.read-only</key>
|
||||
<true/>
|
||||
<key>com.apple.security.network.client</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
8
baRSS/baRSS.xcdatamodeld/.xccurrentversion
Normal file
8
baRSS/baRSS.xcdatamodeld/.xccurrentversion
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>_XCCurrentVersionName</key>
|
||||
<string>baRRS.xcdatamodel</string>
|
||||
</dict>
|
||||
</plist>
|
||||
4
baRSS/baRSS.xcdatamodeld/baRRS.xcdatamodel/contents
Normal file
4
baRSS/baRSS.xcdatamodeld/baRRS.xcdatamodel/contents
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="1" systemVersion="11A491" minimumToolsVersion="Automatic" sourceLanguage="Objective-C" userDefinedModelVersionIdentifier="">
|
||||
<elements/>
|
||||
</model>
|
||||
4008
baRSS/feedparser521.py
Normal file
4008
baRSS/feedparser521.py
Normal file
File diff suppressed because it is too large
Load Diff
114
baRSS/getFeed.py
Normal file
114
baRSS/getFeed.py
Normal file
@@ -0,0 +1,114 @@
|
||||
#!/usr/bin/env python
|
||||
__license__ = """
|
||||
The MIT License (MIT)
|
||||
Copyright (c) 2018 Oleg Geier
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
"""
|
||||
|
||||
import feedparser521 as fp
|
||||
import json
|
||||
import time
|
||||
|
||||
COPY_ENTRY_TAGS = False
|
||||
COPY_ENTRY_SUMMARY = False
|
||||
|
||||
|
||||
def valueFormatter(key, obj):
|
||||
if isinstance(obj, time.struct_time):
|
||||
return list(obj)
|
||||
if key == "etag":
|
||||
# stupid server convention to append but not consider changed etag
|
||||
# some servers append '-gzip' if gzip header is sent
|
||||
return obj.replace("-gzip", "")
|
||||
return obj
|
||||
|
||||
|
||||
def copyIfExists(source, source_path, target, target_path):
|
||||
src = source
|
||||
trgt = target
|
||||
try:
|
||||
srcPTH = source_path.split("/")
|
||||
trgtPTH = target_path.split("/")
|
||||
for x in srcPTH[:-1]:
|
||||
src = src[x]
|
||||
for x in trgtPTH[:-1]:
|
||||
trgt = trgt[x]
|
||||
|
||||
key = srcPTH[-1]
|
||||
trgt[trgtPTH[-1]] = valueFormatter(key, src[key])
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
||||
def prepareResult(obj):
|
||||
r = {"header": dict(), "feed": dict(), "entries": list()}
|
||||
try:
|
||||
if obj.debug_message.startswith("The feed has not changed since"):
|
||||
obj.status = 304
|
||||
except Exception:
|
||||
pass
|
||||
try:
|
||||
r["header"]["status"] = obj.status
|
||||
if obj.status == 304 or len(obj.entries) == 0:
|
||||
return r
|
||||
except Exception:
|
||||
return r
|
||||
|
||||
copyIfExists(obj, "etag", r, "header/etag")
|
||||
copyIfExists(obj, "modified", r, "header/modified")
|
||||
copyIfExists(obj, "headers/date", r, "header/date")
|
||||
copyIfExists(obj, "feed/title", r, "feed/title")
|
||||
copyIfExists(obj, "feed/subtitle", r, "feed/subtitle")
|
||||
copyIfExists(obj, "feed/author", r, "feed/author")
|
||||
copyIfExists(obj, "feed/link", r, "feed/link")
|
||||
copyIfExists(obj, "feed/image/href", r, "feed/icon")
|
||||
copyIfExists(obj, "feed/published_parsed", r, "feed/published")
|
||||
|
||||
for entry in obj.entries:
|
||||
e = dict()
|
||||
copyIfExists(entry, "title", e, "title")
|
||||
copyIfExists(entry, "subtitle", e, "subtitle")
|
||||
copyIfExists(entry, "author", e, "author")
|
||||
copyIfExists(entry, "link", e, "link")
|
||||
copyIfExists(entry, "published_parsed", e, "published")
|
||||
if COPY_ENTRY_SUMMARY:
|
||||
copyIfExists(entry, "summary", e, "summary")
|
||||
if COPY_ENTRY_TAGS:
|
||||
try:
|
||||
e["tags"] = list()
|
||||
for tag in entry.tags:
|
||||
e["tags"].append(tag.term)
|
||||
except Exception:
|
||||
pass
|
||||
r["entries"].append(e)
|
||||
return r
|
||||
|
||||
|
||||
def parse(url, etag=None, modified=None):
|
||||
print "mod:", modified
|
||||
if isinstance(modified, list):
|
||||
modified = time.struct_time(modified)
|
||||
print url
|
||||
print etag
|
||||
print modified
|
||||
return '[{"name":"joe","title":"none"},{"value":24}]'
|
||||
# d = fp.parse(url, etag=etag, modified=modified)
|
||||
# return json.dumps(prepareResult(d), separators=(',', ':'))
|
||||
|
||||
27
baRSS/main.m
Normal file
27
baRSS/main.m
Normal file
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// The MIT License (MIT)
|
||||
// Copyright (c) 2018 Oleg Geier
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
// this software and associated documentation files (the "Software"), to deal in
|
||||
// the Software without restriction, including without limitation the rights to
|
||||
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
// of the Software, and to permit persons to whom the Software is furnished to do
|
||||
// so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
int main(int argc, const char * argv[]) {
|
||||
return NSApplicationMain(argc, argv);
|
||||
}
|
||||
Reference in New Issue
Block a user