[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz/lava/gzz modules/email/FromFilter.java modu...
From: |
Benja Fallenstein |
Subject: |
[Gzz-commits] gzz/lava/gzz modules/email/FromFilter.java modu... |
Date: |
Mon, 06 Jan 2003 06:42:57 -0500 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Benja Fallenstein <address@hidden> 03/01/06 06:42:55
Modified files:
lava/gzz/modules/email: FromFilter.java ToFilter.java
lava/gzz/potion/potions: ChangeDim.java ChangeView.java
Types.java
lava/gzz/zzutil: Direction.java
Added files:
lava/gzz/modules/email: AllEmailsThat.java NewerFilter.java
NewerFilterFn.java OlderFilter.java
OlderFilterFn.java SubjectFilter.java
SubjectFilterFn.java
Log message:
Nico's changes from yesterday
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/lava/gzz/modules/email/AllEmailsThat.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/lava/gzz/modules/email/NewerFilter.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/lava/gzz/modules/email/NewerFilterFn.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/lava/gzz/modules/email/OlderFilter.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/lava/gzz/modules/email/OlderFilterFn.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/lava/gzz/modules/email/SubjectFilter.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/lava/gzz/modules/email/SubjectFilterFn.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/lava/gzz/modules/email/FromFilter.java.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/lava/gzz/modules/email/ToFilter.java.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/lava/gzz/potion/potions/ChangeDim.java.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/lava/gzz/potion/potions/ChangeView.java.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/lava/gzz/potion/potions/Types.java.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/lava/gzz/zzutil/Direction.java.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
Patches:
Index: gzz/lava/gzz/modules/email/FromFilter.java
diff -u gzz/lava/gzz/modules/email/FromFilter.java:1.1
gzz/lava/gzz/modules/email/FromFilter.java:1.2
--- gzz/lava/gzz/modules/email/FromFilter.java:1.1 Sun Jan 5 12:27:42 2003
+++ gzz/lava/gzz/modules/email/FromFilter.java Mon Jan 6 06:42:54 2003
@@ -1,6 +1,9 @@
package gzz.modules.email;
+import gzz.potion.*;
import gzz.potion.potions.*;
+import java.util.*;
import gzz.*;
+import gzz.zzutil.*;
public class FromFilter implements Filter{
@@ -13,11 +16,17 @@
}
public boolean filter(Cell c){
-
- if(c.t()==s)
- return true;
- else
+ Space sp = c.space;
+ Dim d_contain = sp.getDim(Ids.d_contain);
+ Dim d_contain_list = sp.getDim(Ids.d_contain_list);
+ c =c.s(d_contain,1).s(d_contain_list,1);
+ if(!c.t().substring(0,6).equals("From: ")){
+ throw new Error();
+ }
+ if(c.t().indexOf(s.substring(6))==-1)
return false;
+ else
+ return true;
}
}
Index: gzz/lava/gzz/modules/email/ToFilter.java
diff -u gzz/lava/gzz/modules/email/ToFilter.java:1.1
gzz/lava/gzz/modules/email/ToFilter.java:1.2
--- gzz/lava/gzz/modules/email/ToFilter.java:1.1 Sun Jan 5 12:27:42 2003
+++ gzz/lava/gzz/modules/email/ToFilter.java Mon Jan 6 06:42:54 2003
@@ -1,23 +1,32 @@
package gzz.modules.email;
+import gzz.potion.*;
import gzz.potion.potions.*;
+import java.util.*;
import gzz.*;
+import gzz.zzutil.*;
-public class FromFilter implements Filter{
+public class ToFilter implements Filter{
public String s;
- public FromFilter(String s){
+ public ToFilter(String s){
this.s=s;
}
public boolean filter(Cell c){
-
- if(c.t()==s)
- return true;
- else
+ Space sp = c.space;
+ Dim d_contain = sp.getDim(Ids.d_contain);
+ Dim d_contain_list = sp.getDim(Ids.d_contain_list);
+ c =c.s(d_contain,1).s(d_contain_list,1).s(d_contain_list,1);
+ if(!c.t().substring(0,4).equals("To: ")){
+ throw new Error();
+ }
+ if(c.t().indexOf(s.substring(4))==-1)
return false;
+ else
+ return true;
}
}
Index: gzz/lava/gzz/potion/potions/ChangeDim.java
diff -u gzz/lava/gzz/potion/potions/ChangeDim.java:1.1
gzz/lava/gzz/potion/potions/ChangeDim.java:1.2
--- gzz/lava/gzz/potion/potions/ChangeDim.java:1.1 Sat Jan 4 14:07:06 2003
+++ gzz/lava/gzz/potion/potions/ChangeDim.java Mon Jan 6 06:42:54 2003
@@ -13,8 +13,7 @@
public ChangeDim() {
super(new Object[] {
- "Change Dimension on ", Types.AXIS," in ", Types.DIR
- });
+ "Change Dimension on ", Types.AXIS," in ", Types.POS_OR_NEG});
}
public void execute(List[] params, Map context) {
Index: gzz/lava/gzz/potion/potions/ChangeView.java
diff -u gzz/lava/gzz/potion/potions/ChangeView.java:1.1
gzz/lava/gzz/potion/potions/ChangeView.java:1.2
--- gzz/lava/gzz/potion/potions/ChangeView.java:1.1 Sat Jan 4 14:07:06 2003
+++ gzz/lava/gzz/potion/potions/ChangeView.java Mon Jan 6 06:42:54 2003
@@ -11,7 +11,7 @@
public class ChangeView extends AbstractHead implements Command{
public ChangeView() {
- super(new Object[] {"Change View in ", Types.DIR});
+ super(new Object[] {"Change View in ", Types.POS_OR_NEG});
}
public void execute(List[] params, Map context) {
Index: gzz/lava/gzz/potion/potions/Types.java
diff -u gzz/lava/gzz/potion/potions/Types.java:1.6
gzz/lava/gzz/potion/potions/Types.java:1.7
--- gzz/lava/gzz/potion/potions/Types.java:1.6 Sun Jan 5 06:02:49 2003
+++ gzz/lava/gzz/potion/potions/Types.java Mon Jan 6 06:42:54 2003
@@ -32,19 +32,34 @@
public class Types {
public static Type CELL = new SimpleType("which cell?");
public static Type AXIS = new SimpleType("which axis?");
- public static Type DIR = new SimpleType("which diretion?");
+ public static Type POS_OR_NEG = new SimpleType("posward or negward?");
+ public static Type FILTER = new SimpleType("which filter?");
+ public static Type PERSON = new SimpleType("whom?");
+ public static Type TEXT = new SimpleType("which text");
+ public static Type DATE = new SimpleType("which date");
+
+ public static Type DIR = new SimpleType("which direction?") {
+ public FunctionExpression readDir(int win, int axis, int dir,
+ Map context) {
+ Fallback.Win w = (Fallback.Win)
+ context.get(ViewContext.class);
+
+ Direction d = new Direction(w.dims[axis], dir);
+ return new ConstantExpression(d, "XXX");
+ }
+ };
public static Type PLACE = new SimpleType("where?") {
public FunctionExpression readDir(int win, int axis, int dir,
Map context) {
Fallback.Win w = (Fallback.Win)
context.get(ViewContext.class);
-
+
Place p = new Place(w.cursor, w.dims[axis], dir);
return new ConstantExpression(p, "XXX");
}
};
-
+
public static Type CONNECTION = new SimpleType("which connection?") {
public FunctionExpression readDir(int win, int axis, int dir,
Map context) {
Index: gzz/lava/gzz/zzutil/Direction.java
diff -u gzz/lava/gzz/zzutil/Direction.java:1.2
gzz/lava/gzz/zzutil/Direction.java:1.3
--- gzz/lava/gzz/zzutil/Direction.java:1.2 Mon Dec 30 08:49:48 2002
+++ gzz/lava/gzz/zzutil/Direction.java Mon Jan 6 06:42:54 2003
@@ -1,21 +1,21 @@
/*
Direction.java
- *
+ *
* Copyright (c) 2002, Nico Lehmann
- *
+ *
* You may use and distribute under the terms of either the GNU Lesser
* General Public License, either version 2 of the license or,
* at your choice, any later version. Alternatively, you may use and
* distribute under the terms of the XPL.
- *
+ *
* See the LICENSE.lgpl and LICENSE.xpl files for the specific terms of
* the licenses.
- *
+ *
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the README
* file for more details.
- *
+ *
*/
/*
* Written by Nico Lehmann
@@ -26,6 +26,11 @@
public class Direction{
public Dim dim;
public int dir;
+
+ public Direction(Dim dim, int dir) {
+ this.dim = dim;
+ this.dir = dir;
+ }
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] gzz/lava/gzz modules/email/FromFilter.java modu...,
Benja Fallenstein <=