pyo3/src/lib.rs

36 lines
892 B
Rust
Raw Normal View History

2015-01-05 16:05:53 +00:00
#![feature(unsafe_destructor)]
#![allow(unused_imports, dead_code, unused_variables)]
#![feature(associated_types)]
2015-01-04 15:32:52 +00:00
#![feature(globs)]
2015-01-04 19:11:18 +00:00
#![feature(slicing_syntax)]
2015-01-05 15:34:12 +00:00
#![feature(macro_rules)]
2015-01-05 16:05:53 +00:00
extern crate libc;
extern crate "python27-sys" as ffi;
2015-01-05 16:05:53 +00:00
pub use ffi::Py_ssize_t;
pub use err::{PyErr, PyResult};
2015-01-05 16:02:30 +00:00
pub use objects::*;
2015-01-05 15:34:12 +00:00
pub use err::exception_types::*;
pub use python::{Python, PythonObject, PythonObjectWithCheckedDowncast, PythonObjectWithTypeObject};
2015-01-05 16:05:53 +00:00
pub use pyptr::PyPtr;
pub use conversion::{FromPyObject, ToPyObject};
2015-01-04 20:37:43 +00:00
pub use objectprotocol::{ObjectProtocol};
2015-01-05 16:05:53 +00:00
mod python;
mod pyptr;
mod err;
mod conversion;
2015-01-05 16:02:30 +00:00
mod objects;
2015-01-04 20:37:43 +00:00
mod objectprotocol;
2015-01-05 16:05:53 +00:00
mod pythonrun;
#[test]
fn it_works() {
2015-01-04 04:50:28 +00:00
let gil = Python::acquire_gil();
let py = gil.python();
2015-01-05 16:05:53 +00:00
let sys = PyModule::import(py, "sys").unwrap();
let path = sys.as_object().getattr("path").unwrap();
println!("{0}", path);
}