Activity bundles/lang-ko

From OLPC
Jump to: navigation, search
  이 페이지는 OLPC 팀을 모니터링합니다.
  번역근원 Activity bundles 원문  
  english | 한국어   +/- 차이  

소개

슈가 환경에서 모든 액티비티는 자기 포함 self-contained 번들로 포장 (패키지)됩니다. 번들은 해당 액티비티가 실행에 필요한 자원과 실행가능한 코드 (시스템이 제공하는 기본 라이버러리 외)를 포함합니다. 기본 시스템이 제공하지 않는 모든 자원과 실행가능한 코드는 해당 번들 내에 패키지되어야 합니다.

참조
일반 사항은 OLPC 비트프로스트소프트웨어 설치 섹션을 참조

이유

액티비티는 어린이들 사이에 공유되도록 의도됩니다. 어떤 어린이에게 특정 액티비티가 없다면, 그것은 그 또는 그녀가 공유 액티비티에 참여할 때 해당 어린이에게 자동적으로 이전됩니다. 자기 포함 self-contained 속에 액티비티들을 패키지함으로써, 공유, 설치, 제거, 및 백업을 쉽게 수행할 수 있습니다.

위치

액티비티는 사용자 행동에 대응하여 슈가에 의해 자동적으로 설치 및 제거됩니다. 슈가는 스스로 선택한 디렉토리 내에 액티비티들을 위치시키며, 액티비티는 특정 위치에 설치될 것을 기대할 수 없고, 경로가 필요한 경우 상대 경로를 이용해야 합니다 (가령, 공유된 라이버러리 링키지의 경우, 이미지, 사운드 등의 액티비티 리소스). 또한, 해당 번들의 베이스 디렉토리 이름이 계속 동일할 것으로 기대해서도 안됩니다. 슈가는 번들 충돌을 막기 위해 언제라도 액티비티 번들 베이스 디렉토리의 이름을 바꿀 수 있습니다.

현재 jhbuild 슈가는 XDG_DATA_DIRS의 "액티비티" 서브폴더에서 번들을 찾습니다. 현재는 jhbuild 빌드 폴더의 /usr/share/activities and the usr/share/activities 서브폴더입니다.

슈가는 해당 액티비티가 설치 또는 제거될 때, D-Bus 서비스 활성화를 통해, 해당 액티비티를 시동하는데 필요한 .service 파일을 자동적으로 생성 및 제거합니다.

액티비티는 해당 액티비티 번들 그 자체 속에 로컬 스테이트 또는 프레퍼런스를 결코 저장해서는 안됩니다. 이것들은 SUGAR_PROFILE 환경 변수를 통해 가용한, 사용자의 슈가 프로파일 내 액티비티-특정 디렉토리에 항상 저장되어야 합니다.

파이선 개발자는 아래와 같이 프로파일 폴더를 얻을 수도 있습니다:

import sugar.env
profile_path = sugar.env.get_profile_path()

번들 구조

액티비티 번들은 디렉토리이며, ".activity"로 끝나는 이름을 가집니다. 각 액티비티 번들은, 'activity'로 불리든 서브 디렉토리 내에서, "activity.info" 파일과 아래의 특정한 포맷을 가져야만 합니다. 가령:

Web.activity/
    locale/
        de_DE/
            activity.linfo
        zh_CN/
            activity.linfo
    activity/
        activity.info
        activity-web.svg
    icons/
액티비티

All metadata about the activity is organized in this subdirectory. 해당 액티비티에 관한 모든 메타데이터는 이 서브디렉토리에 조직됩니다.

아이콘

해당 액티비티에 의해 이용되는 아이콘을 포함합니다. 슈가.액티비티 파이선 패키지를 이용할 때, 그 경로는 자동적으로 디톨트 gtk icon theme에 추가됩니다.

.info 파일 포맷

.info 파일은 key/value pair 포맷을 따르는데, fd.o desktop entry spec와 유사하지만, 일치하지는 않습니다. 예로써:

[Activity]
name = Web
activity_version = 1
host_version = 1
service_name = com.redhat.Sugar.BrowserActivity
icon = activity-web
class = browseractivity.BrowserActivity
mime_types = application/pdf;image/tiff

유효한 프라퍼티의 자세한 설명은:

[Activity]
activity.info 파일은 [Activity]로 시작해야만 하며, 파일의 첫번째 라인에 위치해야 합니다.
name = Web
이 것은 슈가가 해당 액티비티를 언급할 때 표시되는 이름입니다. 괄호 언어 코드가 없는 'name' 키는 해당 액티비티의 "en_US" 지역화 이름입니다. activity.info 파일은 이 키를 가져야만 합니다.
activity_version = 1
각 activity.info 파일은 "activity_version" 키를 가져야 합니다. 이 버전은 단일 양의 정수이며, 1~9 사이의 문자를 가질 수만 있습니다. 보다 큰 버전은 "newer"로 간주됩니다. 이 키에 할당된 값은 해당 액티비티에 대해 opaque로 간주됩니다; 이 액티비티의 유일한 요구는 새로운 액티비티 빌드가 반드시 더 커야 한다는 점이빈다.
host_version = 1
Each activity.info file must have a "host_version" key. The version is a single positive integer, and may only contain the characters 1 through 9. This specifies the version of the Sugar environment which the activity is compatible with. (fixme: need to specify sugar versions somewhere. Obviously we start with 1.)
service_name = com.redhat.Sugar.BrowserActivity
This is the activity's dbus service name. It is required. It is also used as the activity's default service type when the activity is shared on the network. To determine this type, the distince parts (separated by the '.' character) are reversed, any '.' is replaced by a '_' character, and the type is prefixed by a '_' character. So in this example, the default service type would be "_BrowserActivity_Sugar_redhat_com".
icon = activity-web
It points to the activity's icon. The icon is looked up in the activity bundle's base directory. It cannot contain a path. When searching for the icon in the activity bundle's base directory, only an file with the icon name and the extension '.svg' will be looked for.
exec = myfactory myoptions
The exec key is used when Sugar installs the activity. It specifies the executable which Sugar runs to start the activity's factory service. A factory service spawns instances of the actual activity. The executable name must be a path relative to the bundle's top level directory. Environment variables given on the exec line are expanded, in particular, $SUGAR_BUNDLE_PATH expands to the absolute path of the bundle directory.
class = browseractivity.BrowserActivity
For Python-based activities, it's not necessary to write a custom factory since a generic one is provided with Sugar. Use this attribute to specify the main Activity class. When a class is specified the exec attribute is ignored.
mime_types = application/pdf;image/tiff
List of mime types supported by the activity, separated by semi colons. It's used when opening a file from the web or to present to the user a list of activities which can open a certain journal object.
show_launcher = yes
이 키는 선택적입니다. 없거나, "yes" 값을 가지면, 해당 액티비티는 슈가 패널 론처 내에 그 자신의 아이콘으로 표시되며, 유효한 'icon' key/value pair가 요구됩니다. "no" 값이 명시되면, 해당 액티비티는

슈가 패널 론처 내에 나타나지 않으며, 'icon' 가 요구되지 않습니다.

액티비티 이름 로컬리제이션/번역

지역화된 데이터는 지역 디렉토리에 있습니다. 각 언어는 해당 언어의 ISO 코드에 따라 명명된 separate 디렉토리 내에 자신의 지역화 키를 보관합니다. 'activity.info' 파일로부터의 지역화 키는 그 디렉토리의 'activity.linfo' 파일에 보관됩니다. 가령, 독일-지역화 독일어 (스위스-지역화 독일어와 비교해서) 번역은 'de_DE/activity.linfo' 파일에 보관됩니다.

Example.activity/
    exampleactivity.py
    activity/
        activity.info
    locale/
        de_DE/
            activity.linfo
        de_CH/
            activity.linfo

At this time, only translations for the 'name' key from the 'activity.info' file is supported. A localized 'de_DE/activity.linfo' file would look like:

[Activity]
name = Web

Keys in the languague-specific '.linfo' files selectively override keys from the 'activity.info' file; if a key is not present in the '.linfo' file the value from the 'activity.info' file is used instead.

패키지

액티비티 번들은 ".xo" 익스텐션이 있는 짚 파일로 패키지되어야 합니다.

기타 기술 비교

액티비티 번들은 OS X 번들 또는 자바 JAR 파일과 유사합니다; 독립적으로 이동 가능한 단일 디렉토리 내에 귀하가 필요로 하는 모든 것을 캡슐화하는 단순한 매커니즘.

오토패키지 autopackage와는 다른데, 이것은 패키지 관리 시스템이 아닙니다. 중앙 데이터베이스도 없고, install/uninstall에서 실행되는 스크립트도 없습니다. 또한 특정한 파일 포맷도 없습니다.

klik과 비교할 때, 해당 패키지 내에 로컬 유닉스 디렉토리 구조를 복제하려는 의도가 아닙니다; 해당 액티비티는 여전히 시스템이 제공하는 바이너리 등에 링크됩니다. 아키브를 압축하여 네트워크로 보내는 것 외에는 서버 사이드 컴포넌트도 없으며, 액티비티들이 자기 포함 self-contained되므로, 디펜던시 체킹도 없습니다.