0 वोट
218 व्यूज़

मुझे PT9.0 में Wasta-Linux पर “Outils personnalisation” > “Admin” > “Show Project Plan HTML” का उपयोग करने की कोशिश करते समय एक त्रुटि (error) मिली। पता चला कि python स्क्रिप्ट Paratext Projects फोल्डर को खोजने के लिए Windows Registry का उपयोग करने की कोशिश करती है। तीसरी पंक्ति, “from _winreg import…” (cms/ProjectPlanImport.py से) पर ध्यान दें:

def settingsDirectory():
    # Find the directory with Paratext 8 projects using the windows registry
    from _winreg import OpenKey, EnumValue, HKEY_LOCAL_MACHINE

    strPath = r"SOFTWARE\WOW6432Node\Paratext\8"
    try:
        aKey = OpenKey(HKEY_LOCAL_MACHINE, strPath)
        for i in [0,1,2,3,4,5]:
            aName, aValue, irrelevant = EnumValue(aKey,i)
            if aName == 'Settings_Directory':
                return aValue + '\\'
        return None
    
    except WindowsError:
        # The registry key was not found
        return None
    except:
        raise

हालाँकि, इसी फोल्डर को os.path मॉड्यूल का उपयोग करके सापेक्ष रूप से खोजा जा सकता है। इसलिए मैंने अपने सिस्टम पर फंक्शन को निम्नलिखित रूप में अपडेट किया:

def settingsDirectory():
    # Find the directory with Paratext 8 projects using Python 2 tools.
    cms_dir = os.path.dirname(os.path.realpath(__file__))
    if os.path.basename(cms_dir) == 'cms' and os.path.isdir(cms_dir):
        return os.path.dirname(cms_dir)
    else:
        return None

तो मुझे लगता है कि मेरा सवाल यह है: क्या यह संभव है कि गैर-मानक (non-standard) इंस्टॉलेशन में cms फोल्डर Paratext Projects फोल्डर के अंदर कहीं और हो, जिससे Windows में registry जांच की आवश्यकता हो? या, यदि ऐसा नहीं है, तो क्या कोई ProjectPlanImport.py और ProjectPlanRoot.py स्क्रिप्ट्स को अपडेट करने पर विचार करेगा ताकि इन स्क्रिप्ट्स को अधिक सार्वभौमिक रूप से संगत (compatible) बनाया जा सके?

यदि मैं इस बारे में सही व्यक्ति से चर्चा कर सकूं, तो मैं OS जांच करने और settingsDirectory को OS-निर्भर रूप से खोजने का तरीका निकालने के लिए भी तैयार हूं। बहरहाल, cms स्क्रिप्ट्स में _winreg मॉड्यूल का संदर्भ देने वाले लगभग केवल ये ही दो स्थान प्रतीत होते हैं।

English से मशीन-अनुवादित
Paratext में द्वारा (298 अंक)
संपादित द्वारा | 218 व्यूज़

1 उत्तर

0 वोट
कुछ महीनों तक अपने ही वर्कअराउंड (workaround) का उपयोग करने के बाद मुझे एहसास हुआ कि 1) ऊपर दिया गया "settingsDirectory()" फंक्शन अनावश्यक है क्योंकि "SettingsDirectory" वास्तव में CMS स्क्रिप्ट्स के लिए एक प्रदान किया गया वैश्विक चर (global variable) है, और 2) .cms फाइल में "\toHtml" पैरामीटर का उद्देश्य जनरेट की गई HTML फाइल को डिफ़ॉल्ट ब्राउज़र में खोलना है, लेकिन यह भी Linux इंस्टॉलेशन में विफल हो जाता है। इसलिए मैंने एक CMS स्क्रिप्ट बनाई जो "Show Project Plan HTML" स्क्रिप्ट के सहारे चलती है ताकि "Show Project Plan HTML (Linux)" जोड़ा जा सके। यह स्क्रिप्ट दोनों ही उल्लेखित समस्याओं से बचती है।

आप फाइलों को https://github.com/sil-car/ProjectPlanHtmlLinux से प्राप्त कर सकते हैं
English से मशीन-अनुवादित
द्वारा (298 अंक)

संबंधित प्रश्न

0 वोट
0 उत्तर 178 व्यूज़
Wasn't sure where to report this bug fix for the Show Project Plan Html script, found in the project Custom Tools > ... be causing the problem. Probably best to change it as well
jeffh 1.4k पूछा गया मई 8, 2020
Paratext में
0 वोट
3 उत्तर 348 व्यूज़
हाल ही में हुए Paratext परिचय कार्यशाला में, एक प्रतिभागी Wasta-Linux पर Paratext 8 का उपयोग कर रहे थे। चूंकि मुझे LInux ... को काम करने के लिए कुछ विशेष करना ज़रूरी है? धन्यवाद
MSEAIT_LT 478 पूछा गया दिसंबर 1, 2017
0 वोट
1 उत्तर 378 व्यूज़
After an Install of Wasta 14 Paratext, the Advanced Checks is greyed out. In my home directory I see ... windows C:\MyParatextProjects\cms What might cause this?
anon432075 149 पूछा गया सितंबर 8, 2016
0 वोट
0 उत्तर 167 व्यूज़
I am recovering from a massive computer failure on a team member's computer. I have reinstalled Wasta-Linux 18 and am ... the way it normally does on that profile. Any ideas?
anon349755 120 पूछा गया अक्टूबर 2, 2019
0 वोट
1 उत्तर 427 व्यूज़
मैं प्रोजेक्ट को HTML में निर्यात करना चाहता/चाहती हूँ ताकि मैं लोगों के साथ ड्राफ्ट साझा कर सकूँ। मैं PDF में निर्यात नहीं ... गए HTML से USFM मार्कर को कैसे छिपा सकता/सकती हूँ?
bit 495 पूछा गया अप्रैल 14, 2022
Welcome to Support Bible, where you can ask questions and receive answers from other members of the community.
But if we walk in the light, as he is in the light, we have fellowship with one another, and the blood of Jesus, his Son, purifies us from all sin.
1 John 1:7
3,045 प्रश्न
6,005 उत्तर
5,671 टिप्पणियाँ
2,026 उपयोगकर्ता