예제 #1
0
 public PyObject __call__(PyObject arg0) {
   try {
     ((PyFile) self).file_truncate(arg0.asLong(0));
     return Py.None;
   } catch (PyObject.ConversionException e) {
     String msg;
     switch (e.index) {
       case 0:
         msg = "expected a long";
         break;
       default:
         msg = "xxx";
     }
     throw Py.TypeError(msg);
   }
 }
예제 #2
0
 public PyObject __call__(PyObject arg0, PyObject arg1) {
   try {
     ((PyFile) self).file_seek(arg0.asLong(0), arg1.asInt(1));
     return Py.None;
   } catch (PyObject.ConversionException e) {
     String msg;
     switch (e.index) {
       case 0:
         msg = "expected a long";
         break;
       case 1:
         msg = "expected an integer";
         break;
       default:
         msg = "xxx";
     }
     throw Py.TypeError(msg);
   }
 }