1414
1515class OswInstance (OswBaseModel ):
1616 domain : str
17- cred_fp : Union [str , Path ]
17+ cred_filepath : Union [str , Path ]
1818 credentials_manager : Optional [CredentialManager ]
1919 osw : Optional [OSW ]
2020 wtsite : Optional [WtSite ]
2121
2222 class Config :
2323 arbitrary_types_allowed = True
2424
25- def __init__ (self , domain : str , cred_fp : Union [str , Path ]):
26- super ().__init__ (** {"domain" : domain , "cred_fp " : cred_fp })
27- self .credentials_manager = CredentialManager (cred_filepath = cred_fp )
25+ def __init__ (self , domain : str , cred_filepath : Union [str , Path ]):
26+ super ().__init__ (** {"domain" : domain , "cred_filepath " : cred_filepath })
27+ self .credentials_manager = CredentialManager (cred_filepath = cred_filepath )
2828 self .osw = OSW (
2929 site = WtSite (
3030 WtSite .WtSiteConfig (iri = domain , cred_mngr = self .credentials_manager )
@@ -115,20 +115,20 @@ def copy_pages_from(
115115 source_domain : str ,
116116 to_target_domains : List [str ],
117117 page_titles : List [str ],
118- cred_fp : Union [str , Path ],
118+ cred_filepath : Union [str , Path ],
119119 comment : str = None ,
120120 overwrite : bool = False ,
121121):
122122 if comment is None :
123123 comment = f"[bot edit] Copied from { source_domain } "
124124 osw_source = OswInstance (
125125 domain = source_domain ,
126- cred_fp = cred_fp ,
126+ cred_filepath = cred_filepath ,
127127 )
128128 osw_targets = [
129129 OswInstance (
130130 domain = domain ,
131- cred_fp = cred_fp ,
131+ cred_filepath = cred_filepath ,
132132 )
133133 for domain in to_target_domains
134134 ]
@@ -150,7 +150,7 @@ def copy_pages_from(
150150
151151
152152if __name__ == "__main__" :
153- credentials_fp = Path (r"accounts.pwd.yaml" )
153+ cred_filepath_ = Path (r"accounts.pwd.yaml" )
154154 source = "onto-wiki.eu"
155155 targets = ["wiki-dev.open-semantic-lab.org" ]
156156 titles = [
@@ -164,26 +164,26 @@ def copy_pages_from(
164164 source_domain = source ,
165165 to_target_domains = targets ,
166166 page_titles = titles ,
167- cred_fp = credentials_fp ,
167+ cred_filepath = cred_filepath_ ,
168168 overwrite = True ,
169169 )
170170 # Implementation within wtsite
171171 use_wtsite = True
172172 if use_wtsite :
173- osw_source = OswInstance (
173+ osw_source_ = OswInstance (
174174 domain = source ,
175- cred_fp = credentials_fp ,
175+ cred_filepath = cred_filepath_ ,
176176 )
177- osw_targets = [
177+ osw_targets_ = [
178178 OswInstance (
179179 domain = target ,
180- cred_fp = credentials_fp ,
180+ cred_filepath = cred_filepath_ ,
181181 )
182182 for target in targets
183183 ]
184- source_site = osw_source .wtsite
185- target_sites = [osw_target .wtsite for osw_target in osw_targets ]
186- result = {}
184+ source_site = osw_source_ .wtsite
185+ target_sites : List [ WtSite ] = [osw_target .wtsite for osw_target in osw_targets_ ]
186+ result_ = {}
187187 for target_site in target_sites :
188188 target = target_site .mw_site .host
189189 copied_pages = target_site .copy_pages (
@@ -194,4 +194,4 @@ def copy_pages_from(
194194 parallel = False ,
195195 )
196196 )
197- result [target ] = copied_pages
197+ result_ [target ] = copied_pages
0 commit comments