RE FX module - loading the legacy contracts..

Hi REFX experts,
iam new to this module .
And i need to load the RE-contracts into the system.
1. Should i load all the PR bulk first.
2. Should i load all teh RO bulk firtst.
3. Should i load all the CN bulk first.
Or should i load in sequecne 1 PR first, next 1 RO next and 1 CN next ?
And next i know there are BAPI's
BAPI_RE_PR_CREATE,
BAPI_RE_RO_CREATE and
BAPI_RE_CN_CREATE
And my question is how to prepare the source files in what format for RE contracts  ?????
TERM_RENEWAL_RULE     LIKE     BAPI_RE_TERM_RN_RULE_DAT
TERM_NOTICE_OBJ     LIKE     BAPI_RE_TERM_NT_OBJ_DAT
TERM_NOTICE_RULE     LIKE     BAPI_RE_TERM_NT_RULE_DAT
TERM_OBJECT_REL     LIKE     BAPI_RE_TERM_OBJREL_DAT
TERM_ORG_ASSIGNMENT     LIKE     BAPI_RE_TERM_OA_DAT
TERM_PAYMENT     LIKE     BAPI_RE_TERM_PY_DAT
TERM_RHYTHM     LIKE     BAPI_RE_TERM_RH_DAT
TERM_ADJUSTMENT     LIKE     BAPI_RE_TERM_AJ_DAT
TERM_SR_REPORTING     LIKE     BAPI_RE_TERM_SR_REP_DAT
TERM_SR_SALES     LIKE     BAPI_RE_TERM_SR_SL_DAT
TERM_SR_PEAK_SALES     LIKE     BAPI_RE_TERM_SR_PS_DAT
TERM_SR_RHYTHM     LIKE     BAPI_RE_TERM_SR_RH_DAT
ACT_DEPOSIT     LIKE     BAPI_RE_ACT_DEPOSIT_DAT
PARTNER     LIKE     BAPI_RE_PARTNER_DAT
OPTION_RATE     LIKE     BAPI_RE_OPTION_RATE_DAT
OBJECT_REL     LIKE     BAPI_RE_OBJECT_REL_DAT
MEAS_CN     LIKE     BAPI_RE_MEAS_CN_DAT
CONDITION     LIKE     BAPI_RE_CONDITION_DAT
RESUBM_RULE     LIKE     BAPI_RE_RESUBM_RULE_DAT
STATUS     LIKE     BAPI_RE_STATUS_DAT
EXTENSION_IN     LIKE     BAPIPAREX
RETURN     LIKE     BAPIRET2
TERM_WITHHOLDING_TAX     LIKE     BAPI_RE_TERM_WT_DAT
TERM_WITHHOLDING_TAX_ITEM     LIKE     BAPI_RE_TERM_WT_ITEM_DAT
COSETTLE_RULE     LIKE     BAPI_RE_COSETTLE_RL_DAT
TERM_PAYMENT_SPLIT     LIKE     BAPI_RE_TERM_PYSPLIT_DAT
Your answers are highly appreciated ..
Srinivas.

Hi Srinivas,
To Load Contract, you need to have higher Hierarchy object.
In Real Estate master data flow is some thing like this,
Business Entity (BE)
Building (BU)
Property (PR)
Rental Unit (RO)
Contract (CN)
BU and PR are at same level, Generally PR are used for Lease-In contract where vendors are used.
Now coming to your question,
You can Assign contract to any of Higher Hierarchy (BE, BU,PR,RU) it depends on the client requirement and Desgin.
IF you are working on Lease-In contract,  (General Solution)
Create BE
Create PR and attached to BE
Create CN for PR
If you working on Lease-Out contract (General Solution)
Create BE
Create BU assign it to BE
Create RU Assign it to BE
Create CN for RU
Note:- In RE Classic you have lease-out and lease-in contracts  seperately but when it comes to Flexibel Real Estate you have only contract and you differentiate it with Contract Type.
It Depends upon how your are giving input file to BAPI It can either
1. Tab Delimited Text file or
2. Excel File.. Etc
Below is sample format (Tab Delimited) input format for BAPI
XXX\000XXX0200011,1,500,100
XXX\000XXX0200011,2,CONTRACT,29991231,,20090101,20090101,,,6,0005750200011
XXX\000XXX0200011,3,,
XXX\000XXX0200011,4,,,,,,,,,,,,,,,,,08000290
XXX\000XXX0200011,5,,,,,1,1,,,,,0,1,0,
XXX\000XXX0200011,6,08000290,TR0600
XXX\000XXX0200011,7,IM,500/10001/00000011
XXX\000XXX0200011,8,,100,IM,500/10001/00000011,,,20090101,29991231,INR,INR ,,,,,,,,,100,,,,,,100
XXX\000XXX0200011,9,,,,,,,,,,
Cheers,
Veman
Edited by: veman goli on Mar 25, 2009 3:36 AM

Similar Messages

  • Transaction type for the legacy data for Auc

    Dear Experts,
    When i use the AS91 to load the legacy for Auc, the system issues the error ' Trans. type 900 can only be used for legacy assets from prev. years'
    The asset value data is '2011/04/05', the transaction type is 900. The asset transfer data is '2011/04/25'
    Should I have to use the transaction for the Auc's legacy data input? Can i choose other transaction tpye like 100?
    Br
    Sophie

    Hi
    100 is used for uploading Non AUC assets
    900 is used for AUC.. AS per SAP recommendation, 01/01/20xx to be used when uploading AUC... I misplaced that SAP note which says so
    Normally changing the asset val date impacts the dep calculation.. Since, AUC has 0000 dep key, it does not impact Dep calculation
    br, Ajay M

  • Load the data from Legacy system into CRM

    I'm new to CRM,I would like to know  What is the procedure used to Load the data (ex: Business partners data ,Organization data,Sales data, etc.) from Legacy system into CRM system?
    Can anyone  explain me and send  any documents,it  would be very helpful.
    I highly appreciate your help.
    Thanks,
    [email protected]

    Hi Rani,
    You can also use the ALE IDOC method to load data from legacy to CRM system if you have some middlware tool(E.g. XI) in between. We have implemented this in our project where we were getting flat files from legacy, XI was converting the same into IDOC and the IDOC was sent to CRM where we read the IDOC data, populate the standard BAPI's or function modules to create the data in CRM.
    You need to define an IDOC TYPE similar to the data structure on the legacy system. Maintain the ALE settings. Write the function module to validate and create data in the CRM system.
    E.G. To create business partner SAP has provided BAPI_BUPA_CREATE_FROM_DATA bapi.
    <b>Reward points if it helps.</b>

  • Unable to load the kernel module 'nvidia.ko' [SOLVED]

    After my most recent kernel upgrade, I can't get my GUI to run. I've tried reinstalling the nvidia driver to no avail.
    Any insight would be greatly appreciated. I'm using a GeForce 8400 GS
    cat /var/log/nvidia-installer.log
    ERROR: Unable to load the kernel module 'nvidia.ko'. This happens most
    frequently when this kernel module was built against the wrong or
    improperly configured kernel sources, with a version of gcc that differs
    from the one used to build the target kernel, or if a driver such as
    rivafb/nvidiafb is present and prevents the NVIDIA kernel module from
    obtaining ownership of the NVIDIA graphics device(s), or NVIDIA GPU
    installed in this system is not supported by this NVIDIA Linux graphics
    driver release.
    Please see the log entries 'Kernel module load error' and 'Kernel
    messages' at the end of the file '/var/log/nvidia-installer.log' for
    more information.
    -> Kernel module load error: insmod: error inserting './usr/src/nv/nvidia.ko':
    -1 No such device
    -> Kernel messages:
    NVRM: This can occur when a driver such as nouveau, rivafb,
    NVRM: nvidiafb, or rivatv was loaded and obtained ownership of
    NVRM: the NVIDIA device(s).
    NVRM: Try unloading the conflicting kernel module (and/or
    NVRM: reconfigure your kernel without the conflicting
    NVRM: driver(s)), then try loading the NVIDIA kernel module
    NVRM: again.
    NVRM: No NVIDIA graphics adapter probed!
    NVRM: The NVIDIA probe routine was not called for 1 device(s).
    NVRM: This can occur when a driver such as nouveau, rivafb,
    NVRM: nvidiafb, or rivatv was loaded and obtained ownership of
    NVRM: the NVIDIA device(s).
    NVRM: Try unloading the conflicting kernel module (and/or
    NVRM: reconfigure your kernel without the conflicting
    NVRM: driver(s)), then try loading the NVIDIA kernel module
    NVRM: again.
    NVRM: No NVIDIA graphics adapter probed!
    NVRM: The NVIDIA probe routine was not called for 1 device(s).
    NVRM: This can occur when a driver such as rivafb, nvidiafb or
    NVRM: rivatv was loaded and obtained ownership of the NVIDIA
    NVRM: device(s).
    NVRM: Try unloading the rivafb, nvidiafb or rivatv kernel module
    NVRM: (and/or reconfigure your kernel without rivafb/nvidiafb
    NVRM: support), then try loading the NVIDIA kernel module again.
    NVRM: No NVIDIA graphics adapter probed!
    ERROR: Installation has failed. Please see the file
    '/var/log/nvidia-installer.log' for details. You may find suggestions
    on fixing installation problems in the README available on the Linux
    driver download page at www.nvidia.com.
    Last edited by wsims (2010-06-22 15:06:04)

    if you used the packages from repos, the blacklist is done automatically in nvidia,
    $ pacman -Qo /etc/modprobe.d/nouveau_blacklist.conf
    /etc/modprobe.d/nouveau_blacklist.conf is owned by nvidia 195.36.31-1
    $ cat /etc/modprobe.d/nouveau_blacklist.conf
    blacklist nouveau
    but i guess you just want to mess your system by using unsupported and very bad ways and you are way smarter than the devs if you used that installer
    Last edited by wonder (2010-06-22 14:10:01)

  • Unable to load the EJB module. DeploymentContext does not contain any EJB.

    I'm writing an enterprise application to familiarize myself with Glassfish 3.1.2 and EJB 3.1. I've created several local, stateless beans, and injected one into a JSF managed bean. The ejb and web modules compile fine, but when I launch the application with Glassfish I get the following startup error and the application does not deploy. I don't understand what it means, can someone ellaborate?
    SEVERE: Exception while invoking class org.glassfish.ejb.startup.EjbDeployer prepare method
    SEVERE: Exception while invoking class org.glassfish.javaee.full.deployment.EarDeployer prepare method
    SEVERE: Exception while preparing the app
    SEVERE: Unable to load the EJB module. DeploymentContext does not contain any EJB. Check the archive to ensure correct packaging for D:\Documents\NetBeansProjects\Test\dist\gfdeploy\Test\Test-war_war.
    If you use EJB component annotations to define the EJB, and an ejb or web deployment descriptor is also used, please make sure that the deployment descriptor references a Java EE 5 or higher version schema, and that the metadata-complete attribute is not set to true, so the component annotations can be processed as expected
    org.glassfish.deployment.common.DeploymentException: Unable to load the EJB module. DeploymentContext does not contain any EJB. Check the archive to ensure correct packaging for D:\Documents\NetBeansProjects\Test\dist\gfdeploy\Test\Test-war_war.
    If you use EJB component annotations to define the EJB, and an ejb or web deployment descriptor is also used, please make sure that the deployment descriptor references a Java EE 5 or higher version schema, and that the metadata-complete attribute is not set to true, so the component annotations can be processed as expected
         at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:166)
         at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:871)
         at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:410)
         at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
         at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)
         at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)
         at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
         at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
         at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
         at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
         at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)
         at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:461)
         at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:212)
         at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
         at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
         at com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)
         at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
         at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
         at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
         at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
         at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
         at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
         at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
         at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
         at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
         at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
         at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
         at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
         at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
         at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
         at java.lang.Thread.run(Thread.java:722)

    My guess is that you deployed an ejb without bean in it. when you have an ejb module, be sure you have at least one bean present.
    Are you sure you have implementend some beans? Or did you do this only in the web module?
    Try adding an @Stateless bean doing nothing in you ejb module, redeploy and let me know if that works

  • "Failed to load the NVIDIA kernel module" [SOLVED]

    Hi, I've just done a fresh install of Arch64 and I'm having problems with NVIDIA driver from the repo.
    xorg, xf86-input-evdev -- INSTALLED
    nvidia, nvidia-utils, lib32-nvidia-utils -- INSTALLED (version 256.44-1)
    nouveau -- NOT INSTALLED
    here goes the log files:
    uname -a
    Linux desktop 2.6.32-lts #1 SMP Wed Aug 4 22:02:05 UTC 2010 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 4400+ AuthenticAMD GNU/Linux
    lspci | grep VGA
    00:05.0 VGA compatible controller: nVidia Corporation C51PV [GeForce 6150] (rev a2)
    /etc/X11/xorg.conf (generated when I ran "nvidia-xconfig"):
    # nvidia-xconfig: X configuration file generated by nvidia-xconfig
    # nvidia-xconfig: version 256.44 ([email protected]) Thu Jul 29 01:52:55 PDT 2010
    Section "ServerLayout"
    Identifier "Layout0"
    Screen 0 "Screen0"
    InputDevice "Keyboard0" "CoreKeyboard"
    InputDevice "Mouse0" "CorePointer"
    EndSection
    Section "Files"
    EndSection
    Section "InputDevice"
    # generated from default
    Identifier "Mouse0"
    Driver "mouse"
    Option "Protocol" "auto"
    Option "Device" "/dev/psaux"
    Option "Emulate3Buttons" "no"
    Option "ZAxisMapping" "4 5"
    EndSection
    Section "InputDevice"
    # generated from default
    Identifier "Keyboard0"
    Driver "kbd"
    EndSection
    Section "Monitor"
    Identifier "Monitor0"
    VendorName "Unknown"
    ModelName "Unknown"
    HorizSync 28.0 - 33.0
    VertRefresh 43.0 - 72.0
    Option "DPMS"
    EndSection
    Section "Device"
    Identifier "Device0"
    Driver "nvidia"
    VendorName "NVIDIA Corporation"
    EndSection
    Section "Screen"
    Identifier "Screen0"
    Device "Device0"
    Monitor "Monitor0"
    DefaultDepth 24
    SubSection "Display"
    Depth 24
    EndSubSection
    EndSection
    /var/Xorg.0.log
    This is a pre-release version of the X server from The X.Org Foundation.
    It is not supported in any way.
    Bugs may be filed in the bugzilla at http://bugs.freedesktop.org/.
    Select the "xorg" product for bugs you find in this release.
    Before reporting bugs in pre-release versions please check the
    latest version in the X.Org Foundation git repository.
    See http://wiki.x.org/wiki/GitPage for git access instructions.
    [ 142.066]
    X.Org X Server 1.8.1.902 (1.8.2 RC 2)
    Release Date: 2010-06-21
    [ 142.084] X Protocol Version 11, Revision 0
    [ 142.091] Build Operating System: Linux 2.6.34-ARCH x86_64
    [ 142.098] Current Operating System: Linux desktop 2.6.32-lts #1 SMP Wed Aug 4 22:02:05 UTC 2010 x86_64
    [ 142.106] Kernel command line: BOOT_IMAGE=/vmlinuz26-lts root=/dev/disk/by-uuid/9eb5ef94-284b-4b7e-b824-5c6b0f329fe8 ro quiet
    [ 142.116] Build Date: 21 June 2010 12:01:49PM
    [ 142.125]
    [ 142.135] Current version of pixman: 0.18.2
    [ 142.145] Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
    [ 142.167] Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
    [ 142.204] (==) Log file: "/var/log/Xorg.0.log", Time: Fri Aug 6 21:15:02 2010
    [ 142.218] (==) Using config file: "/etc/X11/xorg.conf"
    [ 142.232] (==) Using config directory: "/etc/X11/xorg.conf.d"
    [ 142.246] (==) ServerLayout "Layout0"
    [ 142.246] (**) |-->Screen "Screen0" (0)
    [ 142.246] (**) | |-->Monitor "Monitor0"
    [ 142.246] (**) | |-->Device "Device0"
    [ 142.246] (**) |-->Input Device "Keyboard0"
    [ 142.246] (**) |-->Input Device "Mouse0"
    [ 142.246] (==) Automatically adding devices
    [ 142.246] (==) Automatically enabling devices
    [ 142.246] (WW) The directory "/usr/share/fonts/TTF/" does not exist.
    [ 142.246] Entry deleted from font path.
    [ 142.246] (WW) The directory "/usr/share/fonts/OTF/" does not exist.
    [ 142.246] Entry deleted from font path.
    [ 142.246] (WW) The directory "/usr/share/fonts/Type1/" does not exist.
    [ 142.246] Entry deleted from font path.
    [ 142.246] (==) FontPath set to:
    /usr/share/fonts/misc/,
    /usr/share/fonts/100dpi/,
    /usr/share/fonts/75dpi/
    [ 142.246] (==) ModulePath set to "/usr/lib/xorg/modules"
    [ 142.246] (WW) AllowEmptyInput is on, devices using drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.
    [ 142.246] (WW) Disabling Keyboard0
    [ 142.246] (WW) Disabling Mouse0
    [ 142.246] (II) Loader magic: 0x7ce880
    [ 142.246] (II) Module ABI versions:
    [ 142.246] X.Org ANSI C Emulation: 0.4
    [ 142.246] X.Org Video Driver: 7.0
    [ 142.246] X.Org XInput driver : 9.0
    [ 142.246] X.Org Server Extension : 3.0
    [ 142.252] (--) PCI:*(0:0:5:0) 10de:0240:1043:81cd nVidia Corporation C51PV [GeForce 6150] rev 162, Mem @ 0xfc000000/16777216, 0xd0000000/268435456, 0xfb000000/16777216, BIOS @ 0x????????/131072
    [ 142.252] (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
    [ 142.252] (II) LoadModule: "extmod"
    [ 142.252] (II) Loading /usr/lib/xorg/modules/extensions/libextmod.so
    [ 142.253] (II) Module extmod: vendor="X.Org Foundation"
    [ 142.253] compiled for 1.8.1.902, module version = 1.0.0
    [ 142.253] Module class: X.Org Server Extension
    [ 142.253] ABI class: X.Org Server Extension, version 3.0
    [ 142.253] (II) Loading extension MIT-SCREEN-SAVER
    [ 142.253] (II) Loading extension XFree86-VidModeExtension
    [ 142.253] (II) Loading extension XFree86-DGA
    [ 142.253] (II) Loading extension DPMS
    [ 142.253] (II) Loading extension XVideo
    [ 142.253] (II) Loading extension XVideo-MotionCompensation
    [ 142.253] (II) Loading extension X-Resource
    [ 142.253] (II) LoadModule: "dbe"
    [ 142.253] (II) Loading /usr/lib/xorg/modules/extensions/libdbe.so
    [ 142.253] (II) Module dbe: vendor="X.Org Foundation"
    [ 142.253] compiled for 1.8.1.902, module version = 1.0.0
    [ 142.253] Module class: X.Org Server Extension
    [ 142.253] ABI class: X.Org Server Extension, version 3.0
    [ 142.253] (II) Loading extension DOUBLE-BUFFER
    [ 142.253] (II) LoadModule: "glx"
    [ 142.253] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
    [ 142.269] (II) Module glx: vendor="NVIDIA Corporation"
    [ 142.269] compiled for 4.0.2, module version = 1.0.0
    [ 142.269] Module class: X.Org Server Extension
    [ 142.269] (II) NVIDIA GLX Module 256.44 Thu Jul 29 01:47:53 PDT 2010
    [ 142.269] (II) Loading extension GLX
    [ 142.269] (II) LoadModule: "record"
    [ 142.269] (II) Loading /usr/lib/xorg/modules/extensions/librecord.so
    [ 142.269] (II) Module record: vendor="X.Org Foundation"
    [ 142.269] compiled for 1.8.1.902, module version = 1.13.0
    [ 142.269] Module class: X.Org Server Extension
    [ 142.269] ABI class: X.Org Server Extension, version 3.0
    [ 142.269] (II) Loading extension RECORD
    [ 142.269] (II) LoadModule: "dri"
    [ 142.270] (II) Loading /usr/lib/xorg/modules/extensions/libdri.so
    [ 142.270] (II) Module dri: vendor="X.Org Foundation"
    [ 142.270] compiled for 1.8.1.902, module version = 1.0.0
    [ 142.270] ABI class: X.Org Server Extension, version 3.0
    [ 142.270] (II) Loading extension XFree86-DRI
    [ 142.270] (II) LoadModule: "dri2"
    [ 142.270] (II) Loading /usr/lib/xorg/modules/extensions/libdri2.so
    [ 142.270] (II) Module dri2: vendor="X.Org Foundation"
    [ 142.270] compiled for 1.8.1.902, module version = 1.2.0
    [ 142.270] ABI class: X.Org Server Extension, version 3.0
    [ 142.270] (II) Loading extension DRI2
    [ 142.270] (II) LoadModule: "nvidia"
    [ 142.270] (II) Loading /usr/lib/xorg/modules/drivers/nvidia_drv.so
    [ 142.271] (II) Module nvidia: vendor="NVIDIA Corporation"
    [ 142.271] compiled for 4.0.2, module version = 1.0.0
    [ 142.271] Module class: X.Org Video Driver
    [ 142.288] (EE) NVIDIA: Failed to load the NVIDIA kernel module. Please check your
    [ 142.303] (EE) NVIDIA: system's kernel log for additional error messages.
    [ 142.319] (II) UnloadModule: "nvidia"
    [ 142.319] (II) Unloading /usr/lib/xorg/modules/drivers/nvidia_drv.so
    [ 142.319] (EE) Failed to load module "nvidia" (module-specific error, 0)
    [ 142.335] (EE) No drivers available.
    [ 142.351]
    Fatal server error:
    [ 142.384] no screens found
    [ 142.400]
    Please consult the The X.Org Foundation support
    at http://wiki.x.org
    for help.
    [ 142.469] Please also check the log file at "/var/log/Xorg.0.log" for additional information.
    [ 142.488]
    find / -name "*nvidia*"
    /lib/modules/2.6.34-ARCH/kernel/drivers/video/backlight/mbp_nvidia_bl.ko
    /lib/modules/2.6.34-ARCH/kernel/drivers/video/nvidia
    /lib/modules/2.6.34-ARCH/kernel/drivers/video/nvidia/nvidiafb.ko
    /lib/modules/2.6.34-ARCH/kernel/drivers/video/nvidia.ko
    /lib/modules/2.6.32-lts/kernel/drivers/video/backlight/mbp_nvidia_bl.ko
    /lib/modules/2.6.32-lts/kernel/drivers/video/nvidia
    /lib/modules/2.6.32-lts/kernel/drivers/video/nvidia/nvidiafb.ko
    /etc/OpenCL/vendors/nvidia.icd
    /etc/X11/xorg.conf.d/20-nvidia.conf
    /usr/lib/libnvidia-cfg.so.1
    /usr/lib/libnvidia-glcore.so.256.44
    /usr/lib/vdpau/libvdpau_nvidia.so.256.44
    /usr/lib/vdpau/libvdpau_nvidia.so
    /usr/lib/vdpau/libvdpau_nvidia.so.1
    /usr/lib/tls/libnvidia-tls.so.256.44
    /usr/lib/libnvidia-cfg.so.256.44
    /usr/lib/libnvidia-cfg.so
    /usr/lib/libnvidia-tls.so.256.44
    /usr/lib/xorg/modules/drivers/nvidia_drv.so
    /usr/lib/libnvidia-compiler.so.256.44
    /usr/share/licenses/nvidia
    /usr/share/licenses/lib32-nvidia-utils
    /usr/share/licenses/nvidia-utils
    /usr/share/applications/nvidia-settings.desktop
    /usr/share/man/man1/nvidia-smi.1.gz
    /usr/share/man/man1/nvidia-settings.1.gz
    /usr/share/man/man1/nvidia-xconfig.1.gz
    /usr/share/doc/nvidia
    /usr/share/doc/nvidia-utils
    /usr/share/pixmaps/nvidia-settings.png
    /usr/bin/nvidia-bug-report.sh
    /usr/bin/nvidia-settings
    /usr/bin/nvidia-smi
    /usr/bin/nvidia-xconfig
    /usr/src/linux-2.6.34-ARCH/include/config/backlight/mbp/nvidia.h
    /usr/src/linux-2.6.34-ARCH/include/config/fb/nvidia
    /usr/src/linux-2.6.34-ARCH/include/config/fb/nvidia.h
    /usr/src/linux-2.6.32-lts/include/config/backlight/mbp/nvidia.h
    /usr/src/linux-2.6.32-lts/include/config/fb/nvidia
    /usr/src/linux-2.6.32-lts/include/config/fb/nvidia.h
    /opt/lib32/usr/lib/libvdpau_nvidia.so.256.44
    /opt/lib32/usr/lib/libvdpau_nvidia.so
    /opt/lib32/usr/lib/libnvidia-glcore.so.256.44
    /opt/lib32/usr/lib/tls/libnvidia-tls.so.256.44
    /opt/lib32/usr/lib/libvdpau_nvidia.so.1
    /opt/lib32/usr/lib/libnvidia-tls.so.256.44
    /opt/lib32/usr/lib/libnvidia-compiler.so.256.44
    /var/lib/pacman/local/nvidia-256.44-1
    /var/lib/pacman/local/nvidia-utils-256.44-1
    /var/lib/pacman/local/lib32-nvidia-utils-256.44-1
    /var/lib/pacman/sync/extra/nvidia-173xx-utils-173.14.27-1
    /var/lib/pacman/sync/extra/nvidia-173xx-173.14.27-1
    /var/lib/pacman/sync/extra/nvidia-256.44-1
    /var/lib/pacman/sync/extra/nvidia-utils-256.44-1
    /var/lib/pacman/sync/community/nvidia-cg-toolkit-2.2-4
    /var/lib/pacman/sync/community/lib32-nvidia-utils-256.44-1
    /var/cache/pacman/pkg/nvidia-utils-256.44-1-x86_64.pkg.tar.xz
    /var/cache/pacman/pkg/nvidia-256.44-1-x86_64.pkg.tar.xz
    /var/cache/pacman/pkg/lib32-nvidia-utils-256.44-1-x86_64.pkg.tar.xz
    Do you have any idea of what should be done to fix it? I don't want to use NVIDIA driver from their site neither nouveau, I want to use the one from the repo. If you know how to solve it, instead of only pointing the solution, also tell why this is happening, it will help me and other people with the same problem too!
    If you need additional information please ask me.
    Thanks!!
    Last edited by ILoveJapaneseGirls (2010-08-07 03:09:55)

    karol, I'll try to add the section you wrote to the xorg.conf, but first I want to show the log of the crash:
    /var/log/Xorg.0.log
    [ 69.813]
    This is a pre-release version of the X server from The X.Org Foundation.
    It is not supported in any way.
    Bugs may be filed in the bugzilla at http://bugs.freedesktop.org/.
    Select the "xorg" product for bugs you find in this release.
    Before reporting bugs in pre-release versions please check the
    latest version in the X.Org Foundation git repository.
    See http://wiki.x.org/wiki/GitPage for git access instructions.
    [ 69.858]
    X.Org X Server 1.8.1.902 (1.8.2 RC 2)
    Release Date: 2010-06-21
    [ 69.882] X Protocol Version 11, Revision 0
    [ 69.890] Build Operating System: Linux 2.6.34-ARCH x86_64
    [ 69.899] Current Operating System: Linux desktop 2.6.34-ARCH #1 SMP PREEMPT Wed Aug 4 14:31:56 CEST 2010 x86_64
    [ 69.910] Kernel command line: BOOT_IMAGE=/vmlinuz26 root=/dev/disk/by-uuid/9eb5ef94-284b-4b7e-b824-5c6b0f329fe8 ro quiet
    [ 69.921] Build Date: 21 June 2010 12:01:49PM
    [ 69.933]
    [ 69.944] Current version of pixman: 0.18.2
    [ 69.957] Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
    [ 69.982] Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
    [ 70.025] (==) Log file: "/var/log/Xorg.0.log", Time: Fri Aug 6 22:35:08 2010
    [ 70.057] (==) Using config file: "/etc/X11/xorg.conf"
    [ 70.072] (==) Using config directory: "/etc/X11/xorg.conf.d"
    [ 70.117] (==) ServerLayout "Layout0"
    [ 70.117] (**) |-->Screen "Screen0" (0)
    [ 70.117] (**) | |-->Monitor "Monitor0"
    [ 70.117] (**) | |-->Device "Device0"
    [ 70.117] (**) |-->Input Device "Keyboard0"
    [ 70.117] (**) |-->Input Device "Mouse0"
    [ 70.117] (==) Automatically adding devices
    [ 70.118] (==) Automatically enabling devices
    [ 70.145] (WW) The directory "/usr/share/fonts/TTF/" does not exist.
    [ 70.145] Entry deleted from font path.
    [ 70.145] (WW) The directory "/usr/share/fonts/OTF/" does not exist.
    [ 70.145] Entry deleted from font path.
    [ 70.145] (WW) The directory "/usr/share/fonts/Type1/" does not exist.
    [ 70.145] Entry deleted from font path.
    [ 70.168] (==) FontPath set to:
    /usr/share/fonts/misc/,
    /usr/share/fonts/100dpi/,
    /usr/share/fonts/75dpi/
    [ 70.168] (==) ModulePath set to "/usr/lib/xorg/modules"
    [ 70.168] (WW) AllowEmptyInput is on, devices using drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.
    [ 70.168] (WW) Disabling Keyboard0
    [ 70.168] (WW) Disabling Mouse0
    [ 70.168] (II) Loader magic: 0x7ce880
    [ 70.168] (II) Module ABI versions:
    [ 70.168] X.Org ANSI C Emulation: 0.4
    [ 70.168] X.Org Video Driver: 7.0
    [ 70.168] X.Org XInput driver : 9.0
    [ 70.168] X.Org Server Extension : 3.0
    [ 70.185] (--) PCI:*(0:0:5:0) 10de:0240:1043:81cd nVidia Corporation C51PV [GeForce 6150] rev 162, Mem @ 0xfc000000/16777216, 0xd0000000/268435456, 0xfb000000/16777216, BIOS @ 0x????????/131072
    [ 70.186] (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
    [ 70.186] (II) LoadModule: "extmod"
    [ 70.200] (II) Loading /usr/lib/xorg/modules/extensions/libextmod.so
    [ 70.211] (II) Module extmod: vendor="X.Org Foundation"
    [ 70.211] compiled for 1.8.1.902, module version = 1.0.0
    [ 70.211] Module class: X.Org Server Extension
    [ 70.211] ABI class: X.Org Server Extension, version 3.0
    [ 70.211] (II) Loading extension MIT-SCREEN-SAVER
    [ 70.211] (II) Loading extension XFree86-VidModeExtension
    [ 70.211] (II) Loading extension XFree86-DGA
    [ 70.211] (II) Loading extension DPMS
    [ 70.211] (II) Loading extension XVideo
    [ 70.211] (II) Loading extension XVideo-MotionCompensation
    [ 70.211] (II) Loading extension X-Resource
    [ 70.211] (II) LoadModule: "dbe"
    [ 70.211] (II) Loading /usr/lib/xorg/modules/extensions/libdbe.so
    [ 70.218] (II) Module dbe: vendor="X.Org Foundation"
    [ 70.218] compiled for 1.8.1.902, module version = 1.0.0
    [ 70.219] Module class: X.Org Server Extension
    [ 70.219] ABI class: X.Org Server Extension, version 3.0
    [ 70.219] (II) Loading extension DOUBLE-BUFFER
    [ 70.219] (II) LoadModule: "glx"
    [ 70.219] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
    [ 71.100] (II) Module glx: vendor="NVIDIA Corporation"
    [ 71.111] compiled for 4.0.2, module version = 1.0.0
    [ 71.111] Module class: X.Org Server Extension
    [ 71.111] (II) NVIDIA GLX Module 256.44 Thu Jul 29 01:47:53 PDT 2010
    [ 71.111] (II) Loading extension GLX
    [ 71.111] (II) LoadModule: "record"
    [ 71.111] (II) Loading /usr/lib/xorg/modules/extensions/librecord.so
    [ 71.125] (II) Module record: vendor="X.Org Foundation"
    [ 71.125] compiled for 1.8.1.902, module version = 1.13.0
    [ 71.125] Module class: X.Org Server Extension
    [ 71.125] ABI class: X.Org Server Extension, version 3.0
    [ 71.125] (II) Loading extension RECORD
    [ 71.125] (II) LoadModule: "dri"
    [ 71.126] (II) Loading /usr/lib/xorg/modules/extensions/libdri.so
    [ 71.140] (II) Module dri: vendor="X.Org Foundation"
    [ 71.140] compiled for 1.8.1.902, module version = 1.0.0
    [ 71.140] ABI class: X.Org Server Extension, version 3.0
    [ 71.140] (II) Loading extension XFree86-DRI
    [ 71.140] (II) LoadModule: "dri2"
    [ 71.140] (II) Loading /usr/lib/xorg/modules/extensions/libdri2.so
    [ 71.140] (II) Module dri2: vendor="X.Org Foundation"
    [ 71.140] compiled for 1.8.1.902, module version = 1.2.0
    [ 71.140] ABI class: X.Org Server Extension, version 3.0
    [ 71.140] (II) Loading extension DRI2
    [ 71.140] (II) LoadModule: "nvidia"
    [ 71.141] (II) Loading /usr/lib/xorg/modules/drivers/nvidia_drv.so
    [ 71.187] (II) Module nvidia: vendor="NVIDIA Corporation"
    [ 71.189] compiled for 4.0.2, module version = 1.0.0
    [ 71.189] Module class: X.Org Video Driver
    [ 71.207] (II) NVIDIA dlloader X Driver 256.44 Thu Jul 29 01:24:51 PDT 2010
    [ 71.207] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
    [ 71.207] (--) using VT number 7
    [ 71.260] (II) Primary Device is: PCI 00@00:05:0
    [ 71.269] (II) Loading sub module "fb"
    [ 71.269] (II) LoadModule: "fb"
    [ 71.269] (II) Loading /usr/lib/xorg/modules/libfb.so
    [ 71.281] (II) Module fb: vendor="X.Org Foundation"
    [ 71.281] compiled for 1.8.1.902, module version = 1.0.0
    [ 71.281] ABI class: X.Org ANSI C Emulation, version 0.4
    [ 71.281] (II) Loading sub module "wfb"
    [ 71.281] (II) LoadModule: "wfb"
    [ 71.281] (II) Loading /usr/lib/xorg/modules/libwfb.so
    [ 71.289] (II) Module wfb: vendor="X.Org Foundation"
    [ 71.289] compiled for 1.8.1.902, module version = 1.0.0
    [ 71.289] ABI class: X.Org ANSI C Emulation, version 0.4
    [ 71.289] (II) Loading sub module "ramdac"
    [ 71.289] (II) LoadModule: "ramdac"
    [ 71.289] (II) Module "ramdac" already built-in
    [ 71.309] (**) NVIDIA(0): Depth 24, (--) framebuffer bpp 32
    [ 71.309] (==) NVIDIA(0): RGB weight 888
    [ 71.309] (==) NVIDIA(0): Default visual is TrueColor
    [ 71.309] (==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0)
    [ 71.309] (**) NVIDIA(0): Enabling RENDER acceleration
    [ 71.309] (II) NVIDIA(0): Support for GLX with the Damage and Composite X extensions is
    [ 71.309] (II) NVIDIA(0): enabled.
    [ 72.040] (II) NVIDIA(0): NVIDIA GPU GeForce 6150 (C51) at PCI:0:5:0 (GPU-0)
    [ 72.040] (--) NVIDIA(0): Memory: 262144 kBytes
    [ 72.040] (--) NVIDIA(0): VideoBIOS: 05.51.22.33.07
    [ 72.040] (--) NVIDIA(0): Interlaced video modes are supported on this GPU
    [ 72.040] (--) NVIDIA(0): Connected display device(s) on GeForce 6150 at PCI:0:5:0:
    [ 72.040] (--) NVIDIA(0): LG Electronics L196WTQ (DFP-0)
    [ 72.040] (--) NVIDIA(0): LG Electronics L196WTQ (DFP-0): 310.0 MHz maximum pixel clock
    [ 72.040] (--) NVIDIA(0): LG Electronics L196WTQ (DFP-0): Internal Dual Link TMDS
    [ 72.044] (II) NVIDIA(0): Assigned Display Device: DFP-0
    [ 72.044] (==) NVIDIA(0):
    [ 72.044] (==) NVIDIA(0): No modes were requested; the default mode "nvidia-auto-select"
    [ 72.044] (==) NVIDIA(0): will be used as the requested mode.
    [ 72.044] (==) NVIDIA(0):
    [ 72.044] (II) NVIDIA(0): Validated modes:
    [ 72.044] (II) NVIDIA(0): "nvidia-auto-select"
    [ 72.044] (II) NVIDIA(0): Virtual screen size determined to be 1440 x 900
    [ 72.045] (--) NVIDIA(0): DPI set to (89, 87); computed from "UseEdidDpi" X config
    [ 72.045] (--) NVIDIA(0): option
    [ 72.045] (==) NVIDIA(0): Enabling 32-bit ARGB GLX visuals.
    [ 72.045] (--) Depth 24 pixmap format is 32 bpp
    [ 72.052] (II) NVIDIA(0): Initialized GPU GART.
    [ 72.055] (II) NVIDIA(0): ACPI: failed to connect to the ACPI event daemon; the daemon
    [ 72.055] (II) NVIDIA(0): may not be running or the "AcpidSocketPath" X
    [ 72.055] (II) NVIDIA(0): configuration option may not be set correctly. When the
    [ 72.055] (II) NVIDIA(0): ACPI event daemon is available, the NVIDIA X driver will
    [ 72.055] (II) NVIDIA(0): try to use it to receive ACPI event notifications. For
    [ 72.055] (II) NVIDIA(0): details, please see the "ConnectToAcpid" and
    [ 72.055] (II) NVIDIA(0): "AcpidSocketPath" X configuration options in Appendix B: X
    [ 72.055] (II) NVIDIA(0): Config Options in the README.
    [ 72.056] (II) NVIDIA(0): Setting mode "nvidia-auto-select"
    [ 72.178] (EE) NVIDIA(0): Failed to allocate primary buffer: out of memory.
    [ 72.178] (EE) NVIDIA(0): *** Aborting ***
    [ 72.178]
    Fatal server error:
    [ 72.178] AddScreen/ScreenInit failed for driver 0
    [ 72.178]
    [ 72.178]
    Please consult the The X.Org Foundation support
    at http://wiki.x.org
    for help.
    [ 72.178] Please also check the log file at "/var/log/Xorg.0.log" for additional information.
    [ 72.178]
    As it's mentioned, it may be a problem of ACPI.
    About the lib32-nvidia-utils, I just installed because it's written in the wiki http://wiki.archlinux.org/index.php/NVIDIA#Installing: "Note: On 64 bit systems, For 32-bit programs to take advantage of nvidia-utils you must also install the equivalent lib32 package (for example lib32-nvidia-utils)."

  • DBD: Error while trying to load the transport provider for odbc. Failed to load the library. System error: The specified module could not be found.

    Hello Everyone,
    We are getting an error while trying to create an Universe via Microsoft -> MS Analysis Services 2014 -> OLEDB for OLAP Provider under Connection in UDT -"DBD: Error while trying to load the transport provider for odbc. Failed to load the library. System error: The specified module could not be found."  We have installed BI 4.1 SP05 in our system. As per earlier posts in scn in BO XI 3.x this issue used to be for improper installation of Integration KIT but in our scenarion Integration KIT is within the BO 4.1 package so no seperate installation is required. Moreover I have checked whether all the driver is present under file: "C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\dataAccess\connectionServer\drivers" and seems everything is fine. But still I am getting this error. One important point is we could use IDT because in IDT still we don't have option to connect with 'Microsoft Analysis Services - 2014 (XMLA)' as we are using Microsoft Analysis Services 2014 version.
    Kindly help if anyone has faced the same problem with SAP BO 4.1.
    Thanks and Best Regards,
    Ghosal

    Hello Everybody,
    The problem is solved now after installing "OLEDB drivers from SQL Server 2012 Feature Pack". We had OLEDB drivers that comes directly from SQL Server but that did not worked out in our case.
    Thanks for your support.
    Best Regards,
    Ghosal

  • Loading the third party modules in oracle http server

    Hi ,
    I installed a software and after installing it we will get one so file (ds-wac-apache2.2.so). I want to load that module (ds-wac-apache2.2.so file name) in oracle http server.
    I used the LoadModule directive but it doesnt work.
    Can anyone help me regarding these?

    Hi,
    My third party software was installed in the below folder,
    /home/oracle/Symphony/WAM/WebEnforcementAgent/
    and i tried to load the module by using the command LoadModule in httpd.conf which is located in the $ORACLE_INSTANCE/config/OHS/ohs
    LoadModule ds_wac_module "/home/oracle/Symphony/WAM/WebEnforcementAgent/ds-wac-apache2.2.so"
    after adding the above line in httpd.conf below url is not working.
    http://(ipaddress of oracle machine):7777/
    regards,
    suresh G

  • [python] setting a variable in a loaded module from the main script

    Hi,
    I have have two python scripts, one generally controlling my desktop wallpaper, the other downloads the APOD picture from the net and sets it as my wallpaper.
    At the moment I can get the wallpaper script to load the apod script as a module to use its functionality.
    The problem comes when I try to get the module to recognise variables set from the parent script:
    I have both scripts using the variable  'verbose' to control how much output is printed, (which can be set from the command line options).
    How do I get the 'verbose' variable in the imported module to be the same as the variable set by the script?
    I can get it into an imported function using a keyword assignment when called, 'download(verbose=options.verbose)', but this is forgotten when other functions are called.
    I have also tried making it a global variable.
    I assume it is because I am importing the module and setting the default value before the main script sets its value, but I cant see a way round this.
    Any ideas?
    Many thanks,
    Drew

    simplicity:
    test1.py
    #!/usr/bin/python3
    __version__ = 1
    from optparse import OptionParser, OptionGroup, SUPPRESS_HELP
    import test2
    def_msg = 3
    def function1(msg=def_msg):
    print('1 message level here is {0}' .format(msg))
    def function2():
    print('2 message level here is {0}' .format(msg))
    def function3(msg=def_msg):
    msg = def_msg
    print('3 message level here is {0}' .format(msg))
    def function4():
    print('4 message level here is {0}' .format(msg))
    def main(msg=def_msg):
    print('m message level here is {0}' .format(msg))
    function1(msg=msg)
    function2()
    function3()
    function4()
    test2.main(msg=msg)
    function2()
    if __name__ == "__main__":
    parser = OptionParser(usage = "usage: %prog [options] command", version="%prog {0}" .format(__version__),
    description = "Test script 1.")
    parser.set_defaults()
    standard = OptionGroup(parser, "Standard Options")
    ## Standard Options
    standard.add_option("-q", "--quiet",
    action="store_true", dest="quiet", default=False, #help=SUPPRESS_HELP)
    help="only display warnings and errors")
    standard.add_option("-v", "--verbose",
    action="store_true", dest="verbose", default=False, #help=SUPPRESS_HELP)
    help="display all output")
    standard.add_option("--debug",
    action="store_true", dest="debug", default=False, #help=SUPPRESS_HELP)
    help="debug mode: detailed output of commands")
    standard.add_option("--really-quiet",
    action="store_true", dest="reallyquiet", default=False, help=SUPPRESS_HELP)
    #help="only display errors")
    standard.add_option("--silent",
    action="store_true", dest="silent", default=False, help=SUPPRESS_HELP)
    #help="don't display any output")
    parser.add_option_group(standard)
    (options, args) = parser.parse_args()
    ## message level
    if options.debug == True:
    msg = 5
    elif options.verbose == True:
    msg = 4
    elif options.quiet == True:
    msg = 2
    elif options.reallyquiet == True:
    msg = 1
    elif options.silent == True:
    msg = 0
    else:
    msg = 3
    main(msg=msg)
    test2.py
    #!/usr/bin/python3
    __version__ = 1
    from optparse import OptionParser, OptionGroup, SUPPRESS_HELP
    #from test1 import msg
    def_msg = 3
    #msg = 3
    def function1(msg=def_msg):
    print('1 message level here is {0}' .format(msg))
    def function2(msg=def_msg):
    print('2 message level here is {0}' .format(msg))
    def function3():
    print('3 message level here is {0}' .format(msg))
    def main(msg=def_msg):
    #from test1 import msg
    #import test1
    #msg = test1.msg
    print('m message level here is {0}' .format(msg))
    function1(msg=msg)
    function2()
    function3()
    if __name__ == "__main__":
    parser = OptionParser(usage = "usage: %prog [options] command", version="%prog {0}" .format(__version__),
    description = "Test script 2.")
    parser.set_defaults()
    standard = OptionGroup(parser, "Standard Options")
    ## Standard Options
    standard.add_option("-q", "--quiet",
    action="store_true", dest="quiet", default=False, #help=SUPPRESS_HELP)
    help="only display warnings and errors")
    standard.add_option("-v", "--verbose",
    action="store_true", dest="verbose", default=False, #help=SUPPRESS_HELP)
    help="display all output")
    standard.add_option("--debug",
    action="store_true", dest="debug", default=False, #help=SUPPRESS_HELP)
    help="debug mode: detailed output of commands")
    standard.add_option("--really-quiet",
    action="store_true", dest="reallyquiet", default=False, help=SUPPRESS_HELP)
    #help="only display errors")
    standard.add_option("--silent",
    action="store_true", dest="silent", default=False, help=SUPPRESS_HELP)
    #help="don't display any output")
    parser.add_option_group(standard)
    (options, args) = parser.parse_args()
    ## message level
    if options.debug == True:
    msg = 5
    elif options.verbose == True:
    msg = 4
    elif options.quiet == True:
    msg = 2
    elif options.reallyquiet == True:
    msg = 1
    elif options.silent == True:
    msg = 0
    else:
    msg = 3
    main(msg=msg)
    else:
    msg = def_msg
    I think I understand why it gives the results it does when run as 'test1.py -v'
    I was just wondering if there was an easier way to get the second script to take and remember the variable without having to write variable=value into the function call every single time? However this is the only way I have found so far.
    The actual code:
    wallpaper.py:
    #!/usr/bin/python3
    #Filename: wallpaper.py
    __version__ = '6.2.0'
    import os, sys
    from optparse import OptionParser, OptionGroup, SUPPRESS_HELP
    #import warnings
    import random
    #import apod
    ##### CONFIG #####
    ## Global Variables
    root = '/home/wallpaper'
    feh_wallpaper_file = os.path.expanduser('~/.fehbg')
    filter_file = os.path.expanduser('~/.config/openbox/wallpaper/mask')
    config_path = os.path.expanduser('~/.config/openbox/wallpaper')
    list_default = 'default-list'
    list_alt = 'alt-list'
    menu_default = 'menu-folders'
    menu_alt = 'alt-menu'
    lockfile='/tmp/wallpaper.lock'
    valid_list_list = 'alt-list', 'default-list'
    def_msg = 3
    ##### LOCK v2.2 #####
    def LockScript(fun, lock=lockfile, msg=def_msg):
    """Locks the script before starting a function."""
    if msg >= 5:
    print('Lock :: Locking Script')
    from os import O_CREAT, O_EXCL
    try:
    fd = os.open(lock, O_CREAT+O_EXCL)
    if msg >= 5:
    print('Lock :: created lock file')
    except OSError:
    if msg >= 1:
    print('Error :: Already running function {0}...' .format(fun))
    sys.exit(1)
    try:
    fun(msg=msg)
    finally:
    try:
    os.remove(lock)
    if msg >= 6:
    print('Lock :: Removed Lock File')
    except:
    if msg >= 1:
    print('Lock :: Error :: Lockfile missing')
    ##### CURRENT INFO #####
    def get_filter(msg=def_msg):
    """Retrieves the filter."""
    f = open(filter_file, 'r')
    i = f.read()
    f.close()
    if msg >= 6:
    print('Got Filter :: {0}' .format(i))
    return i
    def get_info(msg=def_msg):
    """Returns the path and name of the current wallpaper."""
    with open(feh_wallpaper_file, 'r') as f:
    a = f.read()
    b = a[15:-1]
    f.close()
    name = os.path.basename(b)
    try:
    import apod
    if name == 'apod':
    path = os.path.join(apod.archive_folder, apod.thisyear)
    w = os.listdir(path)
    w.sort()
    wnum = len(w) -1
    name = w[wnum]
    else:
    path = os.path.dirname(b)
    except:
    path = os.path.dirname(b)
    if msg >= 5:
    print('current wallpaper :: {0} {1}' .format(path, name))
    return path, name
    def get_next(c, z, msg=def_msg):
    """Gets the next number in the sequence of length z."""
    if c == (len(z) - 1):
    n = 0
    else:
    n = c + 1
    if msg >= 6:
    print('next number is {0}' .format(n))
    return n
    def get_prev(c, z, msg=def_msg):
    """Gets the previous number in the sequence of length z."""
    if c == 0:
    p = (len(z) - 1)
    else:
    p = c - 1
    if msg >= 6:
    print('previous number is {0}' .format(p))
    return p
    def current_wallpaper_info(msg=def_msg):
    """Print the details of the current wallpaper."""
    name = get_info(msg=msg)[1]
    path = get_info(msg=msg)[0]
    folder = os.path.basename(path)
    mask = get_filter(msg=msg)
    try:
    import apod
    if path.startswith(apod.archive_folder) or name.startswith('APOD'):
    title = apod.get_name(fname=name, msg=msg)
    print('currently the wallpaper is "{0}", {1}' .format(title, name))
    elif not mask == '':
    print('currently the wallpaper is {0} from folder {1} using mask {2}' .format(name, folder, mask))
    else:
    print('currently the wallpaper is {0} from folder {1}' .format(name, folder))
    except:
    print('currently the wallpaper is {0} from folder {1}' .format(name, folder))
    ##### SET WALLPAPER FUNCTIONS #####
    def set_filter(i=None, msg=def_msg, mask_file=filter_file):
    """Sets the filter."""
    if test:
    f = open(mask_file, 'r')
    else:
    f = open(mask_file, 'w')
    if i == None:
    if msg >= 5:
    print('clearing filter')
    if test:
    print('exec :: Clear filter')
    else:
    f.write('')
    else:
    if msg >= 4:
    print('Setting filter as "{0}"' .format(i))
    if test:
    print('exec :: Writing filter as :: "{0}"' .format(i))
    else:
    f.write(i)
    f.close()
    def set_wallpaper(name, path_in=get_info()[0], msg=def_msg):
    """Set the wallpaper."""
    spath = path_in.split(':')
    path = spath[0]
    try:
    mask = spath[1]
    set_filter(mask, msg=msg)
    except:
    pass
    full = os.path.join(path, name)
    if msg >= 4:
    print("setting {0} as wallpaper" .format(name))
    if test:
    print("exec :: feh --bg-scale {0}" .format(full))
    else:
    os.system("feh --bg-scale {0}" .format(full))
    #def set_default(d=default_file):
    # """Sets the default walllpaper."""
    # set_wallpaper(d[1], d[0])
    def set_wallpaper_last(msg=def_msg):
    """Set the wallpaper as the last image."""
    ## alternativly use "eval `cat ~/.fehbg`"
    full = os.path.join(get_info()[0], get_info()[1])
    if msg >= 4:
    print("setting {0} as wallpaper" .format(full))
    if test:
    print("exec :: feh --bg-scale {0}" .format(full))
    else:
    os.system("feh --bg-scale {0}" .format(full))
    def change_folder(folder0, mask=None, msg=def_msg):
    """Change Wallpaper folder (optional filter) relative from root dir."""
    folder_split = folder0.split(':')
    folder = folder_split[0]
    path = os.path.join(root, folder)
    if not os.path.exists(path): # Path does not exist
    if msg >= 1:
    print('Fatal Error :: path does not exist')
    print('avaliable folders are {0}' .format(avaliable_folders()))
    sys.exit()
    if msg >= 4:
    print('changing folder to {0}' .format(folder))
    f1 = os.listdir(path)
    try:
    if folder_split[1]:
    mask = folder_split[1]
    f2 = []
    for i in f1:
    if i.find(mask) > -1:
    f2.append(i)
    f = f2
    if len(f) == 0:
    if msg >= 2:
    print('Warning :: invalid filter')
    raise
    set_filter(mask, msg=msg)
    else: # print('null mask')
    if msg >= 2:
    print('Warning :: null filter')
    raise
    except:
    if msg >= 5:
    print('No filter used, clearing')
    set_filter(msg=msg)
    f = f1
    if len(f) == 0:
    if msg >= 1:
    print('Fatal Error :: no files in path')
    sys.exit()
    r = random.randrange(0,len(f))
    if msg >= 5:
    print('chosing random number:: {0}' .format(r))
    set_wallpaper(f[r], path, msg=msg)
    def avaliable_folders(r=root, msg=def_msg):
    """Returns a list of avaliable folders in the root wallpaper directory."""
    allfolders = os.listdir(r)
    folders = []
    for f in allfolders:
    if not f.startswith("."):
    folders.append(f)
    return folders
    ##### DEFAULT / ALT SEQUENCE LISTS #####
    def strip_opt(p):
    #q1 = p.replace(' ','')
    #q2 = q1.replace('\t','')
    #q3 = q2.replace('\n','')
    q = p.replace(' ','').replace('\t','').replace('\n','')
    return q
    def check_list(l, path=config_path, dl=list_default, al=list_alt, msg=def_msg, returnF=False):
    """Checks to see (and returns) valid path to list."""
    if l == 'default' or l == 'def' or l == None :
    if msg >= 4:
    print('using default list')
    return os.path.join(path, dl)
    elif l == 'alt':
    if msg >= 4:
    print('using alternative list')
    return os.path.join(path, al)
    else:
    try:
    if not os.path.exists(os.path.join(path, l)):
    if msg >= 1:
    print('Error :: list does not exist')
    raise
    elif not os.path.isfile(os.path.join(path, l)):
    if msg >= 1:
    print('Error :: list not a file')
    raise
    else:
    try:
    c = valid_list_list.index(l)
    if msg >= 6:
    print('list name has been validated')
    except:
    if msg >= 2:
    print('Warnimg :: list used has not been vaildated by script')
    print('Warnimg :: if valid; add to the list of valid lists')
    if msg >= 5:
    print('path exists')
    return os.path.join(path, l)
    except:
    if returnF == True:
    return False
    else:
    if msg >= 2:
    print('Warning :: using default list')
    return os.path.join(config_path, dl)
    def get_seq(msg=def_msg):
    """Returns the sequence of current wallpaper and curr position."""
    mask = get_filter(msg=msg)
    path = get_info(msg=msg)[0]
    name = get_info(msg=msg)[1]
    list1 = os.listdir(path)
    if mask == '':
    list0 = list1
    else:
    list2 = []
    for i in list1:
    if i.find(mask) > -1:
    list2.append(i)
    try: # check the filter is currently being used
    num = list2.index(name)
    #print('wallpaper in filtered list')
    list0 = list2
    except: # filter is out of date
    if msg >= 5:
    print('wallpaper not in filtered list... clearing')
    list0 = list1
    set_filter(msg=msg) # clear filter
    list0.sort()
    try: # needed if current wallpaper has been removed
    num = list0.index(name)
    if msg >= 5:
    print('current wallpaper info ::')
    print('name : {0}, number : {1}' .format(name, num))
    return num, list0
    except:
    if msg >= 1:
    print('Error :: get_seq :: Current wallpaper file missing :: name : {0}' .format(name))
    return 0, list0
    def list_sequence(com='next', seq=None, msg=def_msg):
    cname = get_info(msg=msg)[1]
    if seq == None:
    list_dir = get_info(msg=msg)[0]
    list_file = get_seq(msg=msg)[1]
    if msg >= 4:
    print('Changing wallpaper in sequence using current folder:mask')
    else:
    ## Build a list.
    a = check_list(seq, msg=msg)
    list_dir = []
    list_file = []
    with open(a, 'r') as f:
    for line in f:
    i = line.split(',')
    list_dir.append(os.path.join(root, strip_opt(i[0])))
    list_file.append(strip_opt(i[1]))
    set_filter(msg=msg) # flush mask if using a list
    if msg >= 4:
    print('Changing wallpaper in sequence using list file')
    try:
    c = list_file.index(cname)
    if msg >= 5:
    print('found current wallpaper in list at position {0}' .format(c))
    if com == 'random':
    n = random.randrange(0, len(list_file))
    if msg >= 4:
    print('setting random wallpaper from sequence')
    elif com == 'prev':
    n = get_prev(c, list_file)
    if msg >= 4:
    print('setting previous wallpaper in sequence')
    elif com == 'next':
    n = get_next(c, list_file)
    if msg >= 4:
    print('setting next wallpaper in sequence')
    elif com == 'first':
    if msg >= 4:
    print('setting first wallpaper in sequence')
    n = 0
    else:
    if msg >= 2:
    print('Warning :: Unknown commmand')
    n = 0
    except:
    if msg >= 4:
    print('Warning :: not found current wallpaper in list / folder')
    print('using first file in list / folder')
    n = 0
    if seq == None:
    set_wallpaper(list_file[n], list_dir, msg=msg)
    else:
    set_wallpaper(list_file[n], list_dir[n], msg=msg)
    def toggle_list(d='default', com='toggle', msg=def_msg):
    """Removes the current file from the list."""
    a = check_list(d, msg=msg)
    file_list = []
    mod_file = []
    cname = get_info(msg=msg)[1]
    cpath = get_info(msg=msg)[0]
    if os.path.dirname(cpath) == root:
    cdir = os.path.basename(cpath)
    elif os.path.dirname(os.path.dirname(cpath)) == root:
    cdir = os.path.join(os.path.basename(os.path.dirname(cpath)), os.path.basename(cpath))
    else:
    print('error')
    sys.exit()
    cmask = get_filter(msg=msg)
    if cmask == '':
    cdmask = cdir
    else:
    cdmask = '{0}:{1}' .format(cdir, cmask)
    in_list = False
    with open(a) as f:
    for line in f:
    i = line.split(',')
    if cname == strip_opt(i[1]):
    if msg >= 6:
    print('file in list')
    in_list = True
    else:
    if msg >= 6:
    print('file not in list')
    file_list.append(strip_opt(i[1]))
    mod_file.append('{0} , {1} \n' .format(strip_opt(i[0]), strip_opt(i[1])))
    if in_list and com != 'rmfile' :
    if msg >= 3:
    print('Removed file from list')
    if test:
    for j in mod_file:
    print('writing newline: {0}' .format(j))
    else:
    with open(a, 'w') as newf:
    for j in mod_file:
    newf.writelines(j)
    elif not in_list and com != 'addfile':
    mod_file.append('{0} , {1} \n' .format(cdmask, cname))
    if msg >= 3:
    print('Added wallpaper to list')
    if test:
    for j in mod_file:
    print('writing newline: {0}' .format(j))
    else:
    with open(a, 'w') as newf:
    for j in mod_file:
    newf.writelines(j)
    else:
    if com == 'addfile':
    if msg >= 2:
    print('Warning :: File already in list')
    elif com == 'rmfile':
    if msg >= 2:
    print('Warning :: File not in list')
    else:
    if msg >= 1:
    print('Error :: UNKNOWN :: TOG LIST FUNCTION')
    ##### OPENBOX MENU #####
    def gen_obmenu():
    import oblib
    for i in avaliable_folders():
    oblib.item(i, 'wallpaper.py --silent --change {0}' .format(i))
    def gen_obmenu_simple(name=None, i=None):
    import oblib
    if name == None:
    oblib.pipe_start()
    else:
    oblib.menu_start(name, i)
    oblib.item('Deafult', 'wallpaper.py --silent --default')
    oblib.sep()
    oblib.item('APOD', 'wallpaper.py --silent --apod')
    oblib.item('APOD Save', 'wallpaper.py --silent --apod-save')
    oblib.item('Random', 'wallpaper.py --silent --random')
    if name == None:
    oblib.pipe_end()
    else:
    oblib.menu_end()
    def gen_obmenu_standard():
    import oblib
    oblib.pipe_start()
    oblib.item('Deafult', 'wallpaper.py --silent --default')
    oblib.sep()
    oblib.item('APOD', 'wallpaper.py --silent --apod')
    oblib.item('APOD Save', 'wallpaper.py --silent --apod-save')
    oblib.sep()
    oblib.menu_start('Change Set')
    obmenu_change_set()
    oblib.menu_end()
    apod.obmenu_archive_folders(t='menu')
    oblib.item('Toggle List', 'wallpaper.py --silent --toggle')
    oblib.item('Random', 'wallpaper.py --silent --random')
    oblib.pipe_end()
    def gen_obmenu_alt():
    import oblib
    oblib.pipe_start()
    oblib.sep('Alt Menu')
    obmenu_change_set('alt')
    oblib.pipe_end()
    def obmenu_change_set(a='default', dl=menu_default, al=menu_alt):
    import oblib
    menu = check_list(a, dl=dl, al=al, returnF=True)
    if menu != False:
    f = open(menu, 'r')
    for line in f:
    i = line.split(',')
    oblib.item(strip_opt(i[0]), 'wallpaper.py --change {0}' .format(strip_opt(i[1])))
    f.close()
    else:
    for i in avaliable_folders():
    oblib.item(i, 'wallpaper.py --change {0}' .format(i))
    ##### TEST FUNCTIONS #####
    def parser_options():
    print('Options are: {0}' .format(options))
    print('Args are : {0}' .format(args))
    print('Command is : {0}' .format(command))
    def meta_info():
    if options.meta_source == None:
    print('No source specifieed')
    else:
    print('Script launched from source :: {0}' .format(options.meta_source))
    def test_module():
    #pass
    #print(check_list(args[0]))
    new_mod()
    def new_mod():
    #if path == None:
    # print('No path specified, using pwd')
    # path = os.curdir
    #need_new_name = False
    #print('Checking filenames in {0}' .format(path))
    #for name in os.listdir(path):
    # if name.find(" ") > -1:
    # print("Warning :: > < in {0}" .format(name))
    # need_new_name = True
    # if name.find("'") > -1:
    # print("Warning :: >'< in {0}" .format(name))
    # need_new_name = True
    # if name.find("&") > -1:
    # print("Warning :: >&< in {0}" .format(name))
    # need_new_name = True
    # if name.find('"') > -1:
    # print('Warning :: >"< in {0}' .format(name))
    # need_new_name = True
    # if need_new_name:
    # new_name = name.replace('"', "").replace(" ", "_").replace("&", "and").replace("'", "")
    # if re_name:
    # print("Renaming to new name:: {0}" .format(new_name))
    # os.rename(os.path.join(path, name), os.path.join(path, new_name))
    # else:
    # print("Suggested new name:: {0}" .format(new_name))
    # need_new_name = False
    pass
    ##### SANITISE WALLPAPER FILE NAMES #####
    def sane_names(path=None, re_name=False, msg=def_msg):
    """Check file names in a path."""
    if path == None:
    print('No path specified, using pwd')
    path = os.curdir
    need_new_name = False
    print('Checking filenames in {0}' .format(path))
    for name in os.listdir(path):
    if name.find(" ") > -1:
    print("Warning :: > < in {0}" .format(name))
    need_new_name = True
    if name.find("'") > -1:
    print("Warning :: >'< in {0}" .format(name))
    need_new_name = True
    if name.find("&") > -1:
    print("Warning :: >&< in {0}" .format(name))
    need_new_name = True
    if name.find('"') > -1:
    print('Warning :: >"< in {0}' .format(name))
    need_new_name = True
    if need_new_name:
    new_name = name.replace('"', "").replace(" ", "_").replace("&", "and").replace("'", "")
    if re_name:
    print("Renaming to new name:: {0}" .format(new_name))
    os.rename(os.path.join(path, name), os.path.join(path, new_name))
    else:
    print("Suggested new name:: {0}" .format(new_name))
    need_new_name = False
    print('File name check complete')
    ##### MAIN FUNCTION #####
    def Main(msg=def_msg):
    """Chooses which command to run."""
    if options.direction != None: # a dircetion has been set
    list_sequence(com=options.direction, seq=options.whichlist, msg=msg)
    elif command == 'last':
    set_wallpaper_last(msg=msg)
    elif command == 'info':
    current_wallpaper_info(msg=msg)
    ## change folder
    elif options.newfolder != None:
    change_folder(options.newfolder, msg=msg)
    ## apod
    elif command == 'apod':
    #apod.download2(msg=msg, test=test)
    try:
    import apod
    apod.download2(msg=msg, test=test)
    except:
    pass
    elif command == 'apod-save':
    #apod.apod_save('today', msg=msg, test=test)
    try:
    import apod
    apod.apod_save('today', msg=msg, test=test)
    except:
    pass
    ## list management
    elif options.toggle != None:
    toggle_list(options.whichlist, com=options.toggle, msg=msg)
    ## openbox menu
    elif command == 'obmenu':
    gen_obmenu_standard()
    elif command == 'obmenu-simple':
    gen_obmenu_simple()
    elif command == 'obmenu-alt':
    gen_obmenu_alt()
    ## filename check
    elif command == 'sane-name':
    sane_names(path=options.sane_path, re_name=options.sane_rename, msg=msg)
    ## cycle
    elif command == 'cycle':
    print('ERROR :: function not implemented')
    elif command == 'testmod':
    test_module()
    elif options.whichlist != None: # a list but no direction specified
    list_sequence(seq=options.whichlist, msg=msg)
    elif command == "TestNone":
    print('Test mode null op[tion')
    elif command == None: ## no command specified
    pass
    else:
    print('Error :: no valid command found')
    ##### SCRIPT STARTUP #####
    if __name__ == "__main__":
    # def parse_change(option, opt_str, value, parser):
    # parser.values.command = 'change'
    # parser.values.newfolder = value
    # def parse_smask(option, opt_str, value, parser):
    # parser.values.command = 'set-mask'
    # parser.values.mask = value
    def parse_cycle(option, opt_str, value, parser):
    parser.values.command = 'cycle'
    parser.values.interval = value
    def parse_msglevel(option, opt_str, value, parser):
    parser.values.msg = value
    # def parse_addfile(option, opt_str, value, parser):
    # parser.values.command = 'addfile'
    # parser.values.whichlist = value
    # def parse_rmfile(option, opt_str, value, parser):
    # parser.values.command = 'rmfile'
    # parser.values.whichlist = value
    parser = OptionParser(usage = "usage: %prog [options] command", version="%prog {0}" .format(__version__),
    description = "Drews Script to the manage wallpapers using feh.")
    parser.set_defaults(command=None, whichlist=None, direction=None, toggle=None, newfolder=None)
    standard = OptionGroup(parser, "Standard Options")
    metaopt = OptionGroup(parser, "Meta Info Options", "Further datails about the script startup useful for debugging")
    gapod = OptionGroup(parser, "APOD Options", "Controls for the Astronomy Picture of the Day. ")
    obmenu = OptionGroup(parser, "Openbox Menu", "Support for openbox xml menu generation. ")
    #groupalt = OptionGroup(parser, "Alternative Wallpapers")
    gplist = OptionGroup(parser, "List Support")
    namecheck = OptionGroup(parser, "Filename Support")
    direction = OptionGroup(parser, "Direction Commands")
    ## Standard Options
    standard.add_option("-q", "--quiet",
    action="store_true", dest="quiet", default=False, #help=SUPPRESS_HELP)
    help="only display warnings and errors")
    standard.add_option("-v", "--verbose",
    action="store_true", dest="verbose", default=False, #help=SUPPRESS_HELP)
    help="display all output")
    standard.add_option("--debug",
    action="store_true", dest="debug", default=False, #help=SUPPRESS_HELP)
    help="debug mode: detailed output of commands")
    standard.add_option("--really-quiet",
    action="store_true", dest="reallyquiet", default=False, help=SUPPRESS_HELP)
    #help="only display errors")
    standard.add_option("--silent",
    action="store_true", dest="silent", default=False, help=SUPPRESS_HELP)
    #help="don't display any output")
    standard.add_option('-t', "--test",
    action="store_true", dest="test", default=False, #help=SUPPRESS_HELP)
    help="test mode :: only print output")
    standard.add_option("--test-mod",
    action="store_const", const="testmod", dest="command", #help=SUPPRESS_HELP)
    help="test mode :: use test function module")
    standard.add_option("--test-none",
    action="store_const", const="TestNone", dest="command", #help=SUPPRESS_HELP)
    help="test mode :: no command specified")
    parser.add_option("--info", '-i',
    action="store_const", const="info", dest="command",
    help="Displays information about the current wallpaper.")
    parser.add_option("--last", '-l',
    action="store_const", const="last", dest="command",
    help="Sets the wallpaper as the last picture")
    direction.add_option('-n', "--next",
    action="store_const", const="next", dest="direction",
    help="Sets the next wallpaper in the sequence")
    direction.add_option('-p', "--prev", '--previous',
    action="store_const", const="prev", dest="direction",
    help="Sets the previous wallpaper in the sequence")
    direction.add_option('-r', '--rand', "--random",
    action="store_const", const="random", dest="direction",
    help="Sets a random wallpaper from the sequence")
    direction.add_option('-1', '--first', "--safe",
    action="store_const", const="first", dest="direction",
    help="Sets the first wallpaer in the sequence")
    gplist.add_option('-d', "--default",
    action="store_const", const="default", dest="whichlist",
    help="Uses the wallpapers from the default file list")
    gplist.add_option("--alt",
    action="store_const", const="alt", dest="whichlist",
    help="Uses the wallpapers from the alternative list")
    parser.add_option("--change", '-c',
    metavar="Folder[:Filter]", dest="newfolder",
    help="Changes the wallpaper folder, optional filter.")
    gapod.add_option('-a', "--apod",
    action="store_const", const="apod", dest="command",
    help="downloads and sets the wallpaper as todays APOD picture")
    gapod.add_option("--apod-save",
    action="store_const", const="apod-save", dest="command",
    help="Saves todays APOD picture")
    # gapod.add_option("--apod-last",
    # action="store_const", const="apod-last", dest="command",
    # help="Sets the wallpaper as yesterdays APOD picture")
    # gapod.add_option("--apod-force",
    # action="store_const", const="apod-force", dest="command",
    # help="force the download of todays APOD picture")
    gplist.add_option("--add-to-list",
    action="store_const", const='rmfile', dest='toggle',
    help="Adds the current wallpaper to the list.")
    gplist.add_option("--remove-from-list",
    action="store_const", const='addfile', dest='toggle',
    help="Removes the current wallpaper from a list.")
    gplist.add_option("--toggle-list", '--toggle',
    action="store_const", const='toggle', dest='toggle',
    help="Adds/Removes the current wallpaper from a list.")
    gplist.add_option("--list",
    metavar="LIST", dest='whichlist',
    help="Sets which list to use.")
    obmenu.add_option("--obmenu",
    action="store_const", const="obmenu", dest="command",
    help="Prints the standard openbox menu.")
    obmenu.add_option("--obmenu-simple",
    action="store_const", const="obmenu-simple", dest="command",
    help="Prints the simple openbox menu.")
    obmenu.add_option("--obmenu-alt",
    action="store_const", const="obmenu-alt", dest="command", #help=SUPPRESS_HELP)
    help="Prints the alternative openbox menu.")
    namecheck.add_option("--name-check",
    action="store_const", const="sane-name", dest="command",
    help="Checks if wallpaper names are valid.")
    namecheck.add_option("--name-path",
    metavar="PATH", dest="sane_path", default=None,
    help="Which folder to check.")
    namecheck.add_option("--rename",
    action="store_true", dest="sane_rename", default=False,
    help="If to rename invalid files.")
    metaopt.add_option("--meta-from",
    metavar="Source", dest='meta_source', default=None,
    help="Details from where the script was launched from")
    parser.add_option_group(direction)
    parser.add_option_group(gplist)
    parser.add_option_group(gapod)
    parser.add_option_group(obmenu)
    #parser.add_option_group(standard)
    #parser.add_option_group(metaopt)
    #parser.add_option_group(namecheck)
    (options, args) = parser.parse_args()
    test = options.test
    #debug = options.debug
    #verbose = options.verbose
    #quiet = options.quiet
    ## message level
    if options.debug == True:
    msg = 5
    elif options.verbose == True:
    msg = 4
    elif options.quiet == True:
    msg = 2
    elif options.reallyquiet == True:
    msg = 1
    elif options.silent == True:
    msg = 0
    else:
    msg = 3
    #if options.command == None:
    # try: # try and find a command
    # command = args[0]
    # except:
    # pass
    #else:
    # command = options.command
    command = options.command
    if options.debug:
    parser_options()
    meta_info()
    LockScript(Main, msg=msg) # start the script
    else:
    pass
    apod.py
    #!/usr/bin/python3
    #Filename: apod.py
    __version__ = '3.2.0'
    import os, sys
    from optparse import OptionParser, OptionGroup, SUPPRESS_HELP
    import shutil
    from datetime import date
    #print('loaded apod')
    ##### VARIABLES #####
    ## Files and Paths
    #apod_archive_folder = '/home/wallpaper/apod_archive'
    archive_folder = '/home/wallpaper/apod_archive'
    save_folder = '/home/wallpaper/Space'
    tmpdir = '/tmp/wallpaper/apod'
    html_file = os.path.join(tmpdir, 'apod-html')
    img_file = os.path.join(tmpdir, 'apod-img')
    index_file = os.path.join(tmpdir, 'apod-index')
    work = os.path.expanduser('~/.config/openbox/apod')
    date_file = os.path.join(work, 'apod-date')
    apodfile = os.path.join(work, 'apod')
    apodlast = os.path.join(work, 'apod-last')
    namefile = os.path.join(work, 'apod-names')
    video_dir = os.path.join(work, 'apod-videos')
    errs = os.path.join(work, 'archive-errors')
    dtoday = str(date.today()) # todays date
    thisyear = dtoday[:4]
    saveprefix = 'APOD-'
    ## Defaults
    def_test = False
    def_msg = 3
    def_command = None
    def_apodset = True
    def_archive_apod = True # Keep all APOD pictures
    def_clear_apod = False
    def_force_apod = False
    def_cutoff = None
    store_file_list = ''
    ##### LOCK v2 #####
    ## Lock v2
    def LockScript(fun, lock='/tmp/apod.lock', msg=def_msg):
    """Locks the script before starting a function."""
    from os import O_CREAT, O_EXCL
    try: # lock the function
    fd = os.open(lock, O_CREAT+O_EXCL)
    #print('created lock file')
    except OSError:
    print('Already running function {0}...' .format(fun))
    sys.exit(1)
    try:
    fun(msg)
    finally:
    try: # release lock
    os.remove(lock)
    except:
    print('Error :: Lockfile missing !!!')
    ##### DEFINITIONS #####
    def get_date(dfile=date_file):
    check_file(dfile, create=True, msg=1)
    f = open(dfile)
    return f.read()
    def check_dir(d, create=False, msg=def_msg):
    """Check if path exists."""
    if not os.path.exists(d):
    if msg > 3:
    print('Error : folder missing...')
    if create:
    try:
    os.makedirs(d)
    if msg > 3 :
    print('...created folder')
    return True
    except:
    print('Fatal Error :: could not create directory {0}' .format(d))
    sys.exit()
    else:
    return False
    elif not os.path.isdir(d):
    print('Fatal Error :: this is not a directory')
    sys.exit()
    else:
    return True
    def check_file(f, create=False, msg=def_msg):
    """Check if path exists."""
    if not os.path.exists(f):
    #if msg > 3:
    # print('Error : file missing...')
    if create:
    check_dir(os.path.dirname(f), create=create, msg=msg)
    if msg > 5:
    print('creating file {0}' .format(f))
    try:
    q = open(f, 'w')
    q.write('')
    q.close()
    return True
    except:
    if msg >= 1:
    print('Fatal Error :: could not create file {0}' .format(f))
    sys.exit()
    else:
    if msg >= 5:
    print('file {0} does not exist' .format(f))
    return False
    else:
    if msg >= 5:
    print('file {0} exists' .format(f))
    return True
    def copy_file(ffrom, fto, msg=def_msg, test=def_test):
    """Copy files, from to (with test option)."""
    if test:
    print('[[copy command: {0} to {1}]]' .format(ffrom, fto))
    else:
    try:
    shutil.copy(ffrom, fto)
    except:
    if not os.path.exists(ffrom):
    print('Warning: error copying file, does not exist')
    elif os.path.isdir(ffrom):
    print('Fatal Error :: file being copied is a directory!')
    sys.exit()
    else:
    print('Fatal Error :: UNKNOWN ERROR during copy')
    sys.exit()
    def download_files(hfile=html_file, ifile=img_file, datefile=date_file, msg=def_msg, test=def_test, apodset=def_apodset, day='today', archive_apod=def_archive_apod):
    """Download the APOD html and img."""
    import urllib.request
    import socket
    timeout = 10
    socket.setdefaulttimeout(timeout)
    if day == 'today':
    url = 'http://antwrp.gsfc.nasa.gov/apod/astropix.html'
    name = dtoday
    year = thisyear
    else:
    url = 'http://antwrp.gsfc.nasa.gov/apod/ap{0}.html' .format(day)
    name = day
    if day[:1] == '9' :
    name = '19{0}-{1}-{2}' .format(day[:2], day[2:4], day[4:])
    else:
    name = '20{0}-{1}-{2}' .format(day[:2], day[2:4], day[4:])
    year = name[:4]
    try:
    response = urllib.request.urlopen(url)
    html = response.read()
    if msg > 3:
    print('downloaded html data for {0}' .format(day))
    check_file(hfile, create=True, msg=msg)
    f = open(hfile, 'wb')
    f.write(html)
    f.close()
    except:
    if msg >= 1:
    print('ERROR :: page not found :: exiting.')
    sys.exit(1)
    if day == 'today':
    t = open(datefile, 'w')
    t.write(dtoday)
    t.close()
    if msg > 3:
    print('updated date file with todays date')
    if msg > 3:
    print('copying over yesterdays APOD image')
    copy_file(apodfile, apodlast, msg=msg, test=test)
    found_img = False
    with open(hfile, 'r', encoding='latin-1') as g:
    for line in g:
    if 'IMG SRC' in line:
    i = line.split('"')
    if msg > 4:
    print('found image : {0}' .format(i[1]))
    found_img = True
    try:
    img_responce = urllib.request.urlopen(os.path.join('http://antwrp.gsfc.nasa.gov/apod/', i[1]))
    img_data = img_responce.read()
    except:
    print('error in img download')
    check_dir(errs, create=True, msg=1)
    check_file(os.path.join(errs, name), create=True, msg=0)
    else:
    if msg >= 5:
    print('read img data')
    check_file(ifile, create=True, msg=0)
    if msg >= 5:
    print('created img file')
    with open(ifile, 'wb') as l:
    l.write(img_data)
    if msg >= 3:
    print('downloaded image for {0}' .format(day))
    if day == 'today':
    copy_file(ifile,apodfile, msg=msg, test=test)
    if archive_apod:
    apod_archive(msg=msg, test=test, dfile=ifile, year=year, name=name)
    if not found_img :
    if msg >= 3:
    print('video :: not found image line in file from {0}' .format(i))
    check_file(os.path.join(video_dir, name), create=True, msg=0)
    if day == 'today':
    print('Warning : no image line in html file')
    copy_file(apodlast,apodfile, msg=msg, test=test)
    os.remove(hfile)
    os.remove(ifile)
    def apod_archive(dfile=img_file, msg=def_msg, test=def_test, year=thisyear, name=dtoday):
    """Archive APOD picture."""
    arch_file = os.path.join(archive_folder, year, name)
    check_dir(os.path.join(archive_folder, year), msg=msg, create=True)
    if check_file(arch_file, create=False, msg=msg):
    if msg > 3:
    print('APOD picture already archived')
    else:
    if msg > 3:
    print('Archiving APOD picture')
    copy_file(dfile, arch_file, msg=msg, test=test)
    def apod_save(day='current', sfolder=save_folder, msg=def_msg, test=def_test, prefix=saveprefix):
    """Save APOD picture as best of APOD."""
    with open(os.path.expanduser('~/.fehbg'), 'r') as f:
    a = f.read()
    b = a[15:-1]
    f.close()
    if day == 'today' or b[-4:] == 'apod':
    source = apodfile
    sfile = prefix + dtoday
    elif day == 'current':
    if not (os.path.dirname(b) == archive_folder or os.path.dirname(os.path.dirname(b)) == archive_folder ):
    print('picture is not in the recognised apod archive folder')
    sys.exit()
    source = b
    sfile = prefix+ b[-10:]
    else:
    if msg >= 1:
    print('unknown file specified')
    sys.exit(1)
    if msg > 3:
    print('Saving APOD picture to Save folder')
    copy_file(source, os.path.join(sfolder, sfile), msg=msg, test=test)
    def set_apod(a=apodfile, msg=def_msg, test=def_test, apodset=def_apodset ):
    """Sets the APOD wallpaper."""
    if not apodset:
    if msg > 3:
    print('Skipping setting APOD picture')
    else:
    if msg > 3:
    print('Setting APOD picture')
    if test:
    print("exec :: feh --bg-scale {0}" .format(a))
    else:
    os.system("feh --bg-scale {0}" .format(a))
    def clear_date(msg=def_msg, test=False):
    """Clears the date file."""
    if msg > 3:
    print('reseting date')
    if not test:
    t = open(datefile, 'w')
    t.write('')
    t.close()
    ##### APOD NAMES #####
    def get_name(fname=None, names=namefile, msg=def_msg, rerun=True, prefix=saveprefix):
    """Returns the name of an APOD file."""
    name_index = []
    title_index = []
    with open(names, 'r') as f:
    for line in f:
    i = line.split(',', 3)
    name_index.append(i[0])
    title_index.append(i[3])
    if fname == None:
    if msg >= 4:
    print('getting todays date')
    date = get_date()
    elif fname.startswith(prefix):
    if msg >= 4:
    print('removing save prefix from name')
    date = fname[len(prefix):]
    else:
    date = fname
    try:
    c = name_index.index(date)
    return title_index[c][:-2]
    except:
    if rerun:
    if msg >= 2:
    print('Warning :: name not in index, recreating')
    download_apod_index(msg=msg)
    build_name_list(msg=msg)
    get_name(fname=fname, names=names, msg=msg, rerun=False)
    else:
    if msg >= 1:
    print('Error :: name not in index, please recreate')
    def regen_index(msg=def_msg, cutoff=None):
    download_apod_index(msg=msg)
    build_name_list(msg=msg, cutoff=cutoff)
    def file_status(date, msg=def_msg, cutoff=None):
    """Status of an APOD Picture."""
    downloaded_files = [] # files in main apod download folder
    archive_files = [] # files in sub folder
    archive_download = [] # files from archive download
    videolist = []
    for i in os.listdir(archive_folder):
    if os.path.isdir(os.path.join(archive_folder,i)):
    for j in os.listdir(os.path.join(archive_folder, i)):
    j1 = j[2:]
    j2 = j1.replace('-','')
    archive_files.append(j2)
    else:
    i1 = i[2:]
    i2 = i1.replace('-','')
    downloaded_files.append(i2)
    for i in os.listdir(video_dir):
    videolist.append(i)
    if date[:1] == '9' :
    tdate = '19{0}' .format(date)
    else:
    tdate = '20{0}' .format(date)
    if cutoff == None:
    cutoff = '1995' # apod started 1995 06 16
    if tdate <= cutoff:
    return 'cut-off'
    try:
    downloaded_files.index(date)
    if msg >= 5:
    print('picture has been downloaded')
    return 'downloaded' #print('picture from {0} has already been downloaded' .format(pagedate))
    except:
    pass
    try:
    archive_files.index(date)
    if msg >= 5:
    print('picture has been downloaded')
    return 'archived' #print('picture from {0} has already been downloaded' .format(pagedate))
    except:
    pass
    try:
    archive_download.index(date)
    if msg >= 5:
    print('picture has been downloaded by archive retrieval')
    return 'retrieved'
    except:
    pass
    try:
    videolist.index(date)
    if msg >= 5:
    print('picture is a video')
    return 'video file'
    except:
    if msg >= 5:
    print('picture is missing')
    return 'missing'
    def download_apod_index(msg=def_msg, index=index_file):
    """Downloads the apod index file."""
    import urllib.request
    try:
    response = urllib.request.urlopen('http://antwrp.gsfc.nasa.gov/apod/archivepix.html')
    html = response.read()
    if msg > 3:
    print('downloaded apod index')
    check_file(index, create=True, msg=msg)
    f = open(index, 'wb')
    f.write(html)
    f.close()
    except:
    if msg >= 1:
    print('Fatal Error :: index page not found')
    sys.exit()
    def build_name_list(msg=def_msg, index=index_file, names=namefile, cutoff=None):
    """Builds a name list."""
    check_file(names, create=True, msg=msg)
    data = []
    with open(index, 'r') as f:
    for line in f:
    if '<a href="ap' in line:
    i = line.split(':', 1)
    imgdate = i[1][13:19]
    imgname = i[1][26:-9]
    status = file_status(date=imgdate, msg=msg, cutoff=None)
    if imgdate[:1] == '9' :
    imgfile = '19{0}-{1}-{2}' .format(imgdate[:2], imgdate[2:4], imgdate[4:])
    else:
    imgfile = '20{0}-{1}-{2}' .format(imgdate[:2], imgdate[2:4], imgdate[4:])
    if msg >= 3:
    print('found file : date = {0} : status = {1} : filename = {2}' .format(imgdate, status, imgfile))
    data.append('{0},{1},{2},{3} \n' .format(imgfile, imgdate, status, imgname))
    if msg >= 4:
    print('finished parsing index file')
    with open(namefile, 'w') as newf:
    for j in data:
    newf.writelines(j)
    if msg >= 4:
    print('written new name list')
    ##### MACROS #####
    def download2(msg=def_msg, test=def_test, apodset=def_apodset, force_apod=def_force_apod, clear_apod=def_clear_apod, archive_apod=def_archive_apod):
    """Downloads and sets APOD picture."""
    if clear_apod:
    clear_date(msg=msg, test=test)
    if force_apod:
    if msg >= 3:
    print('download forced')
    if get_date() != dtoday or force_apod:
    download_files(msg=msg, test=test, archive_apod=archive_apod)
    else:
    if msg >= 2:
    print('apod has already been downloaded today')
    set_apod(msg=msg, test=test, apodset=apodset) # #set apod picture
    def archive_download(msg=def_msg, newindex=False, cutoff=None, test=def_test):
    """Search and download missing pictures from the APOD archive pages"""
    if newindex:
    regen_index(msg=msg, cutoff=cutoff)
    target_dates = []
    with open(namefile, 'r') as g:
    for line in g:
    i = line.split(',')
    if i[2] == 'missing':
    if file_status(date=i[1], msg=msg) == 'missing':
    target_dates.append(i[1])
    if msg >= 4:
    print('target list built')
    target_dates.sort()
    for j in target_dates:
    if msg >= 4:
    print('')
    download_files(msg=msg, test=test, day=j, archive_apod=True)
    ##### OPENBOX MENU #####
    def gen_obmenu_standard():
    import oblib
    oblib.pipe_start()
    oblib.item('APOD', 'apod.py --update')
    oblib.item('APOD Save', 'apod.py --save')
    oblib.item('APOD Force', 'apod.py --force')
    oblib.pipe_end()
    def obmenu_archive_folders(t='pipe'):
    import oblib
    years = []
    for i in os.listdir(archive_folder):
    if os.path.isdir(os.path.join(archive_folder,i)):
    years.append(i)
    years.sort()
    years.reverse()
    if t == 'pipe':
    oblib.pipe_start()
    else:
    oblib.menu_start('Apod Archive')
    for k in years:
    oblib.item('Apod: {0}' .format(k), 'wallpaper.py --change {0}/{1}' .format(archive_folder, k))
    if t == 'pipe':
    oblib.pipe_end()
    else:
    oblib.menu_end()
    ##### TEST FUNCTIONS #####
    def parser_options():
    print('Options are: {0}' .format(options))
    print('Args are : {0}' .format(args))
    print('Command is : {0}' .format(options.command))
    def meta_info():
    if options.meta_source == None:
    print('No source specifieed')
    else:
    print('Script launched from source :: {0}' .format(options.meta_source))
    def test_module(msg=def_msg):
    pass
    #gen_obmenu_arfolders()
    #unicode_test()
    #apod_archive_download(msg=msg)
    #print(check_list(args[0]))
    #regen_index(msg=msg)
    #print(get_name(fname=None, msg=msg))
    #print(len(saveprefix))
    ##### MAIN FUNCTION #####
    def Apod_Main(msg=def_msg):
    """Main functions."""
    command = options.command
    check_dir(work, create=True, msg=msg)
    if options.regen_index :
    regen_index(msg=msg, cutoff=options.cutoff)
    if command == None:
    command = 'pass'
    if command == "download":
    if msg > 3:
    print('Updating APOD')
    download2(msg=msg, test=options.test, apodset=options.apodset, force_apod=options.force, clear_apod=options.clear, archive_apod=options.archive)
    elif command == "download-only":
    if msg > 3:
    print('Downloading APOD picture only')
    download2(msg=msg, test=options.test, apodset=False, force_apod=options.force, clear_apod=options.clear, archive_apod=False)
    elif command == "last":
    if msg > 3:
    print('Setting last APOD')
    set_apod(apodlast, msg=msg, test=options.test, apodset=options.apodset)
    elif command == "save-today":
    apod_save('today', msg=msg, test=options.test)
    elif command == "save":
    apod_save('current', msg=msg, test=options.test)
    elif command == "set":
    if msg > 3:
    print('Setting APOD')
    set_apod(msg=msg, test=options.test, apodset=options.apodset)
    elif command == "restore":
    if msg > 3:
    print('Restoreing yesterdays APOD picture.')
    copy_file(apodlast, apodfile, msg=msg, test=options.test)
    set_apod(msg=msg, test=options.test, apodset=options.apodset)
    elif command == 'retrieve':
    archive_download(msg=msg, newindex=options.newindex, cutoff=options.cutoff)
    elif command == 'testmod':
    test_module(msg=msg)
    elif command == "TestNone":
    print('Test mode null op[tion')
    elif command == "pass":
    if msg >= 4:
    print('pass option has been called')
    elif not command == None:
    if msg >= 2:
    print('Warning :: Unrecognised command specified')
    #pass
    else:
    if msg >= 2:
    print('Warning :: no commands found, using default option')
    set_apod(msg=msg, test=options.test, apodset=options.apodset)
    ##### SCRIPT STARTUP #####
    if __name__ == "__main__":
    parser = OptionParser(usage = "usage: %prog [download options] [command]", version="%prog {0}" .format(__version__),
    description = "Script to manage APOD wallpapers.")
    parser.set_defaults(archive=def_archive_apod, apodset=def_apodset, command=None)
    standard = OptionGroup(parser, "Standard Options")
    doptions = OptionGroup(parser, "Download Options")
    aoptions = OptionGroup(parser, "Archive Options")
    metaopt = OptionGroup(parser, "Meta Info Options", "Further datails about the script startup useful for debugging")
    standard.add_option("-q", "--quiet",
    action="store_true", dest="quiet", default=False,
    help="only display warnings and errors")
    standard.add_option("-v", "--verbose",
    action="store_true", dest="verbose", default=False,
    help="display all output")
    standard.add_option("--debug",
    action="store_true", dest="debug", default=False,
    help="debug mode: detailed output of commands")
    standard.add_option("--really-quiet",
    action="store_true", dest="reallyquiet", default=False, help=SUPPRESS_HELP)
    #help="only display errors")
    standard.add_option("--silent",
    action="store_true", dest="silent", default=False, help=SUPPRESS_HELP)
    #help="don't display any output")
    standard.add_option('-t', "--test",
    action="store_true", dest="test", default=False, help=SUPPRESS_HELP)
    #help="test mode :: only print output")
    standard.add_option("--test-mod",
    action="store_const", const="testmod", dest="command", help=SUPPRESS_HELP)
    #help="test mode :: use test function module")
    standard.add_option("--test-none", "--pass",
    action="store_const", const="TestNone", dest="command", help=SUPPRESS_HELP)
    #help="test mode :: no command specified")
    parser.add_option('-a', '-u', '--update',
    action="store_const", const="download", dest="command",
    help="Downloads and sets the wallpaper as todays APOD picture")
    parser.add_option("--save",
    action="store_const", const="save", dest="command",
    help="Saves the curent APOD wallpaper")
    parser.add_option("--set",
    action="store_const", const="set", dest="command",
    help="Sets wallpaper as APOD")
    parser.add_option('--download-only',
    action="store_const", const="download-only", dest="command",
    help="Only downloads todays APOD picture")
    parser.add_option("--last",
    action="store_const", const="last", dest="command",
    help="Sets the wallpaper as yesterdays APOD picture")
    parser.add_option("--restore",
    action="store_const", const="restore", dest="command", help=SUPPRESS_HELP)
    #help="Restores yesterdays APOD picture as todays.")
    aoptions.add_option("--retrieve", '--populate',
    action="store_const", const="retrieve", dest="command",
    help="Retrives archive APOD images from the APOD archive")
    aoptions.add_option("--regen-index",
    action="store_true", dest="regen_index", default=False,
    help="Regenerates the APOD index file")
    aoptions.add_option("--no-index",
    action="store_false", dest="newindex", default=True, help=SUPPRESS_HELP)
    #help="Do not build a nex index")
    aoptions.add_option("--cut-off",
    metavar="Date", dest='cutoff', default=def_cutoff,
    help="Cut off date for downloading archive pictures")
    # parser.add_option("--get-name",
    # metavar="NAME", dest="getname", default=None,
    # help="Returns the name of a pictures name")
    doptions.add_option("--force",
    action="store_true", dest="force", default=def_force_apod,
    help="Force the download of todays APOD picture")
    doptions.add_option("--clear",
    action="store_true", dest="clear", default=def_clear_apod, help=SUPPRESS_HELP)
    #help="resets the date of last APOD download.")
    doptions.add_option("--archive",
    action="store_true", dest="archive",
    help="If to archive a picture after download")
    doptions.add_option("--no-archive",
    action="store_false", dest="archive",
    help="If to archive a picture after download")
    doptions.add_option("--force-set",
    action="store_true", dest="apodset", help=SUPPRESS_HELP)
    #help="If to set the wallpaper as APOD.")
    doptions.add_option("--no-set",
    action="store_false", dest="apodset", help=SUPPRESS_HELP)
    #help="Skips setting APOD as wallpaper")
    metaopt.add_option("--meta-from",
    metavar="Source", dest='meta_source', default=None,
    help="Details from where the script was launched from")
    parser.add_option_group(doptions)
    parser.add_option_group(aoptions)
    parser.add_option_group(standard)
    #parser.add_option_group(metaopt)
    (options, args) = parser.parse_args()
    ## message level
    if options.debug == True:
    msg = 5
    elif options.verbose == True:
    msg = 4
    elif options.quiet == True: # warnings
    msg = 2
    elif options.reallyquiet == True: # errors only
    msg = 1
    elif options.silent == True: # no output
    msg = 0
    else:
    msg = 3
    if options.debug:
    parser_options()
    meta_info()
    LockScript(Apod_Main, msg=msg)

  • Could any one tell me what is the difference between swfloader and module loader?

    Hi  All,
                          Could any one tell me what is the difference between SWFLoader and Module Loader in Flex3 in detail?

    Hi,
    ModuleLoader is a kind of strange API that is really just intended to look like SwfLoader for modules that contain a single visual component, and hides most of the module loading infrastructure, which is all about class factories.
    What I mean by "only loaded once" is that if you have several places in the code that call the ModuleManager.getModule("url").load() call, it will only ever get loaded over the wire and interpreted once, subsequent "loads" will just re-dispatch pseudo-load events to the new client.  In other words, the class factory is a singleton for a given url. Unloading is a totally different story.  As you note, not everything is truly unloadable, because there may be lots of references to stuff in
    the module that will keep it alive and un-GC'ed.
    I suggest playing with the low-level API so that you understand the backing implementation, and this should help you understand the limits of ModuleLoader.
    The main difference between modules and applications is that modules have lower overhead, and they only ever get loaded once, no matter how many times you load them. If you're using the ModuleLoader API, keep in mind that you're losing about half the functionality of the module system.  I will assume that you are, because otherwise it would be obvious where to expose methods.  You might want to play around with the lower level ModuleManager API just to get a hang of what's going on - ModuleLoader is a pretty thin veneer over the lower API.                
                    Basically, what you want to do is to have your module implement an interface, say IModuleWhatever.
    Also try and refer to this link which was previously discussed in this forum..
    http://forums.adobe.com/message/74404
    Thanks,
    Bhasker

  • [SOLVED] Cannot load the acerhdf module

    Hi all,
    I'm trying to load the acerhdf module that should control the fan-speed for my Acer 1810TZ. I'm following the README.txt and the ArchWiki but after have compiled and installed the module I'm not able to load it.
    [gianluca@gianluca-laptop downloads]$ cd acerhdf_kmod && make
    make -C /lib/modules/2.6.39-ARCH/build SUBDIRS=/home/gianluca/downloads/acerhdf_kmod modules
    make[1]: Entering directory `/usr/src/linux-2.6.39-ARCH'
    Building modules, stage 2.
    MODPOST 1 modules
    make[1]: Leaving directory `/usr/src/linux-2.6.39-ARCH'
    [gianluca@gianluca-laptop acerhdf_kmod]$ sudo make install
    make -C /lib/modules/2.6.39-ARCH/build SUBDIRS=/home/gianluca/downloads/acerhdf_kmod modules
    make[1]: Entering directory `/usr/src/linux-2.6.39-ARCH'
    Building modules, stage 2.
    MODPOST 1 modules
    make[1]: Leaving directory `/usr/src/linux-2.6.39-ARCH'
    [ -d /lib/modules/2.6.39-ARCH/updates ] || mkdir /lib/modules/2.6.39-ARCH/updates
    cp acerhdf.ko /lib/modules/2.6.39-ARCH/updates/
    depmod -a
    [gianluca@gianluca-laptop acerhdf_kmod]$ modprobe acerhdf
    FATAL: Error inserting acerhdf (/lib/modules/2.6.39-ARCH/kernel/drivers/platform/x86/acerhdf.ko.gz): Operation not permitted
    [gianluca@gianluca-laptop acerhdf_kmod]$ sudo modprobe acerhdf
    FATAL: Error inserting acerhdf (/lib/modules/2.6.39-ARCH/kernel/drivers/platform/x86/acerhdf.ko.gz): Invalid argument
    Besides, in the configuration file (the acerhdf.c file that you can find in the sources package) my BIOS (official Acer v1.3314 for the 1810TZ) is supported.
    What am I doing wrong?
    Thank you for your help,
    Gianluca
    Last edited by I am Gianluca (2011-07-13 20:17:43)

    Try using this package instead of building it yourself: http://aur.archlinux.org/packages.php?ID=23686
    When installing the package let it overwrite any existing files as these will all be files that you have created by building it yourself.

  • CS6 photoshop message 'could not load the fast core routines module because the file was not found'

    my CS6 photoshop is giving me the message 'could not load the fast core routines module because the file was not found'. this started happening after i used a trial of photoshop CC and decided not to stay with it.  my photoshop is part of my CS6 suite and i am only getting this message with photoshop, my ilustrator keeps working just fine..... does anyone know how to fix it? thanks.

    I did a search on my system and found the Photoshop has a fastcore plug-in.  Creative Cloud includes a subscription version of CS6 version 13.1.2.   I do not know if you installed that or not.  The cc un-install may have done something.  You may need to use Adobe Cleaner then Install The Perpetual CS6 version of Photoshop  CS6 version 13.0.6 Mac or Photoshop  CS6 version 13.0.1.3 PC and not the subscription CS6 extended version 13.1.2.  Use the CC Cleaner Tool to solve installation problems | CC, CS3-CS6   If you need to download the CS6 installer Download CS6 products.
    You may also be able to recover your cs6 using an old system backup
    fastcore.8bx on my system...

  • How do I fix my photosop when is says that it could not load FastCore Routines module because the file was not found?

    Every time I try to turn on Photoshop a pop up shows up and says "Could not load the FastCore Routines module because the file was not found." How do I fix this?@

    Here is a solution for an older version of Photoshop with a slightly different message, but it might be the same reason—trying to use older PS plug-ins with a newer version of PS:
    http://helpx.adobe.com/photoshop/kb/error-could-load-fastcore-multiprocessor.html

  • PE 5.0.2 - Could not load the FastCore Routines module because the file could not be found.

    The "view and organize photos" mode seems to work just fine, but when I attempt to open the "edit and enhance photos" mode, I get an error box with this message: "Could not load the FastCore Routines module because the file could not be found", and then it shuts down after I click ok. I have installed the 5.0.2 patch and have uninstalled and reinstalled the program, to no avail. I had no firewall running when installing the program, nor do I own the program "Clean Sweep". What can I do?
    Thanks for any help
    OS = Windows Vista.

    CANNOT LOAD FASTCORE ROUTINES, MMX CORE ROUTINES,
               MULTIPROCESSOR SUPPORT NOT FOUND
              SUCCESSFULLY REPAIRED - STEP BY STEP
    I made the repair for Elements 5 on an XP version Operating System PC by doing this:
    I went to....
    Start / All Programs / Accessories / Windows Explorer
    and selected.....
    My Computer / C:
    which is my drive with its operating system where Photoshop is installed.
    I then clicked....
    Documents and Settings  
    Then - in each - of the three icons I found.....
    All Users, Default User, and Owner
    I went into....
    Application Data / Adobe / Photoshop Elements
    In that last file I removed ALL the contents.... IN EACH !
    After rebooting, my Photoshop Elements 5 started to work.
    I think with research and all I invested five hours. May this save you 4 1/2.
    I was paranoid and put the contents of each file into a new file I identified
    clearly in case it I have to replace one of the parts out in the future.
    I hope this is of help to some future reader.
    Other comments here seem to indicate that this solution has
    worked in version 4 and up and fixed early versions of Vista.
    This appears to be a common problem after a drive repair or partitioning.
    Why they can't just tell us this is a mystery to me.
    -- Bon Courage! --
                                      Ken

  • Could not load the Multiprocessor Support module because it wont work with

    Here is a strange error message, there are actually 2.
    But they arent making PSE 8 unusable, just very annoying.
    Here is the first one,,,,,,,,,
    "Could not load the Multiprocessor Support module because it wont work with this version of photoshop."
    When I open PSE 8, on my new Intel Mac, I get this message and nobody seems to know what the problem is.
    My new Mac has 2 processors? Could that be what the message is saying?
    But when I click the error message away, PSE 8 works fine.
    There is another one too,
    "Could not load the FastCore Routines module because it doest not work with this version of photoshop."
    I just click it away and no problem, just a pita.
    So if they dont effect it, I shouldnt worry, but my classmates are concerned.
    Do you here have any idea what it is, and how to get rid of it?
    There is info on the web about it, but no solutions.
    Thank you,
    Jane

    This is interessting, as does my new Mac have 2 processors or 2 cores?  I havent come across how this works yet, nor how to find it on my Mac.
    Yes, I just found a site which explains it well,
    http://macperformanceguide.com/Optimizing-Cores.html
    I have one processor with 2 cores.
    And the equivalent of the Task Manager is the Activity Monitor, where I see only one processor.
    You sure explained this well!   I now think we can find the problem, though its not effecting either my PS or PSE, its just an annoying message that I have to click away.
    http://kb2.adobe.com/cps/407/kb407809.html
    Is what Adobe tells us, this is for Windows, but it could apply to Macs?
    I have tons of third party plug ins, and this problem is within the last month, and I didnt see the error messages before.  Thats confusing, as I would have thought it would have shown up right from the start.
    I just moved some of my plug ins, lets see if this changes anything, nope, but only one message appeared this time.
    This will be fun to see what the real answer is!  As I find out more, I will add it here.
    Thank you,
    Jane

Maybe you are looking for

  • Cannot install Premiere Pro CS6 and Prelude - Losing my mind

    I've been trying for 3 days to find a solution to this problem. I know a lot of other people have had this problem but the solutions all seem different based on the interpretation of the summary report generated by the installer. I've tried dealing w

  • Font color problem

    Newly downloaded numbers and now font does not go to anything but light purple in a spreadsheet. I tried to change it to black and it becomes white and you can't read anything. How do I fix this??

  • Can I replicate to a off-site DR Hyper-V site and ASR?

    Hi, I've had a troll around the various sites but I can find a definitive answer.  Am I correct in saying that I can only replicate to one location i.e. offsite DR Hyper-V server OR Azure Site Recovery? Rob

  • JSP page display wrong time when compared to the server time

    Hi, This problem seems to weird but it is happening I have web application running where time is displayed in the page. In this application time is very critical. Currently, time is an hour behind the orginal time. I checked the server it is displayi

  • Fallo en la actualización photoshop CC 2014

    Hola, me he bajado desde el Creative Cloud el photoshop 2014 (hasta ayer el photoshop que tenía funcionaba perfectamente), pero inmediatamente que este se abre, se cierra solo. Tengo Windows 8 64Bits He visto que el mismo problema sale en ese hilo: P