rust/hg-cpython/src/lib.rs
changeset 42303 e240bec26626
parent 42179 13b64247f48f
child 42328 94f3a73b6672
equal deleted inserted replaced
42302:d1786c1d34fa 42303:e240bec26626
    21 
    21 
    22 #[macro_use]
    22 #[macro_use]
    23 extern crate cpython;
    23 extern crate cpython;
    24 extern crate hg;
    24 extern crate hg;
    25 extern crate libc;
    25 extern crate libc;
       
    26 extern crate python27_sys;
    26 
    27 
    27 pub mod ancestors;
    28 pub mod ancestors;
    28 mod cindex;
    29 mod cindex;
    29 mod conversion;
    30 mod conversion;
    30 pub mod dagops;
    31 pub mod dagops;
    31 pub mod discovery;
    32 pub mod discovery;
    32 pub mod exceptions;
    33 pub mod exceptions;
       
    34 pub mod dirstate;
    33 
    35 
    34 py_module_initializer!(rustext, initrustext, PyInit_rustext, |py, m| {
    36 py_module_initializer!(rustext, initrustext, PyInit_rustext, |py, m| {
    35     m.add(
    37     m.add(
    36         py,
    38         py,
    37         "__doc__",
    39         "__doc__",
    40 
    42 
    41     let dotted_name: String = m.get(py, "__name__")?.extract(py)?;
    43     let dotted_name: String = m.get(py, "__name__")?.extract(py)?;
    42     m.add(py, "ancestor", ancestors::init_module(py, &dotted_name)?)?;
    44     m.add(py, "ancestor", ancestors::init_module(py, &dotted_name)?)?;
    43     m.add(py, "dagop", dagops::init_module(py, &dotted_name)?)?;
    45     m.add(py, "dagop", dagops::init_module(py, &dotted_name)?)?;
    44     m.add(py, "discovery", discovery::init_module(py, &dotted_name)?)?;
    46     m.add(py, "discovery", discovery::init_module(py, &dotted_name)?)?;
       
    47     m.add(py, "dirstate", dirstate::init_module(py, &dotted_name)?)?;
    45     m.add(py, "GraphError", py.get_type::<exceptions::GraphError>())?;
    48     m.add(py, "GraphError", py.get_type::<exceptions::GraphError>())?;
    46     Ok(())
    49     Ok(())
    47 });
    50 });