dbus-th-introspection 0.1.0.0 → 0.1.0.2
raw patch · 4 files changed
+20/−21 lines, 4 filesdep ~basedep ~containersdep ~template-haskell
Dependency ranges changed: base, containers, template-haskell
Files
- DBus/TH/Introspection.hs +8/−7
- DBus/TH/Introspection/Output.hs +0/−6
- DBus/TH/Introspection/Types.hs +4/−0
- dbus-th-introspection.cabal +8/−8
DBus/TH/Introspection.hs view
@@ -29,13 +29,13 @@ -- | Run DBus introspection on specified object introspect :: Client -> BusName -> ObjectPath -> IO I.Object introspect client service path = do- reply <- call_ client (methodCall path "org.freedesktop.DBus.Introspectable" "Introspect")- { methodCallDestination = Just service- }- let Just xml = fromVariant (methodReturnBody reply !! 0)- case I.parseXML path xml of- Just info -> return info- Nothing -> error ("Invalid introspection XML: " ++ show xml)+ reply <- call_ client (methodCall path "org.freedesktop.DBus.Introspectable" "Introspect")+ { methodCallDestination = Just service+ }+ let Just xml = fromVariant (methodReturnBody reply !! 0)+ case I.parseXML path xml of+ Just info -> return info+ Nothing -> error ("Invalid introspection XML: " ++ show xml) -- | Obtain list of all objects exported by given interface, starting -- with specified path.@@ -68,6 +68,7 @@ dbusType2haskell (TypeArray TypeInt32) = return ''ListInt32 dbusType2haskell (TypeArray TypeString) = return ''ListStr dbusType2haskell (TypeDictionary TypeString TypeString) = return ''DictStrStr+dbusType2haskell (TypeDictionary TypeString TypeVariant) = return ''DictStrVariant dbusType2haskell t = Left $ "Unsupported type " ++ show t -- | Try to convert DBus.Introspection method description into DBus.TH description.
DBus/TH/Introspection/Output.hs view
@@ -1,16 +1,10 @@ module DBus.TH.Introspection.Output where -import Control.Monad import Data.List import Language.Haskell.TH -import DBus-import DBus.Client-import qualified DBus.Introspection as I import DBus.TH as TH--import DBus.TH.Introspection.Types -- | Gernerate DBus function declaration pprintFunc :: TH.Function -> String
DBus/TH/Introspection/Types.hs view
@@ -5,6 +5,8 @@ import Data.Int import qualified Data.Map as M +import DBus+ type ListInt8 = [Int8] type ListInt16 = [Int16] type ListInt32 = [Int32]@@ -16,4 +18,6 @@ type ListStr = [String] type DictStrStr = M.Map String String++type DictStrVariant = M.Map String Variant
dbus-th-introspection.cabal view
@@ -2,7 +2,7 @@ -- further documentation, see http://haskell.org/cabal/users-guide/ name: dbus-th-introspection-version: 0.1.0.0+version: 0.1.0.2 synopsis: Generate bindings for DBus calls by using DBus introspection and dbus-th description: This package is aimed to simplify writing bindings for DBus interfaces by using DBus introspection and dbus-th package.@@ -15,7 +15,7 @@ category: Development build-type: Simple -- extra-source-files: -cabal-version: >=1.10+cabal-version: >=1.18 library exposed-modules: DBus.TH.Introspection,@@ -23,11 +23,11 @@ DBus.TH.Introspection.Types -- other-modules: other-extensions: TemplateHaskell, OverloadedStrings- build-depends: base >=4.7 && <4.8,+ build-depends: base >=4.7 && < 5, dbus-th >=0.1.2.0,- template-haskell >=2.9 && <2.10,+ template-haskell >=2.9 && <2.12, dbus >=0.10 && <0.11,- containers >=0.5 && <0.6+ containers >=0.5 ghc-options: -fwarn-unused-imports default-language: Haskell2010 @@ -36,11 +36,11 @@ other-modules: DBus.TH.Introspection, DBus.TH.Introspection.Output, DBus.TH.Introspection.Types- build-depends: base >=4.7 && <4.8,+ build-depends: base >=4.7 && < 5, dbus-th >=0.1.2.0,- template-haskell >=2.9 && <2.10,+ template-haskell >=2.9 && <2.12, dbus >=0.10 && <0.11,- containers >=0.5 && <0.6,+ containers >=0.5, cmdargs default-language: Haskell2010